diff options
author | Romain Guy <romainguy@google.com> | 2010-07-19 18:43:02 -0700 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2010-07-19 18:44:05 -0700 |
commit | c0ac193b9415680f0a69e20a3f5f22d16f8053be (patch) | |
tree | 9a1d680ad20ba3f6ec0924c6b445290696d63b8c /libs/hwui/OpenGLRenderer.h | |
parent | 9d339c13aaa30ddfd51d0f13f8ab22af05e40ea0 (diff) | |
download | frameworks_base-c0ac193b9415680f0a69e20a3f5f22d16f8053be.zip frameworks_base-c0ac193b9415680f0a69e20a3f5f22d16f8053be.tar.gz frameworks_base-c0ac193b9415680f0a69e20a3f5f22d16f8053be.tar.bz2 |
Add support for linear gradients.
Change-Id: Id15329da065045b3f06fdaed615f33cd57608496
Diffstat (limited to 'libs/hwui/OpenGLRenderer.h')
-rw-r--r-- | libs/hwui/OpenGLRenderer.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h index 5a530eb..dd7999d 100644 --- a/libs/hwui/OpenGLRenderer.h +++ b/libs/hwui/OpenGLRenderer.h @@ -36,6 +36,7 @@ #include "Snapshot.h" #include "TextureCache.h" #include "LayerCache.h" +#include "GradientCache.h" #include "PatchCache.h" #include "Vertex.h" @@ -104,7 +105,8 @@ public: void setupBitmapShader(SkBitmap* bitmap, SkShader::TileMode tileX, SkShader::TileMode tileY, SkMatrix* matrix, bool hasAlpha); void setupLinearGradientShader(SkShader* shader, float* bounds, uint32_t* colors, - float* positions, SkShader::TileMode tileMode, SkMatrix* matrix, bool hasAlpha); + float* positions, int count, SkShader::TileMode tileMode, + SkMatrix* matrix, bool hasAlpha); private: /** @@ -249,6 +251,19 @@ private: SkXfermode::Mode mode); /** + * Fills the specified rectangle with the currently set linear gradient shader. + * + * @param left The left coordinate of the rectangle + * @param top The top coordinate of the rectangle + * @param right The right coordinate of the rectangle + * @param bottom The bottom coordinate of the rectangle + * @param alpha An additional translucency parameter, between 0.0f and 1.0f + * @param mode The blending mode + */ + void drawLinearGradientShader(float left, float top, float right, float bottom, float alpha, + SkXfermode::Mode mode); + + /** * Resets the texture coordinates stored in mDrawTextureVertices. Setting the values * back to default is achieved by calling: * @@ -335,10 +350,12 @@ private: float* mShaderBounds; uint32_t* mShaderColors; float* mShaderPositions; + int mShaderCount; // Various caches TextureCache mTextureCache; LayerCache mLayerCache; + GradientCache mGradientCache; PatchCache mPatchCache; }; // class OpenGLRenderer |