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

Unified Diff: include/core/SkPicture.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 | « no previous file | src/core/SkPicture.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPicture.h
===================================================================
--- include/core/SkPicture.h (revision 13850)
+++ include/core/SkPicture.h (working copy)
@@ -308,11 +308,41 @@
// SkBBoxHierarchy implementation
virtual SkBBoxHierarchy* createBBoxHierarchy() const;
private:
+ // An OperationList encapsulates a set of operation offsets into the picture byte
+ // stream along with the CTMs needed for those operation.
+ class OperationList : public SkNoncopyable {
+ public:
+ virtual ~OperationList() {}
+
+ // If valid returns false then there is no optimization data
+ // present. All the draw operations need to be issued.
+ virtual bool valid() const { return false; }
+
+ // The following three entry points should only be accessed if
+ // 'valid' returns true.
+ virtual int numOps() const { SkASSERT(false); return 0; };
+ // The offset in the picture of the operation to execute.
+ virtual uint32_t offset(int index) const { SkASSERT(false); return 0; };
+ // The CTM that must be installed for the operation to behave correctly
+ virtual const SkMatrix& matrix(int index) const { SkASSERT(false); return SkMatrix::I(); }
+
+ static const OperationList& InvalidList();
+
+ private:
+ typedef SkNoncopyable INHERITED;
+ };
+
+ /** PRIVATE / EXPERIMENTAL -- do not call
+ Return the operations required to render the content inside 'queryRect'.
+ */
+ const OperationList& EXPERIMENTAL_getActiveOps(const SkIRect& queryRect);
+
void createHeader(SkPictInfo* info) const;
static bool IsValidPictInfo(const SkPictInfo& info);
friend class SkFlatPicture;
friend class SkPicturePlayback;
+ friend class SkGpuDevice;
typedef SkRefCnt INHERITED;
};
« no previous file with comments | « no previous file | src/core/SkPicture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698