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

Unified Diff: include/core/SkSurface.h

Issue 933043006: Implement SkBaseDevice snapshot support Base URL: https://skia.googlesource.com/skia.git@skimage-filters-04-snapshot-devices
Patch Set: Created 5 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 | « include/core/SkDevice.h ('k') | src/core/SkBitmapDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkSurface.h
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h
index a87eccefdc9ee88796212ffa36072205538fe1e9..063475cec9c4f2e7cb6d410cb53ed338cd222095 100644
--- a/include/core/SkSurface.h
+++ b/include/core/SkSurface.h
@@ -109,37 +109,18 @@ public:
int height() const { return fHeight; }
/**
- * Returns a unique non-zero, unique value identifying the content of this
- * surface. Each time the content is changed changed, either by drawing
- * into this surface, or explicitly calling notifyContentChanged()) this
- * method will return a new value.
+ * Returns a unique non-zero value identifying the content of this
+ * surface. Each time the content is changed changed by drawing
+ * into this surface through the canvas, this method will return a new
+ * value.
*
- * If this surface is empty (i.e. has a zero-dimention), this will return
+ * Implementations guarantee that all generationIDs are unique among
+ * all possible SkSurfaces and their possible contents.
+ *
+ * If this surface is empty (i.e. has a zero-dimension), this will return
* 0.
*/
- uint32_t generationID();
-
- /**
- * Modes that can be passed to notifyContentWillChange
- */
- enum ContentChangeMode {
- /**
- * Use this mode if it is known that the upcoming content changes will
- * clear or overwrite prior contents, thus making them discardable.
- */
- kDiscard_ContentChangeMode,
- /**
- * Use this mode if prior surface contents need to be preserved or
- * if in doubt.
- */
- kRetain_ContentChangeMode,
- };
-
- /**
- * Call this if the contents are about to change. This will (lazily) force a new
- * value to be returned from generationID() when it is called next.
- */
- void notifyContentWillChange(ContentChangeMode mode);
+ virtual uint32_t generationID() = 0;
/**
* Return a canvas that will draw into this surface. This will always
@@ -221,16 +202,10 @@ protected:
SkSurface(int width, int height, const SkSurfaceProps*);
SkSurface(const SkImageInfo&, const SkSurfaceProps*);
- // called by subclass if their contents have changed
- void dirtyGenerationID() {
- fGenerationID = 0;
- }
-
private:
const SkSurfaceProps fProps;
const int fWidth;
const int fHeight;
- uint32_t fGenerationID;
typedef SkRefCnt INHERITED;
};
« no previous file with comments | « include/core/SkDevice.h ('k') | src/core/SkBitmapDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698