summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Program.h
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2012-08-31 18:24:33 -0700
committerChris Craik <ccraik@google.com>2012-09-05 16:45:03 -0700
commit6ebdc114e0d72137394f02bc8ffe9d7a782a65c4 (patch)
tree4900dd3246e54b2dcaa869b519e181542467ae82 /libs/hwui/Program.h
parent176d105d2f71198966b566d36d4e856a797695c7 (diff)
downloadframeworks_base-6ebdc114e0d72137394f02bc8ffe9d7a782a65c4.zip
frameworks_base-6ebdc114e0d72137394f02bc8ffe9d7a782a65c4.tar.gz
frameworks_base-6ebdc114e0d72137394f02bc8ffe9d7a782a65c4.tar.bz2
Varying-based AA rect drawing
Instead of calculating opacity from relative position in the shader, use a shader varying to do this computation for us. bug:5045101 Also adds a test to HwAccelerationTest to show incorrect antialiasing in scaled drawAARect / boundarySize calculation. Change-Id: Icdc41acb01dc10ce354834f8389a5aed2f439162
Diffstat (limited to 'libs/hwui/Program.h')
-rw-r--r--libs/hwui/Program.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/hwui/Program.h b/libs/hwui/Program.h
index 1818f82..a3bfaa4 100644
--- a/libs/hwui/Program.h
+++ b/libs/hwui/Program.h
@@ -81,6 +81,8 @@ namespace uirenderer {
#define PROGRAM_IS_SIMPLE_GRADIENT 41
+#define PROGRAM_IS_AA_RECT_SHIFT 42
+
///////////////////////////////////////////////////////////////////////////////
// Types
///////////////////////////////////////////////////////////////////////////////
@@ -128,6 +130,7 @@ struct ProgramDescription {
bool isBitmapNpot;
bool isAA;
+ bool isAARect;
bool hasGradient;
Gradient gradientType;
@@ -165,6 +168,7 @@ struct ProgramDescription {
hasTextureTransform = false;
isAA = false;
+ isAARect = false;
modulate = false;
@@ -260,6 +264,7 @@ struct ProgramDescription {
if (hasTextureTransform) key |= programid(0x1) << PROGRAM_HAS_TEXTURE_TRANSFORM_SHIFT;
if (hasGammaCorrection) key |= programid(0x1) << PROGRAM_HAS_GAMMA_CORRECTION;
if (isSimpleGradient) key |= programid(0x1) << PROGRAM_IS_SIMPLE_GRADIENT;
+ if (isAARect) key |= programid(0x1) << PROGRAM_IS_AA_RECT_SHIFT;
return key;
}