From e3095e0c1e2a4a4f34f741aa386eae56536ca5aa Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Wed, 6 Oct 2010 16:57:29 -0700 Subject: Apply 3D transformations to gradient shaders. This fixes only linear gradients. Sweep and radial gradients, as well as bitmap shaders, will be fixed in a future commit. Change-Id: I4eee4ff62e9bbf3b9339fc111a780167449ecfef --- libs/hwui/ProgramCache.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'libs/hwui/ProgramCache.cpp') diff --git a/libs/hwui/ProgramCache.cpp b/libs/hwui/ProgramCache.cpp index 3e9412cf0c78..d1a1b45bb2d3 100644 --- a/libs/hwui/ProgramCache.cpp +++ b/libs/hwui/ProgramCache.cpp @@ -35,9 +35,6 @@ const char* gVS_Header_Uniforms = "uniform mat4 transform;\n"; const char* gVS_Header_Uniforms_HasGradient[3] = { // Linear - "uniform float gradientLength;\n" - "uniform vec2 gradient;\n" - "uniform vec2 gradientStart;\n" "uniform mat4 screenSpace;\n", // Circular "uniform vec2 gradientStart;\n" @@ -69,8 +66,7 @@ const char* gVS_Main_OutTexCoords = " outTexCoords = texCoords;\n"; const char* gVS_Main_OutGradient[3] = { // Linear - " vec4 location = screenSpace * position;\n" - " index = dot(location.xy - gradientStart, gradient) * gradientLength;\n", + " index = (screenSpace * position).x;\n", // Circular " vec4 location = screenSpace * position;\n" " circular = (gradientMatrix * vec4(location.xy - gradientStart, 0.0, 0.0)).xy;\n", -- cgit v1.2.3-59-g8ed1b