Skip to content

Commit 494ac35

Browse files
Romain GuyAndroid (Google) Code Review
authored andcommitted
Merge "Multiply alpha for AA as late as possible" into jb-mr1-dev
2 parents 2dc6af2 + 9f44a13 commit 494ac35

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

libs/hwui/ProgramCache.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -671,11 +671,6 @@ String8 ProgramCache::generateFragmentShader(const ProgramDescription& descripti
671671
shader.append(gFS_Main_FetchColor);
672672
}
673673
}
674-
if (description.isAARect) {
675-
shader.append(gFS_Main_AccountForAARect);
676-
} else if (description.isAA) {
677-
shader.append(gFS_Main_AccountForAA);
678-
}
679674
if (description.hasGradient) {
680675
shader.append(gFS_Main_FetchGradient[gradientIndex(description)]);
681676
shader.append(gFS_Main_AddDitherToGradient);
@@ -721,6 +716,13 @@ String8 ProgramCache::generateFragmentShader(const ProgramDescription& descripti
721716
}
722717
// Apply the color op if needed
723718
shader.append(gFS_Main_ApplyColorOp[description.colorOp]);
719+
720+
if (description.isAARect) {
721+
shader.append(gFS_Main_AccountForAARect);
722+
} else if (description.isAA) {
723+
shader.append(gFS_Main_AccountForAA);
724+
}
725+
724726
// Output the fragment
725727
if (!blendFramebuffer) {
726728
shader.append(gFS_Main_FragColor);

0 commit comments

Comments
 (0)