diff options
author | senorblanco <senorblanco@chromium.org> | 2016-06-09 12:43:30 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-09 12:43:30 -0700 |
commit | ea9767356385866263a3164dcc1fb9e1633f57ef (patch) | |
tree | eb25103febdab3c49a11ab987ccb2c14af4a2ec0 | |
parent | 2843c42e594bf45f48a29f4195ec39aeeb92b2bc (diff) |
SkPictureAnalyzer: expose the number of slow GPU commands.
BUG=614724
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2031243003
Review-Url: https://codereview.chromium.org/2031243003
-rw-r--r-- | include/core/SkPictureAnalyzer.h | 6 | ||||
-rw-r--r-- | src/core/SkPictureAnalyzer.cpp | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/include/core/SkPictureAnalyzer.h b/include/core/SkPictureAnalyzer.h index b58807ca89..c46ca1e854 100644 --- a/include/core/SkPictureAnalyzer.h +++ b/include/core/SkPictureAnalyzer.h @@ -48,6 +48,12 @@ public: */ bool suitableForGpuRasterization(const char** whyNot = nullptr) const; + /** + * Returns the number of commands which are slow to draw on the GPU, capped at the predicate + * max. + */ + uint32_t numSlowGpuCommands() { return fNumSlowPaths; } + private: uint32_t fNumSlowPaths; diff --git a/src/core/SkPictureAnalyzer.cpp b/src/core/SkPictureAnalyzer.cpp index 9f62d1dafe..b1d61aebba 100644 --- a/src/core/SkPictureAnalyzer.cpp +++ b/src/core/SkPictureAnalyzer.cpp @@ -31,7 +31,7 @@ SkPictureGpuAnalyzer::SkPictureGpuAnalyzer(const sk_sp<SkPicture>& picture, } void SkPictureGpuAnalyzer::analyzePicture(const SkPicture* picture) { - if (!picture || veto_predicate(fNumSlowPaths)) { + if (!picture) { return; } @@ -39,10 +39,6 @@ void SkPictureGpuAnalyzer::analyzePicture(const SkPicture* picture) { } void SkPictureGpuAnalyzer::analyzeClipPath(const SkPath& path, SkRegion::Op op, bool doAntiAlias) { - if (veto_predicate(fNumSlowPaths)) { - return; - } - const SkRecords::ClipPath clipOp = { SkIRect::MakeEmpty(), // Willie don't care. path, |