diff options
author | Romain Guy <romainguy@google.com> | 2011-05-02 17:24:22 -0700 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2011-05-02 18:32:29 -0700 |
commit | 8f0095cd33558e9cc8a440047908e53b68906f5f (patch) | |
tree | 2f55d779bf102e0c134357d89c7de69d0444634a /libs/hwui/ProgramCache.cpp | |
parent | 3a5c227279011f850036c29e7c0bc96023298d5c (diff) |
Allows to render with an OpenGL context inside a TextureView.
Change-Id: I59453f7fc3997f0502a1c5d325d37fed376fabc7
Diffstat (limited to 'libs/hwui/ProgramCache.cpp')
-rw-r--r-- | libs/hwui/ProgramCache.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/libs/hwui/ProgramCache.cpp b/libs/hwui/ProgramCache.cpp index 62ac2baaf7b6..297f5a968dd3 100644 --- a/libs/hwui/ProgramCache.cpp +++ b/libs/hwui/ProgramCache.cpp @@ -385,7 +385,7 @@ String8 ProgramCache::generateVertexShader(const ProgramDescription& description } // Uniforms shader.append(gVS_Header_Uniforms); - if (description.hasExternalTexture) { + if (description.hasTextureTransform) { shader.append(gVS_Header_Uniforms_TextureTransform); } if (description.hasGradient) { @@ -415,11 +415,10 @@ String8 ProgramCache::generateVertexShader(const ProgramDescription& description // Begin the shader shader.append(gVS_Main); { - if (description.hasTexture) { - shader.append(gVS_Main_OutTexCoords); - } - if (description.hasExternalTexture) { + if (description.hasTextureTransform) { shader.append(gVS_Main_OutTransformedTexCoords); + } else if (description.hasTexture || description.hasExternalTexture) { + shader.append(gVS_Main_OutTexCoords); } if (description.hasWidth) { shader.append(gVS_Main_Width); @@ -487,8 +486,7 @@ String8 ProgramCache::generateFragmentShader(const ProgramDescription& descripti } if (description.hasTexture) { shader.append(gFS_Uniforms_TextureSampler); - } - if (description.hasExternalTexture) { + } else if (description.hasExternalTexture) { shader.append(gFS_Uniforms_ExternalTextureSampler); } if (description.hasWidth) { |