OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2007 The Android Open Source Project | 3 * Copyright 2007 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 "SkPictureFlat.h" | 10 #include "SkPictureFlat.h" |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 | 272 |
273 SkPictInfo info; | 273 SkPictInfo info; |
274 this->createHeader(&info); | 274 this->createHeader(&info); |
275 fData.reset(SkNEW_ARGS(SkPictureData, (record, info, deepCopyOps))); | 275 fData.reset(SkNEW_ARGS(SkPictureData, (record, info, deepCopyOps))); |
276 } | 276 } |
277 | 277 |
278 // Create an SkPictureData-backed SkPicture from an SkRecord. | 278 // Create an SkPictureData-backed SkPicture from an SkRecord. |
279 // This for compatibility with serialization code only. This is not cheap. | 279 // This for compatibility with serialization code only. This is not cheap. |
280 static SkPicture* backport(const SkRecord& src, int width, int height) { | 280 static SkPicture* backport(const SkRecord& src, int width, int height) { |
281 SkPictureRecorder recorder; | 281 SkPictureRecorder recorder; |
282 SkRecordDraw(src, recorder.beginRecording(width, height), NULL/*bbh*/, NULL/
*callback*/); | 282 SkRecordDraw(src, |
| 283 recorder.DEPRECATED_beginRecording(width, height), NULL/*bbh*/,
NULL/*callback*/); |
283 return recorder.endRecording(); | 284 return recorder.endRecording(); |
284 } | 285 } |
285 | 286 |
286 // fRecord OK | 287 // fRecord OK |
287 SkPicture::~SkPicture() { | 288 SkPicture::~SkPicture() { |
288 this->callDeletionListeners(); | 289 this->callDeletionListeners(); |
289 } | 290 } |
290 | 291 |
291 // fRecord OK | 292 // fRecord OK |
292 #ifdef SK_SUPPORT_LEGACY_PICTURE_CLONE | 293 #ifdef SK_SUPPORT_LEGACY_PICTURE_CLONE |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 int SkPicture::approximateOpCount() const { | 648 int SkPicture::approximateOpCount() const { |
648 SkASSERT(fRecord.get() || fData.get()); | 649 SkASSERT(fRecord.get() || fData.get()); |
649 if (fRecord.get()) { | 650 if (fRecord.get()) { |
650 return fRecord->count(); | 651 return fRecord->count(); |
651 } | 652 } |
652 if (fData.get()) { | 653 if (fData.get()) { |
653 return fData->opCount(); | 654 return fData->opCount(); |
654 } | 655 } |
655 return 0; | 656 return 0; |
656 } | 657 } |
OLD | NEW |