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

Side by Side Diff: src/core/SkPicturePlayback.cpp

Issue 25968004: commit to xfermode objects being immutable (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: use SK_DECLARE_STATIC_MUTEX Created 7 years, 2 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
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 #include "SkPicturePlayback.h" 8 #include "SkPicturePlayback.h"
9 #include "SkPictureRecord.h" 9 #include "SkPictureRecord.h"
10 #include "SkTypeface.h" 10 #include "SkTypeface.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 SkDebugf("\n"); 145 SkDebugf("\n");
146 #endif 146 #endif
147 } 147 }
148 148
149 static bool needs_deep_copy(const SkPaint& paint) { 149 static bool needs_deep_copy(const SkPaint& paint) {
150 /* 150 /*
151 * These fields are known to be immutable, and so can be shallow-copied 151 * These fields are known to be immutable, and so can be shallow-copied
152 * 152 *
153 * getTypeface(); 153 * getTypeface();
154 * getAnnotation(); 154 * getAnnotation();
155 * getXfermode();
155 */ 156 */
156 157
157 return paint.getPathEffect() || 158 return paint.getPathEffect() ||
158 paint.getShader() || 159 paint.getShader() ||
159 paint.getXfermode() ||
160 paint.getMaskFilter() || 160 paint.getMaskFilter() ||
161 paint.getColorFilter() || 161 paint.getColorFilter() ||
162 paint.getRasterizer() || 162 paint.getRasterizer() ||
163 paint.getLooper() || 163 paint.getLooper() ||
164 paint.getImageFilter(); 164 paint.getImageFilter();
165 } 165 }
166 166
167 SkPicturePlayback::SkPicturePlayback(const SkPicturePlayback& src, SkPictCopyInf o* deepCopyInfo) { 167 SkPicturePlayback::SkPicturePlayback(const SkPicturePlayback& src, SkPictCopyInf o* deepCopyInfo) {
168 this->init(); 168 this->init();
169 169
(...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after
1657 for (index = 0; index < fRegionCount; index++) 1657 for (index = 0; index < fRegionCount; index++)
1658 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer ), 1658 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer ),
1659 "region%p, ", &fRegions[index]); 1659 "region%p, ", &fRegions[index]);
1660 if (fRegionCount > 0) 1660 if (fRegionCount > 0)
1661 SkDebugf("%s0};\n", pBuffer); 1661 SkDebugf("%s0};\n", pBuffer);
1662 1662
1663 const_cast<SkPicturePlayback*>(this)->dumpStream(); 1663 const_cast<SkPicturePlayback*>(this)->dumpStream();
1664 } 1664 }
1665 1665
1666 #endif 1666 #endif
OLDNEW
« bench/XfermodeBench.cpp ('K') | « src/core/SkGraphics.cpp ('k') | src/core/SkXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698