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
diff --git a/include/core/SkPictureAnalyzer.h b/include/core/SkPictureAnalyzer.h
index b58807c..c46ca1e 100644
--- a/include/core/SkPictureAnalyzer.h
+++ b/include/core/SkPictureAnalyzer.h
@@ -48,6 +48,12 @@
*/
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 9f62d1d..b1d61ae 100644
--- a/src/core/SkPictureAnalyzer.cpp
+++ b/src/core/SkPictureAnalyzer.cpp
@@ -31,7 +31,7 @@
}
void SkPictureGpuAnalyzer::analyzePicture(const SkPicture* picture) {
- if (!picture || veto_predicate(fNumSlowPaths)) {
+ if (!picture) {
return;
}
@@ -39,10 +39,6 @@
}
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,