summaryrefslogtreecommitdiffstats
path: root/libs/hwui/SkiaShader.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/SkiaShader.h')
-rw-r--r--libs/hwui/SkiaShader.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/libs/hwui/SkiaShader.h b/libs/hwui/SkiaShader.h
index cc94ae6..0023c46 100644
--- a/libs/hwui/SkiaShader.h
+++ b/libs/hwui/SkiaShader.h
@@ -145,6 +145,44 @@ private:
}; // struct SkiaLinearGradientShader
/**
+ * A shader that draws a sweep gradient.
+ */
+struct SkiaSweepGradientShader: public SkiaShader {
+ SkiaSweepGradientShader(float x, float y, uint32_t* colors, float* positions, int count,
+ SkShader* key, SkMatrix* matrix, bool blend);
+ ~SkiaSweepGradientShader();
+
+ virtual void describe(ProgramDescription& description, const Extensions& extensions);
+ virtual void setupProgram(Program* program, const mat4& modelView, const Snapshot& snapshot,
+ GLuint* textureUnit);
+ void updateTransforms(Program* program, const mat4& modelView, const Snapshot& snapshot);
+
+protected:
+ SkiaSweepGradientShader(Type type, float x, float y, uint32_t* colors, float* positions,
+ int count, SkShader* key, SkShader::TileMode tileMode, SkMatrix* matrix, bool blend);
+
+ float mX, mY;
+ uint32_t* mColors;
+ float* mPositions;
+ int mCount;
+}; // struct SkiaSweepGradientShader
+
+/**
+ * A shader that draws a circular gradient.
+ */
+struct SkiaCircularGradientShader: public SkiaSweepGradientShader {
+ SkiaCircularGradientShader(float x, float y, float radius, uint32_t* colors, float* positions,
+ int count, SkShader* key,SkShader::TileMode tileMode, SkMatrix* matrix, bool blend);
+
+ void describe(ProgramDescription& description, const Extensions& extensions);
+ void setupProgram(Program* program, const mat4& modelView, const Snapshot& snapshot,
+ GLuint* textureUnit);
+
+private:
+ float mRadius;
+}; // struct SkiaCircularGradientShader
+
+/**
* A shader that draws two shaders, composited with an xfermode.
*/
struct SkiaComposeShader: public SkiaShader {