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

Unified Diff: src/image/SkSurface.cpp

Issue 14063015: Adding optimization to avoid image copy in SkSurface copy on write when content is discardable (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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/core/SkCanvas.cpp ('k') | src/image/SkSurface_Base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkSurface.cpp
===================================================================
--- src/image/SkSurface.cpp (revision 8708)
+++ src/image/SkSurface.cpp (working copy)
@@ -59,7 +59,7 @@
return fCachedImage;
}
-void SkSurface_Base::aboutToDraw() {
+void SkSurface_Base::aboutToDraw(ContentChangeMode mode) {
this->dirtyGenerationID();
if (NULL != fCachedCanvas) {
@@ -73,7 +73,7 @@
// the cached image. Note: we only call if there is an outstanding owner
// on the image (besides us).
if (fCachedImage->getRefCnt() > 1) {
- this->onCopyOnWrite();
+ this->onCopyOnWrite(mode);
}
// regardless of copy-on-write, we must drop our cached image now, so
@@ -109,8 +109,8 @@
return fGenerationID;
}
-void SkSurface::notifyContentChanged() {
- asSB(this)->aboutToDraw();
+void SkSurface::notifyContentWillChange(ContentChangeMode mode) {
+ asSB(this)->aboutToDraw(mode);
}
SkCanvas* SkSurface::getCanvas() {
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/image/SkSurface_Base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698