aboutsummaryrefslogtreecommitdiff
path: root/samplecode/SampleApp.cpp
diff options
context:
space:
mode:
authorliyuqian <liyuqian@google.com>2016-10-04 09:29:51 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-04 09:29:51 -0700
commit7795822807478143120c33228b68d2ab3918af2c (patch)
tree7b84301091da3dbeba6b7785c46443fe1c6b7612 /samplecode/SampleApp.cpp
parentb25c3522446c9f84369dec2327ed9995fdb326de (diff)
Implement AnalyticAA for convex shapes.
Design doc: go/analyticAA A performance test can be found here: https://docs.google.com/a/google.com/spreadsheets/d/1n9LSjFzrQzx0hovFddWey0GSMXNRjl1oFuSypMlHWZk/edit?usp=sharing Our best case is filling big triangles, which according to our experiment has ~2.9x speedup. Our worst case is filling small ovals/circles, which has a ~1.06x slowdown. To see how our new algorithm changes the DM images, see: https://x20web.corp.google.com/~liyuqian/dmdiff/index.html The most significant changes are in convexpaths and analytic_antialias_convex BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2221103002 Review-Url: https://codereview.chromium.org/2221103002
Diffstat (limited to 'samplecode/SampleApp.cpp')
-rw-r--r--samplecode/SampleApp.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 233306c767..385268ef02 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -33,6 +33,7 @@
#include "SkTypeface.h"
#include "SkWindow.h"
#include "sk_tool_utils.h"
+#include "SkScan.h"
#include "SkReadBuffer.h"
#include "SkStream.h"
@@ -1800,6 +1801,11 @@ bool SampleWindow::onHandleChar(SkUnichar uni) {
this->inval(nullptr);
}
break;
+ case 'A':
+ GlobalAAConfig::getInstance().fUseAnalyticAA =
+ !GlobalAAConfig::getInstance().fUseAnalyticAA;
+ this->inval(nullptr);
+ break;
case 'B':
post_event_to_sink(new SkEvent("PictFileView::toggleBBox"), curr_view(this));
// Cannot call updateTitle() synchronously, because the toggleBBox event is still in