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

Unified Diff: src/core/SkPicture.cpp

Issue 470333002: approximateOpCount (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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/SkPicture.h ('k') | src/core/SkPictureData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPicture.cpp
diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp
index fa4c103d5ce1ca5506a5fc7b7731b7bf9c24572a..ab00000de411a3efc663e0cd34c8e16ed381a641 100644
--- a/src/core/SkPicture.cpp
+++ b/src/core/SkPicture.cpp
@@ -455,3 +455,15 @@ void SkPicture::callDeletionListeners() {
fDeletionListeners.unrefAll();
}
+
+// fRecord OK
+int SkPicture::approximateOpCount() const {
+ SkASSERT(fRecord.get() || fData.get());
+ if (fRecord.get()) {
+ return fRecord->count();
+ }
+ if (fData.get()) {
+ return fData->opCount();
+ }
+ return 0;
+}
« no previous file with comments | « include/core/SkPicture.h ('k') | src/core/SkPictureData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698