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 |