[go: nahoru, domu]

Expose SkPicture::willPlayBackBitmaps()

This returns true if (1) the picture has finished recording and
(2) this picture or any picture drawn into it refers to any bitmaps. 
It allows clients doing complicated manipulations of the picture to 
early-out when there are no bitmaps present. 

BUG=303281
R=reed@google.com



git-svn-id: http://skia.googlecode.com/svn/trunk/src@11935 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/core/SkPicture.cpp b/core/SkPicture.cpp
index 1df56a5..4acc549 100644
--- a/core/SkPicture.cpp
+++ b/core/SkPicture.cpp
@@ -354,6 +354,11 @@
     }
 }
 
+bool SkPicture::willPlayBackBitmaps() const {
+    if (!fPlayback) return false;
+    return fPlayback->containsBitmaps();
+}
+
 #ifdef SK_BUILD_FOR_ANDROID
 void SkPicture::abortPlayback() {
     if (NULL == fPlayback) {