summaryrefslogtreecommitdiffstats
path: root/libs/hwui/ProgramCache.cpp
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2012-09-13 18:34:55 -0700
committerChris Craik <ccraik@google.com>2012-09-13 18:34:55 -0700
commit9f44a13a125980fee92cdc76376063129f0eebc9 (patch)
treef1eaeeda57bea37623366e1c16ffd61a632126fc /libs/hwui/ProgramCache.cpp
parent4899d6f7cc45268a4f8d734639fb3f03d39d9d4a (diff)
downloadframeworks_base-9f44a13a125980fee92cdc76376063129f0eebc9.zip
frameworks_base-9f44a13a125980fee92cdc76376063129f0eebc9.tar.gz
frameworks_base-9f44a13a125980fee92cdc76376063129f0eebc9.tar.bz2
Multiply alpha for AA as late as possible
Should be done after all color computation Change-Id: Iaadd565f7d2263f111f6841a00e7c341025833d3
Diffstat (limited to 'libs/hwui/ProgramCache.cpp')
-rw-r--r--libs/hwui/ProgramCache.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/libs/hwui/ProgramCache.cpp b/libs/hwui/ProgramCache.cpp
index 0ed8008..be8f80a 100644
--- a/libs/hwui/ProgramCache.cpp
+++ b/libs/hwui/ProgramCache.cpp
@@ -671,11 +671,6 @@ String8 ProgramCache::generateFragmentShader(const ProgramDescription& descripti
shader.append(gFS_Main_FetchColor);
}
}
- if (description.isAARect) {
- shader.append(gFS_Main_AccountForAARect);
- } else if (description.isAA) {
- shader.append(gFS_Main_AccountForAA);
- }
if (description.hasGradient) {
shader.append(gFS_Main_FetchGradient[gradientIndex(description)]);
shader.append(gFS_Main_AddDitherToGradient);
@@ -721,6 +716,13 @@ String8 ProgramCache::generateFragmentShader(const ProgramDescription& descripti
}
// Apply the color op if needed
shader.append(gFS_Main_ApplyColorOp[description.colorOp]);
+
+ if (description.isAARect) {
+ shader.append(gFS_Main_AccountForAARect);
+ } else if (description.isAA) {
+ shader.append(gFS_Main_AccountForAA);
+ }
+
// Output the fragment
if (!blendFramebuffer) {
shader.append(gFS_Main_FragColor);