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

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

Issue 381133002: Remove SkPicture copy constructor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Removed unused "copy" method Created 6 years, 5 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
« no previous file with comments | « src/core/SkPictureData.h ('k') | tests/PictureTest.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 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include <new> 7 #include <new>
8 #include "SkBBoxHierarchy.h" 8 #include "SkBBoxHierarchy.h"
9 #include "SkDrawPictureCallback.h" 9 #include "SkDrawPictureCallback.h"
10 #include "SkPictureData.h" 10 #include "SkPictureData.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 fPictureRefs = SkNEW_ARRAY(const SkPicture*, fPictureCount); 184 fPictureRefs = SkNEW_ARRAY(const SkPicture*, fPictureCount);
185 for (int i = 0; i < fPictureCount; i++) { 185 for (int i = 0; i < fPictureCount; i++) {
186 if (deepCopyInfo) { 186 if (deepCopyInfo) {
187 fPictureRefs[i] = src.fPictureRefs[i]->clone(); 187 fPictureRefs[i] = src.fPictureRefs[i]->clone();
188 } else { 188 } else {
189 fPictureRefs[i] = src.fPictureRefs[i]; 189 fPictureRefs[i] = src.fPictureRefs[i];
190 fPictureRefs[i]->ref(); 190 fPictureRefs[i]->ref();
191 } 191 }
192 } 192 }
193 } 193 }
194 #else
195 SkPictureData::SkPictureData(const SkPictureData& src) : fInfo(src.fInfo) {
196 this->init();
197
198 fBitmapHeap.reset(SkSafeRef(src.fBitmapHeap.get()));
199 fPathHeap.reset(SkSafeRef(src.fPathHeap.get()));
200
201 fOpData = SkSafeRef(src.fOpData);
202
203 fBoundingHierarchy = src.fBoundingHierarchy;
204 fStateTree = src.fStateTree;
205 fContentInfo.set(src.fContentInfo);
206
207 SkSafeRef(fBoundingHierarchy);
208 SkSafeRef(fStateTree);
209
210 fBitmaps = SkSafeRef(src.fBitmaps);
211 fPaints = SkSafeRef(src.fPaints);
212
213 fPictureCount = src.fPictureCount;
214 fPictureRefs = SkNEW_ARRAY(const SkPicture*, fPictureCount);
215 for (int i = 0; i < fPictureCount; i++) {
216 fPictureRefs[i] = SkRef(src.fPictureRefs[i]);
217 }
218 }
219 #endif//SK_SUPPORT_LEGACY_PICTURE_CLONE 194 #endif//SK_SUPPORT_LEGACY_PICTURE_CLONE
220 195
221 void SkPictureData::init() { 196 void SkPictureData::init() {
222 fBitmaps = NULL; 197 fBitmaps = NULL;
223 fPaints = NULL; 198 fPaints = NULL;
224 fPictureRefs = NULL; 199 fPictureRefs = NULL;
225 fPictureCount = 0; 200 fPictureCount = 0;
226 fOpData = NULL; 201 fOpData = NULL;
227 fFactoryPlayback = NULL; 202 fFactoryPlayback = NULL;
228 fBoundingHierarchy = NULL; 203 fBoundingHierarchy = NULL;
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 for (index = 0; index < fPictureCount; index++) 1219 for (index = 0; index < fPictureCount; index++)
1245 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer ), 1220 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer ),
1246 "picture%p, ", fPictureRefs[index]); 1221 "picture%p, ", fPictureRefs[index]);
1247 if (fPictureCount > 0) 1222 if (fPictureCount > 0)
1248 SkDebugf("%s0};\n", pBuffer); 1223 SkDebugf("%s0};\n", pBuffer);
1249 1224
1250 const_cast<SkPictureData*>(this)->dumpStream(); 1225 const_cast<SkPictureData*>(this)->dumpStream();
1251 } 1226 }
1252 1227
1253 #endif 1228 #endif
OLDNEW
« no previous file with comments | « src/core/SkPictureData.h ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698