Optimize gradient textures
Compute the size of the backing textures based on the maximum possible number of shades in the gradient. Change-Id: I2d7f20477d31b81e9735f2c1d83ebdd0dbcbe340
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user