OLD | NEW |
---|---|
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 "SkPicturePlayback.h" | 10 #include "SkPicturePlayback.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
161 if (paths != 0) | 161 if (paths != 0) |
162 SkDebugf("paths size %zd (paths:%d) ", pathBytes, paths); | 162 SkDebugf("paths size %zd (paths:%d) ", pathBytes, paths); |
163 if (pictures != 0) | 163 if (pictures != 0) |
164 SkDebugf("pictures size %zd (pictures:%d) ", pictureBytes, pictures); | 164 SkDebugf("pictures size %zd (pictures:%d) ", pictureBytes, pictures); |
165 if (regions != 0) | 165 if (regions != 0) |
166 SkDebugf("regions size %zd (regions:%d) ", regionBytes, regions); | 166 SkDebugf("regions size %zd (regions:%d) ", regionBytes, regions); |
167 SkDebugf("\n"); | 167 SkDebugf("\n"); |
168 #endif | 168 #endif |
169 } | 169 } |
170 | 170 |
171 #ifdef SK_SUPPORT_LEGACY_PICTURE_CLONE | |
171 SkPicturePlayback::SkPicturePlayback(const SkPicturePlayback& src, SkPictCopyInf o* deepCopyInfo) | 172 SkPicturePlayback::SkPicturePlayback(const SkPicturePlayback& src, SkPictCopyInf o* deepCopyInfo) |
172 : fInfo(src.fInfo) { | 173 : fInfo(src.fInfo) { |
173 this->init(); | 174 this->init(); |
174 | 175 |
175 fBitmapHeap.reset(SkSafeRef(src.fBitmapHeap.get())); | 176 fBitmapHeap.reset(SkSafeRef(src.fBitmapHeap.get())); |
176 fPathHeap.reset(SkSafeRef(src.fPathHeap.get())); | 177 fPathHeap.reset(SkSafeRef(src.fPathHeap.get())); |
177 | 178 |
178 fOpData = SkSafeRef(src.fOpData); | 179 fOpData = SkSafeRef(src.fOpData); |
179 | 180 |
180 fBoundingHierarchy = src.fBoundingHierarchy; | 181 fBoundingHierarchy = src.fBoundingHierarchy; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
216 fPictureRefs = SkNEW_ARRAY(const SkPicture*, fPictureCount); | 217 fPictureRefs = SkNEW_ARRAY(const SkPicture*, fPictureCount); |
217 for (int i = 0; i < fPictureCount; i++) { | 218 for (int i = 0; i < fPictureCount; i++) { |
218 if (deepCopyInfo) { | 219 if (deepCopyInfo) { |
219 fPictureRefs[i] = src.fPictureRefs[i]->clone(); | 220 fPictureRefs[i] = src.fPictureRefs[i]->clone(); |
220 } else { | 221 } else { |
221 fPictureRefs[i] = src.fPictureRefs[i]; | 222 fPictureRefs[i] = src.fPictureRefs[i]; |
222 fPictureRefs[i]->ref(); | 223 fPictureRefs[i]->ref(); |
223 } | 224 } |
224 } | 225 } |
225 } | 226 } |
227 #else | |
robertphillips
2014/06/27 18:03:50
Do we even need this?
mtklein
2014/06/27 18:32:04
Yeah, tried but failed to remove it. We copy SkPi
| |
228 SkPicturePlayback::SkPicturePlayback(const SkPicturePlayback& src) : fInfo(src.f Info) { | |
229 this->init(); | |
230 | |
231 fBitmapHeap.reset(SkSafeRef(src.fBitmapHeap.get())); | |
232 fPathHeap.reset(SkSafeRef(src.fPathHeap.get())); | |
233 | |
234 fOpData = SkSafeRef(src.fOpData); | |
235 | |
236 fBoundingHierarchy = src.fBoundingHierarchy; | |
237 fStateTree = src.fStateTree; | |
238 fContentInfo.set(src.fContentInfo); | |
239 | |
240 SkSafeRef(fBoundingHierarchy); | |
241 SkSafeRef(fStateTree); | |
242 | |
243 fBitmaps = SkSafeRef(src.fBitmaps); | |
244 fPaints = SkSafeRef(src.fPaints); | |
245 | |
246 fPictureCount = src.fPictureCount; | |
247 fPictureRefs = SkNEW_ARRAY(const SkPicture*, fPictureCount); | |
248 for (int i = 0; i < fPictureCount; i++) { | |
249 fPictureRefs[i] = SkRef(src.fPictureRefs[i]); | |
250 } | |
251 } | |
252 #endif//SK_SUPPORT_LEGACY_PICTURE_CLONE | |
226 | 253 |
227 void SkPicturePlayback::init() { | 254 void SkPicturePlayback::init() { |
228 fBitmaps = NULL; | 255 fBitmaps = NULL; |
229 fPaints = NULL; | 256 fPaints = NULL; |
230 fPictureRefs = NULL; | 257 fPictureRefs = NULL; |
231 fPictureCount = 0; | 258 fPictureCount = 0; |
232 fOpData = NULL; | 259 fOpData = NULL; |
233 fFactoryPlayback = NULL; | 260 fFactoryPlayback = NULL; |
234 fBoundingHierarchy = NULL; | 261 fBoundingHierarchy = NULL; |
235 fStateTree = NULL; | 262 fStateTree = NULL; |
(...skipping 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1890 for (index = 0; index < fPictureCount; index++) | 1917 for (index = 0; index < fPictureCount; index++) |
1891 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer ), | 1918 bufferPtr += snprintf(bufferPtr, DUMP_BUFFER_SIZE - (bufferPtr - pBuffer ), |
1892 "picture%p, ", fPictureRefs[index]); | 1919 "picture%p, ", fPictureRefs[index]); |
1893 if (fPictureCount > 0) | 1920 if (fPictureCount > 0) |
1894 SkDebugf("%s0};\n", pBuffer); | 1921 SkDebugf("%s0};\n", pBuffer); |
1895 | 1922 |
1896 const_cast<SkPicturePlayback*>(this)->dumpStream(); | 1923 const_cast<SkPicturePlayback*>(this)->dumpStream(); |
1897 } | 1924 } |
1898 | 1925 |
1899 #endif | 1926 #endif |
OLD | NEW |