summaryrefslogtreecommitdiff
path: root/libs/hwui/ProgramCache.cpp
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-05-02 18:33:26 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-05-02 18:33:26 -0700
commitdf0a7fbdcff3c683641b7980da50a7d0eebe0876 (patch)
treebce1f0ec1aecb5735a1dd17a7a5a87f13d7a94b0 /libs/hwui/ProgramCache.cpp
parent8ef9eaaea8cc27145bf159e45b7d9eaa0aae6d5c (diff)
parent8f0095cd33558e9cc8a440047908e53b68906f5f (diff)
Merge "Allows to render with an OpenGL context inside a TextureView."
Diffstat (limited to 'libs/hwui/ProgramCache.cpp')
-rw-r--r--libs/hwui/ProgramCache.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/libs/hwui/ProgramCache.cpp b/libs/hwui/ProgramCache.cpp
index 5bfe7a35e3ab..d419e3eab38c 100644
--- a/libs/hwui/ProgramCache.cpp
+++ b/libs/hwui/ProgramCache.cpp
@@ -394,7 +394,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) {
@@ -424,11 +424,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.isAA) {
shader.append(gVS_Main_AA);
@@ -496,8 +495,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.isAA) {