From efb4b06493fe7b1604c762a448b13c7af2845a8d Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Mon, 27 Feb 2017 11:00:04 -0800 Subject: Add ColorSpace information on Bitmap This is the first step toward interpreting color spaces at render time. Bug: 32984164 Test: BitmapColorSpaceTest in CtsGraphicsTestCases Change-Id: I0164a18f1ed74a745874fe5229168042afe27a04 --- libs/hwui/GradientCache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libs/hwui/GradientCache.cpp') diff --git a/libs/hwui/GradientCache.cpp b/libs/hwui/GradientCache.cpp index 71bee93fc4c7..18bfcc2bbddf 100644 --- a/libs/hwui/GradientCache.cpp +++ b/libs/hwui/GradientCache.cpp @@ -68,7 +68,7 @@ GradientCache::GradientCache(Extensions& extensions) , mMaxSize(Properties::gradientCacheSize) , mUseFloatTexture(extensions.hasFloatTextures()) , mHasNpot(extensions.hasNPot()) - , mHasSRGB(extensions.hasSRGB()) { + , mHasLinearBlending(extensions.hasLinearBlending()) { glGetIntegerv(GL_MAX_TEXTURE_SIZE, &mMaxTextureSize); mCache.setOnEntryRemovedListener(this); @@ -263,7 +263,7 @@ void GradientCache::generateTexture(uint32_t* colors, float* positions, if (mUseFloatTexture) { texture->upload(GL_RGBA16F, width, height, GL_RGBA, GL_FLOAT, pixels); } else { - GLint internalFormat = mHasSRGB ? GL_SRGB8_ALPHA8 : GL_RGBA; + GLint internalFormat = mHasLinearBlending ? GL_SRGB8_ALPHA8 : GL_RGBA; texture->upload(internalFormat, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels); } -- cgit v1.2.3-59-g8ed1b