diff options
author | Chris Dalton <csmartdalton@google.com> | 2017-10-17 10:40:01 -0600 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-17 18:48:42 +0000 |
commit | a2ac30da36c80f616c909c671a240f2d468db124 (patch) | |
tree | 0f6190b0f04c83e2c2b0c24b850b9e9ebcb83e54 /bench/PathTextBench.cpp | |
parent | 2fb81c04d74973181208f4f33eb6be4d4bae0321 (diff) |
Enable CCPR for volatile paths
Enables for volatile paths and when path mask caching is disabled.
Bug: skia:
Change-Id: I644b17f2a4f77a4ddf85265f520599499c0800cf
Reviewed-on: https://skia-review.googlesource.com/60481
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'bench/PathTextBench.cpp')
-rw-r--r-- | bench/PathTextBench.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bench/PathTextBench.cpp b/bench/PathTextBench.cpp index 6ee8f8879c..6551fa5f27 100644 --- a/bench/PathTextBench.cpp +++ b/bench/PathTextBench.cpp @@ -27,11 +27,12 @@ static_assert(52 == kNumGlyphs, "expected 52 glyphs"); */ class PathTextBench : public Benchmark { public: + PathTextBench(bool cached) : fCached(cached) {} bool isVisual() override { return true; } private: const char* onGetName() override { - return "path_text"; + return fCached ? "path_text" : "path_text_uncached"; } SkIPoint onGetSize() override { return SkIPoint::Make(kScreenWidth, kScreenHeight); } @@ -42,6 +43,7 @@ private: for (int i = 0; i < kNumGlyphs; ++i) { SkGlyphID id = cache->unicharToGlyph(kGlyphs[i]); cache->getScalerContext()->getPath(SkPackedGlyphID(id), &fGlyphs[i]); + fGlyphs[i].setIsVolatile(!fCached); } SkRandom rand; @@ -76,6 +78,7 @@ private: } } + const bool fCached; SkPath fGlyphs[kNumGlyphs]; SkPaint fPaints[kNumDraws]; SkMatrix fXforms[kNumDraws]; @@ -83,4 +86,5 @@ private: typedef Benchmark INHERITED; }; -DEF_BENCH(return new PathTextBench;) +DEF_BENCH(return new PathTextBench(false);) +DEF_BENCH(return new PathTextBench(true);) |