Improve gradients
Avoid using textures for common gradients (two stops from 0.0 to 1.0)
Change-Id: Iff55d21b126c8cfc4cfb701669f2339c8f6b131a
diff --git a/libs/hwui/SkiaShader.h b/libs/hwui/SkiaShader.h
index 2de9a93..a710b86 100644
--- a/libs/hwui/SkiaShader.h
+++ b/libs/hwui/SkiaShader.h
@@ -154,13 +154,6 @@
SkiaBitmapShader() {
}
- /**
- * This method does not work for n == 0.
- */
- inline bool isPowerOfTwo(unsigned int n) {
- return !(n & (n - 1));
- }
-
SkBitmap* mBitmap;
Texture* mTexture;
GLenum mWrapS;
@@ -185,6 +178,7 @@
SkiaLinearGradientShader() {
}
+ bool mIsSimple;
float* mBounds;
uint32_t* mColors;
float* mPositions;
@@ -211,6 +205,7 @@
SkiaSweepGradientShader() {
}
+ bool mIsSimple;
uint32_t* mColors;
float* mPositions;
int mCount;