summaryrefslogtreecommitdiff
path: root/libs/hwui/Program.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/Program.h')
-rw-r--r--libs/hwui/Program.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/libs/hwui/Program.h b/libs/hwui/Program.h
index d90bcaf382ed..d7970d92ab3f 100644
--- a/libs/hwui/Program.h
+++ b/libs/hwui/Program.h
@@ -148,6 +148,7 @@ public:
* Name of the color uniform.
*/
int color;
+
/**
* Name of the transform uniform.
*/
@@ -189,6 +190,44 @@ public:
int texCoords;
};
+/**
+ * Program used to draw linear gradients. In addition to everything that the
+ * DrawColorProgram supports, the following two attributes must be specified:
+ * vec2 gradient, the vector describing the linear gradient
+ * float gradientLength, the invert of the magnitude of the gradient vector
+ * sampler2D sampler, the texture sampler
+ */
+class DrawLinearGradientProgram: public DrawColorProgram {
+public:
+ DrawLinearGradientProgram();
+
+ /**
+ * Binds this program to the GL context.
+ */
+ virtual void use();
+
+ /**
+ * Marks this program as unused. This will not unbind
+ * the program from the GL context.
+ */
+ virtual void remove();
+
+ /**
+ * Name of the linear gradient vector.
+ */
+ int gradient;
+
+ /**
+ * Name of the inverse of linear gradient vector's magnitude.
+ */
+ int gradientLength;
+
+ /**
+ * Name of the texture sampler uniform.
+ */
+ int sampler;
+};
+
}; // namespace uirenderer
}; // namespace android