summaryrefslogtreecommitdiff
path: root/libs/hwui/GlopBuilder.cpp
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2017-04-15 21:41:22 -0700
committer Romain Guy <romainguy@google.com> 2017-04-15 21:41:22 -0700
commit55455181233cadcd6d2e28d28d0dfc9a653f7787 (patch)
treedf8e1a022f7363fa15d0b11a0f90035b7a76c259 /libs/hwui/GlopBuilder.cpp
parent7859022e8eeabb5aa65af15773fe9cff329c71ec (diff)
Properly decode colors spaces in BitmapRegionDecoder
Reusing a bitmap with BitmapRegionDecoder would preserve the previous color space. This change also tweaks color space matching to make sure we pick Display P3 with parameter d=0.039 or d=0.04045 Bug: 36905374 Test: CtsGraphicsTestCases Change-Id: I4d2d66e5babebb0b5ce5cbdc7e8244177b4b7f9c
Diffstat (limited to 'libs/hwui/GlopBuilder.cpp')
-rw-r--r--libs/hwui/GlopBuilder.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/hwui/GlopBuilder.cpp b/libs/hwui/GlopBuilder.cpp
index 3e7a246bb281..931a55a70fd8 100644
--- a/libs/hwui/GlopBuilder.cpp
+++ b/libs/hwui/GlopBuilder.cpp
@@ -600,12 +600,12 @@ void verify(const ProgramDescription& description, const Glop& glop) {
void GlopBuilder::build() {
REQUIRE_STAGES(kAllStages);
if (mOutGlop->mesh.vertices.attribFlags & VertexAttribFlags::TextureCoord) {
- if (mOutGlop->fill.texture.texture->target() == GL_TEXTURE_2D) {
+ Texture* texture = mOutGlop->fill.texture.texture;
+ if (texture->target() == GL_TEXTURE_2D) {
mDescription.hasTexture = true;
} else {
mDescription.hasExternalTexture = true;
}
- Texture* texture = mOutGlop->fill.texture.texture;
mDescription.hasLinearTexture = texture->isLinear();
mDescription.hasColorSpaceConversion = texture->hasColorSpaceConversion();
mDescription.transferFunction = texture->getTransferFunctionType();