From 320d46bf844b84351cb80c5d4a4768d86447ac81 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Wed, 8 Aug 2012 16:05:42 -0700 Subject: Reduce gradients textures size whenever possible Change-Id: Ifd58625ee62edac3b5d20b77553cb98b6fa2b46e --- libs/hwui/ProgramCache.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'libs/hwui/ProgramCache.cpp') diff --git a/libs/hwui/ProgramCache.cpp b/libs/hwui/ProgramCache.cpp index 0e77cb23df81..d67bfbe3d4ea 100644 --- a/libs/hwui/ProgramCache.cpp +++ b/libs/hwui/ProgramCache.cpp @@ -69,12 +69,10 @@ const char* gVS_Header_Varyings_HasBitmap = "varying highp vec2 outBitmapTexCoords;\n"; const char* gVS_Header_Varyings_PointHasBitmap = "varying highp vec2 outPointBitmapTexCoords;\n"; -// TODO: These values are used to sample from textures, -// they may need to be highp const char* gVS_Header_Varyings_HasGradient[6] = { // Linear "varying highp vec2 linear;\n", - "varying highp float linear;\n", + "varying float linear;\n", // Circular "varying highp vec2 circular;\n", @@ -268,21 +266,21 @@ const char* gFS_Main_FetchA8Texture[2] = { }; const char* gFS_Main_FetchGradient[6] = { // Linear - " highp vec4 gradientColor = texture2D(gradientSampler, linear);\n", + " vec4 gradientColor = texture2D(gradientSampler, linear);\n", - " highp vec4 gradientColor = mix(startColor, endColor, clamp(linear, 0.0, 1.0));\n", + " vec4 gradientColor = mix(startColor, endColor, clamp(linear, 0.0, 1.0));\n", // Circular - " highp vec4 gradientColor = texture2D(gradientSampler, vec2(length(circular), 0.5));\n", + " vec4 gradientColor = texture2D(gradientSampler, vec2(length(circular), 0.5));\n", - " highp vec4 gradientColor = mix(startColor, endColor, clamp(length(circular), 0.0, 1.0));\n", + " vec4 gradientColor = mix(startColor, endColor, clamp(length(circular), 0.0, 1.0));\n", // Sweep " highp float index = atan(sweep.y, sweep.x) * 0.15915494309; // inv(2 * PI)\n" - " highp vec4 gradientColor = texture2D(gradientSampler, vec2(index - floor(index), 0.5));\n", + " vec4 gradientColor = texture2D(gradientSampler, vec2(index - floor(index), 0.5));\n", " highp float index = atan(sweep.y, sweep.x) * 0.15915494309; // inv(2 * PI)\n" - " highp vec4 gradientColor = mix(startColor, endColor, clamp(index - floor(index), 0.0, 1.0));\n" + " vec4 gradientColor = mix(startColor, endColor, clamp(index - floor(index), 0.0, 1.0));\n" }; const char* gFS_Main_FetchBitmap = " vec4 bitmapColor = texture2D(bitmapSampler, outBitmapTexCoords);\n"; -- cgit v1.2.3-59-g8ed1b