summaryrefslogtreecommitdiffstats
path: root/libs/hwui/shaders
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-07-09 16:13:28 -0700
committerRomain Guy <romainguy@google.com>2010-07-09 16:13:28 -0700
commit16202fc9745e9b11db089ebc8f40119d13732016 (patch)
tree1765a6146b9a4fcaf9513e1b9bc851e47fdc76b3 /libs/hwui/shaders
parent82164ad543b4eb6c11937b2a81891443317709cc (diff)
downloadframeworks_base-16202fc9745e9b11db089ebc8f40119d13732016.zip
frameworks_base-16202fc9745e9b11db089ebc8f40119d13732016.tar.gz
frameworks_base-16202fc9745e9b11db089ebc8f40119d13732016.tar.bz2
Fix alpha blending and improve fragment shaders performance.
Change-Id: Ib74f6941d25ca6f6a41708e541174eaa7e8d9bc2
Diffstat (limited to 'libs/hwui/shaders')
-rw-r--r--libs/hwui/shaders/drawColor.frag4
-rw-r--r--libs/hwui/shaders/drawColor.vert4
-rw-r--r--libs/hwui/shaders/drawTexture.frag4
-rw-r--r--libs/hwui/shaders/drawTexture.vert3
4 files changed, 4 insertions, 11 deletions
diff --git a/libs/hwui/shaders/drawColor.frag b/libs/hwui/shaders/drawColor.frag
index e84c47b..0628850 100644
--- a/libs/hwui/shaders/drawColor.frag
+++ b/libs/hwui/shaders/drawColor.frag
@@ -1,9 +1,9 @@
SHADER_SOURCE(gDrawColorFragmentShader,
-varying lowp vec4 outColor;
+uniform vec4 color;
void main(void) {
- gl_FragColor = outColor;
+ gl_FragColor = color;
}
);
diff --git a/libs/hwui/shaders/drawColor.vert b/libs/hwui/shaders/drawColor.vert
index cef6e49..742ed98 100644
--- a/libs/hwui/shaders/drawColor.vert
+++ b/libs/hwui/shaders/drawColor.vert
@@ -1,16 +1,12 @@
SHADER_SOURCE(gDrawColorVertexShader,
attribute vec4 position;
-attribute vec4 color;
uniform mat4 projection;
uniform mat4 modelView;
uniform mat4 transform;
-varying vec4 outColor;
-
void main(void) {
- outColor = color;
gl_Position = projection * transform * modelView * position;
}
diff --git a/libs/hwui/shaders/drawTexture.frag b/libs/hwui/shaders/drawTexture.frag
index 5bd420e..0f2aa91 100644
--- a/libs/hwui/shaders/drawTexture.frag
+++ b/libs/hwui/shaders/drawTexture.frag
@@ -1,12 +1,12 @@
SHADER_SOURCE(gDrawTextureFragmentShader,
-varying lowp vec4 outColor;
varying mediump vec2 outTexCoords;
+uniform vec4 color;
uniform sampler2D sampler;
void main(void) {
- gl_FragColor = texture2D(sampler, outTexCoords) * outColor;
+ gl_FragColor = texture2D(sampler, outTexCoords) * color;
}
);
diff --git a/libs/hwui/shaders/drawTexture.vert b/libs/hwui/shaders/drawTexture.vert
index 310a812..8abddb8 100644
--- a/libs/hwui/shaders/drawTexture.vert
+++ b/libs/hwui/shaders/drawTexture.vert
@@ -2,17 +2,14 @@ SHADER_SOURCE(gDrawTextureVertexShader,
attribute vec4 position;
attribute vec2 texCoords;
-attribute vec4 color;
uniform mat4 projection;
uniform mat4 modelView;
uniform mat4 transform;
-varying vec4 outColor;
varying vec2 outTexCoords;
void main(void) {
- outColor = color;
outTexCoords = texCoords;
gl_Position = projection * transform * modelView * position;
}