diff options
author | 2012-07-18 20:26:02 -0700 | |
---|---|---|
committer | 2012-07-18 20:39:45 -0700 | |
commit | eb61cd8296ed7e3f3aef5bd430d846aa54d5d7e2 (patch) | |
tree | baf241a0b6912a8304843a542dfadf4b869474c1 /libs/hwui/GradientCache.cpp | |
parent | 63553478130f78d44c8fbeaebc610e19925544a5 (diff) |
Optimize gradient textures
Compute the size of the backing textures based on the maximum possible
number of shades in the gradient.
Change-Id: I2d7f20477d31b81e9735f2c1d83ebdd0dbcbe340
Diffstat (limited to 'libs/hwui/GradientCache.cpp')
-rw-r--r-- | libs/hwui/GradientCache.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/hwui/GradientCache.cpp b/libs/hwui/GradientCache.cpp index 3678788d5d50..0016b8145fda 100644 --- a/libs/hwui/GradientCache.cpp +++ b/libs/hwui/GradientCache.cpp @@ -117,7 +117,7 @@ void GradientCache::clear() { Texture* GradientCache::addLinearGradient(GradientCacheEntry& gradient, uint32_t* colors, float* positions, int count, SkShader::TileMode tileMode) { SkBitmap bitmap; - bitmap.setConfig(SkBitmap::kARGB_8888_Config, 1024, 1); + bitmap.setConfig(SkBitmap::kARGB_8888_Config, 256 * (count - 1), 1); bitmap.allocPixels(); bitmap.eraseColor(0); |