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

Side by Side Diff: src/core/SkCanvas.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/core/SkSurface.h ('k') | src/image/SkSurface.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2008 The Android Open Source Project 3 * Copyright 2008 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 #else 116 #else
117 #define CHECK_LOCKCOUNT_BALANCE(bitmap) 117 #define CHECK_LOCKCOUNT_BALANCE(bitmap)
118 #define CHECK_SHADER_NOSETCONTEXT(paint) 118 #define CHECK_SHADER_NOSETCONTEXT(paint)
119 #endif 119 #endif
120 120
121 typedef SkTLazy<SkPaint> SkLazyPaint; 121 typedef SkTLazy<SkPaint> SkLazyPaint;
122 122
123 void SkCanvas::predrawNotify() { 123 void SkCanvas::predrawNotify() {
124 if (fSurfaceBase) { 124 if (fSurfaceBase) {
125 fSurfaceBase->aboutToDraw(); 125 fSurfaceBase->aboutToDraw(SkSurface::kRetain_ContentChangeMode);
126 } 126 }
127 } 127 }
128 128
129 /////////////////////////////////////////////////////////////////////////////// 129 ///////////////////////////////////////////////////////////////////////////////
130 130
131 /* This is the record we keep for each SkDevice that the user installs. 131 /* This is the record we keep for each SkDevice that the user installs.
132 The clip/matrix/proc are fields that reflect the top of the save/restore 132 The clip/matrix/proc are fields that reflect the top of the save/restore
133 stack. Whenever the canvas changes, it marks a dirty flag, and then before 133 stack. Whenever the canvas changes, it marks a dirty flag, and then before
134 these are used (assuming we're not on a layer) we rebuild these cache 134 these are used (assuming we're not on a layer) we rebuild these cache
135 values: they reflect the top of the save stack, but translated and clipped 135 values: they reflect the top of the save stack, but translated and clipped
(...skipping 1992 matching lines...) Expand 10 before | Expand all | Expand 10 after
2128 return *paint; 2128 return *paint;
2129 } 2129 }
2130 2130
2131 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); } 2131 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); }
2132 int SkCanvas::LayerIter::x() const { return fImpl->getX(); } 2132 int SkCanvas::LayerIter::x() const { return fImpl->getX(); }
2133 int SkCanvas::LayerIter::y() const { return fImpl->getY(); } 2133 int SkCanvas::LayerIter::y() const { return fImpl->getY(); }
2134 2134
2135 /////////////////////////////////////////////////////////////////////////////// 2135 ///////////////////////////////////////////////////////////////////////////////
2136 2136
2137 SkCanvas::ClipVisitor::~ClipVisitor() { } 2137 SkCanvas::ClipVisitor::~ClipVisitor() { }
OLDNEW
« no previous file with comments | « include/core/SkSurface.h ('k') | src/image/SkSurface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698