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

Unified Diff: src/image/SkSurface_Base.h

Issue 926843003: Move canvas->surface association to the device subclasses (Closed) Base URL: https://skia.googlesource.com/skia.git@skimage-filters-03-sksurface-set-root-device-simple
Patch Set: Created 5 years, 10 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.cpp » ('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..7e48bbf4c82c67cd9954b398245930f81e60ab10 100644
--- a/src/image/SkSurface_Base.h
+++ b/src/image/SkSurface_Base.h
@@ -66,23 +66,19 @@ public:
// called by SkSurface to compute a new genID
uint32_t newGenerationID();
+ void aboutToDraw(ContentChangeMode mode);
+
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;
}
@@ -90,7 +86,6 @@ SkCanvas* SkSurface_Base::getCachedCanvas() {
SkImage* SkSurface_Base::getCachedImage(Budgeted budgeted) {
if (NULL == fCachedImage) {
fCachedImage = this->onNewImageSnapshot(budgeted);
- SkASSERT(!fCachedCanvas || fCachedCanvas->getSurfaceBase() == this);
}
return fCachedImage;
}
« no previous file with comments | « src/image/SkSurface.cpp ('k') | src/image/SkSurface_Gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698