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

Unified Diff: src/core/SkPicturePlayback.h

Issue 195793010: Add a means of extracting active operations from SkPicture (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Fix bug & add unit test Created 6 years, 9 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 | « src/core/SkPicture.cpp ('k') | src/core/SkPicturePlayback.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPicturePlayback.h
===================================================================
--- src/core/SkPicturePlayback.h (revision 13850)
+++ src/core/SkPicturePlayback.h (working copy)
@@ -85,6 +85,8 @@
virtual ~SkPicturePlayback();
+ const SkPicture::OperationList& getActiveOps(const SkIRect& queryRect);
+
void draw(SkCanvas& canvas, SkDrawPictureCallback*);
void serialize(SkWStream*, SkPicture::EncodeBitmap) const;
@@ -109,7 +111,7 @@
virtual void postDraw(int opIndex);
#endif
- void preLoadBitmaps(const SkTDArray<void*>& results);
+ void preLoadBitmaps(const SkTDArray<void*>* results);
private:
class TextContainer {
@@ -237,6 +239,29 @@
SkBBoxHierarchy* fBoundingHierarchy;
SkPictureStateTree* fStateTree;
+ class CachedOperationList : public SkPicture::OperationList {
+ public:
+ CachedOperationList() {
+ fCacheQueryRect.setEmpty();
+ }
+
+ virtual bool valid() const { return true; }
+ virtual int numOps() const SK_OVERRIDE { return fOps.count(); }
+ virtual uint32_t offset(int index) const SK_OVERRIDE;
+ virtual const SkMatrix& matrix(int index) const SK_OVERRIDE;
+
+ // The query rect for which the cached active ops are valid
+ SkIRect fCacheQueryRect;
+
+ // The operations which are active within 'fCachedQueryRect'
+ SkTDArray<void*> fOps;
+
+ private:
+ typedef SkPicture::OperationList INHERITED;
+ };
+
+ CachedOperationList* fCachedActiveOps;
+
SkTypefacePlayback fTFPlayback;
SkFactoryPlayback* fFactoryPlayback;
#ifdef SK_BUILD_FOR_ANDROID
« no previous file with comments | « src/core/SkPicture.cpp ('k') | src/core/SkPicturePlayback.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698