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

Unified Diff: include/core/SkPicture.h

Issue 222683002: Add generation ID to SkPicture (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Fix Ubuntu compiler complaint 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 14036)
+++ include/core/SkPicture.h (working copy)
@@ -59,10 +59,6 @@
typedef SkRefCnt INHERITED;
};
- /** The constructor prepares the picture to record.
- @param width the width of the virtual device the picture records.
- @param height the height of the virtual device the picture records.
- */
SkPicture();
/** Make a copy of the contents of src. If src records more drawing after
this call, those elements will not appear in this picture.
@@ -205,6 +201,15 @@
*/
int height() const { return fHeight; }
+ static const uint32_t kInvalidGenID = 0;
reed1 2014/04/07 13:16:59 Seems like this should be in some larger/global he
+
+ /** Return a non-zero, unique value representing the picture. This call is
+ only valid when not recording. Between a beginRecording/endRecording
+ pair it will just return 0 (the invalid gen ID). Each beginRecording/
+ endRecording pair will cause a different generation ID to be returned.
+ */
+ uint32_t getGenerationID() const;
reed1 2014/04/07 13:16:59 Why not call it uniqueID() as we do in typeface?
+
/**
* Function to encode an SkBitmap to an SkData. A function with this
* signature can be passed to serialize() and SkWriteBuffer.
@@ -287,7 +292,7 @@
// V13: add flag to drawBitmapRectToRect
// parameterize blurs by sigma rather than radius
// V14: Add flags word to PathRef serialization
- // V15: Remove A1 bitmpa config (and renumber remaining configs)
+ // V15: Remove A1 bitmap config (and renumber remaining configs)
// V16: Move SkPath's isOval flag to SkPathRef
// V17: SkPixelRef now writes SkImageInfo
// V18: SkBitmap now records x,y for its pixelref origin, instead of offset.
@@ -303,6 +308,8 @@
static const uint32_t MIN_PICTURE_VERSION = 19;
static const uint32_t CURRENT_PICTURE_VERSION = 22;
+ mutable uint32_t fGenerationID;
+
// fPlayback, fRecord, fWidth & fHeight are protected to allow derived classes to
// install their own SkPicturePlayback-derived players,SkPictureRecord-derived
// recorders and set the picture size
@@ -311,6 +318,8 @@
int fWidth, fHeight;
const AccelData* fAccelData;
+ void needsNewGenID() { fGenerationID = kInvalidGenID; }
+
// Create a new SkPicture from an existing SkPicturePlayback. Ref count of
// playback is unchanged.
SkPicture(SkPicturePlayback*, int width, int height);
« 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