Skip to content

Commit 9f44a13

Browse files
committed
Multiply alpha for AA as late as possible
Should be done after all color computation Change-Id: Iaadd565f7d2263f111f6841a00e7c341025833d3
1 parent 4899d6f commit 9f44a13

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)