Add AA Analytic Compile Flag (and small fixes)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2410303002
Review-Url: https://codereview.chromium.org/2410303002
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 52e063d..1ee15df 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -1804,6 +1804,7 @@
case 'A':
gSkUseAnalyticAA = !gSkUseAnalyticAA.load();
this->inval(nullptr);
+ this->updateTitle();
break;
case 'B':
post_event_to_sink(new SkEvent("PictFileView::toggleBBox"), curr_view(this));
@@ -2154,6 +2155,9 @@
title.prepend(gDeviceTypePrefix[fDeviceType]);
+ if (gSkUseAnalyticAA) {
+ title.prepend("<AAA> ");
+ }
if (fTilingMode != kNo_Tiling) {
title.prependf("<T: %s> ", gTilingInfo[fTilingMode].label);
}
diff --git a/src/core/SkScan.cpp b/src/core/SkScan.cpp
index ceb9ff6..a7ecf31 100644
--- a/src/core/SkScan.cpp
+++ b/src/core/SkScan.cpp
@@ -10,7 +10,11 @@
#include "SkBlitter.h"
#include "SkRasterClip.h"
-std::atomic<bool> gSkUseAnalyticAA{false};
+#ifdef SK_ANALYTIC_AA
+ std::atomic<bool> gSkUseAnalyticAA{true};
+#else
+ std::atomic<bool> gSkUseAnalyticAA{false};
+#endif
static inline void blitrect(SkBlitter* blitter, const SkIRect& r) {
blitter->blitRect(r.fLeft, r.fTop, r.width(), r.height());
diff --git a/src/core/SkScan_AAAPath.cpp b/src/core/SkScan_AAAPath.cpp
index 501b2e6..147c24c 100644
--- a/src/core/SkScan_AAAPath.cpp
+++ b/src/core/SkScan_AAAPath.cpp
@@ -565,8 +565,7 @@
addAlpha(maskRow[x + 1], a2);
} else {
if (fullAlpha == 0xFF) {
- blitter->getRealBlitter()->blitV(x, y, 1, a1);
- blitter->getRealBlitter()->blitV(x + 1, y, 1, a2);
+ blitter->getRealBlitter()->blitAntiH2(x, y, a1, a2);
} else {
blitter->blitAntiH(x, y, a1);
blitter->blitAntiH(x + 1, y, a2);