Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Unified Diff: src/core/SkPictureAnalyzer.cpp

Issue 2000423005: Complex clipPath accounting (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: review Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkPictureAnalyzer.h ('k') | src/core/SkPictureCommon.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPictureAnalyzer.cpp
diff --git a/src/core/SkPictureAnalyzer.cpp b/src/core/SkPictureAnalyzer.cpp
index 0ba420258bb3d389b3f5a081278e622901bfc6dc..49c4fce779271c4c981ce3ba7643a6c30567d91b 100644
--- a/src/core/SkPictureAnalyzer.cpp
+++ b/src/core/SkPictureAnalyzer.cpp
@@ -5,8 +5,11 @@
* found in the LICENSE file.
*/
+#include "SkPath.h"
#include "SkPicture.h"
#include "SkPictureAnalyzer.h"
+#include "SkPictureCommon.h"
+#include "SkRecords.h"
#if SK_SUPPORT_GPU
@@ -27,7 +30,7 @@ SkPictureGpuAnalyzer::SkPictureGpuAnalyzer(const sk_sp<SkPicture>& picture,
this->analyze(picture.get());
}
-void SkPictureGpuAnalyzer::analyze(const SkPicture* picture) {
+void SkPictureGpuAnalyzer::analyzePicture(const SkPicture* picture) {
if (!picture || veto_predicate(fNumSlowPaths)) {
return;
}
@@ -35,6 +38,22 @@ void SkPictureGpuAnalyzer::analyze(const SkPicture* picture) {
fNumSlowPaths += picture->numSlowPaths();
}
+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,
+ SkRecords::RegionOpAndAA(op, doAntiAlias)
+ };
+
+ SkPathCounter counter;
+ counter(clipOp);
+ fNumSlowPaths += counter.fNumSlowPathsAndDashEffects;
+}
+
void SkPictureGpuAnalyzer::reset() {
fNumSlowPaths = 0;
}
« no previous file with comments | « include/core/SkPictureAnalyzer.h ('k') | src/core/SkPictureCommon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698