diff options
author | Yuqian Li <liyuqian@google.com> | 2017-07-10 15:02:36 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-07-10 19:36:58 +0000 |
commit | 6d70274ccf6e7a3729af53e401d2d9e6726035a3 (patch) | |
tree | 6a96d4794ada0296a51819e84532a8da89b80e1f | |
parent | a3659deab4d60c6927924023b706fbd902c771cb (diff) |
Always enable Analytic AA for rects
Previously, suitableForAAA disabled Analytic AA for small rects.
But that's a mistake. Re-enabling AAA will bring 10-20% speedup for small rects
(~800ns -> ~700ns measured by path_fill_small_rect nanobench).
Bug: skia:
Change-Id: I1d8bf4c105d8d116ea441a46e6c955c546bcbb22
Reviewed-on: https://skia-review.googlesource.com/22074
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
-rw-r--r-- | src/core/SkScan_AntiPath.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/SkScan_AntiPath.cpp b/src/core/SkScan_AntiPath.cpp index be91007ecb..69b5ba1fce 100644 --- a/src/core/SkScan_AntiPath.cpp +++ b/src/core/SkScan_AntiPath.cpp @@ -638,6 +638,9 @@ static bool suitableForAAA(const SkPath& path) { if (gSkForceAnalyticAA.load()) { return true; } + if (path.isRect(nullptr)) { + return true; + } const SkRect& bounds = path.getBounds(); // When the path have so many points compared to the size of its bounds/resolution, // it indicates that the path is not quite smooth in the current resolution: |