diff options
author | liyuqian <liyuqian@google.com> | 2016-10-04 09:29:51 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-04 09:29:51 -0700 |
commit | 7795822807478143120c33228b68d2ab3918af2c (patch) | |
tree | 7b84301091da3dbeba6b7785c46443fe1c6b7612 /src/core/SkScan.h | |
parent | b25c3522446c9f84369dec2327ed9995fdb326de (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 'src/core/SkScan.h')
-rw-r--r-- | src/core/SkScan.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/core/SkScan.h b/src/core/SkScan.h index 4aa8e44399..1e3d60a290 100644 --- a/src/core/SkScan.h +++ b/src/core/SkScan.h @@ -22,6 +22,24 @@ class SkPath; */ typedef SkIRect SkXRect; +class GlobalAAConfig { +private: + GlobalAAConfig() {} + +public: + bool fUseAnalyticAA = false; + + GlobalAAConfig(const GlobalAAConfig&) = delete; + void operator=(const GlobalAAConfig&) = delete; + + static GlobalAAConfig& getInstance() { + static GlobalAAConfig instance; + return instance; + } +}; + +class AdditiveBlitter; + class SkScan { public: /* @@ -45,6 +63,7 @@ public: static void AntiFillXRect(const SkXRect&, const SkRasterClip&, SkBlitter*); static void FillPath(const SkPath&, const SkRasterClip&, SkBlitter*); static void AntiFillPath(const SkPath&, const SkRasterClip&, SkBlitter*); + static void AAAFillPath(const SkPath&, const SkRasterClip&, SkBlitter*); static void FrameRect(const SkRect&, const SkPoint& strokeSize, const SkRasterClip&, SkBlitter*); static void AntiFrameRect(const SkRect&, const SkPoint& strokeSize, @@ -79,6 +98,9 @@ private: const SkRegion*, SkBlitter*); static void HairLineRgn(const SkPoint[], int count, const SkRegion*, SkBlitter*); static void AntiHairLineRgn(const SkPoint[], int count, const SkRegion*, SkBlitter*); + static void AAAFillPath(const SkPath& path, const SkRegion& origClip, SkBlitter* blitter); + static void aaa_fill_path(const SkPath& path, const SkIRect* clipRect, AdditiveBlitter*, + int start_y, int stop_y, const SkRegion& clipRgn, bool isUsingMask); }; /** Assign an SkXRect from a SkIRect, by promoting the src rect's coordinates |