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

Unified Diff: src/image/SkSurface_Base.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 | « src/image/SkSurface.cpp ('k') | src/image/SkSurface_Gpu.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkSurface_Base.h
diff --git a/src/image/SkSurface_Base.h b/src/image/SkSurface_Base.h
index 30af9761d362c4de4216981df6298cf48405bc9c..2e4f869342f162dfc5f2dfe7918f3149400ba802 100644
--- a/src/image/SkSurface_Base.h
+++ b/src/image/SkSurface_Base.h
@@ -47,52 +47,24 @@ public:
*/
virtual void onDraw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*);
- /**
- * Called as a performance hint when the Surface is allowed to make it's contents
- * undefined.
- */
- virtual void onDiscard() {}
-
- /**
- * If the surface is about to change, we call this so that our subclass
- * can optionally fork their backend (copy-on-write) in case it was
- * being shared with the cachedImage.
- */
- virtual void onCopyOnWrite(ContentChangeMode) = 0;
-
inline SkCanvas* getCachedCanvas();
- inline SkImage* getCachedImage(Budgeted);
- // called by SkSurface to compute a new genID
+protected:
+ // Must be called by the subclasses to compute a new genID.
uint32_t newGenerationID();
private:
SkCanvas* fCachedCanvas;
- SkImage* fCachedImage;
- void aboutToDraw(ContentChangeMode mode);
- friend class SkCanvas;
friend class SkSurface;
-
typedef SkSurface INHERITED;
};
SkCanvas* SkSurface_Base::getCachedCanvas() {
if (NULL == fCachedCanvas) {
fCachedCanvas = this->onNewCanvas();
- if (fCachedCanvas) {
- fCachedCanvas->setSurfaceBase(this);
- }
}
return fCachedCanvas;
}
-SkImage* SkSurface_Base::getCachedImage(Budgeted budgeted) {
- if (NULL == fCachedImage) {
- fCachedImage = this->onNewImageSnapshot(budgeted);
- SkASSERT(!fCachedCanvas || fCachedCanvas->getSurfaceBase() == this);
- }
- return fCachedImage;
-}
-
#endif
« no previous file with comments | « src/image/SkSurface.cpp ('k') | src/image/SkSurface_Gpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698