| 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" |
| 11 #include "SkPicturePlayback.h" | 11 #include "SkPicturePlayback.h" |
| 12 #include "SkPictureRecord.h" | 12 #include "SkPictureRecord.h" |
| 13 | 13 |
| 14 #include "SkBitmapDevice.h" |
| 14 #include "SkCanvas.h" | 15 #include "SkCanvas.h" |
| 15 #include "SkChunkAlloc.h" | 16 #include "SkChunkAlloc.h" |
| 16 #include "SkDevice.h" | |
| 17 #include "SkPicture.h" | 17 #include "SkPicture.h" |
| 18 #include "SkRegion.h" | 18 #include "SkRegion.h" |
| 19 #include "SkStream.h" | 19 #include "SkStream.h" |
| 20 #include "SkTDArray.h" | 20 #include "SkTDArray.h" |
| 21 #include "SkTSearch.h" | 21 #include "SkTSearch.h" |
| 22 #include "SkTime.h" | 22 #include "SkTime.h" |
| 23 | 23 |
| 24 #include "SkReader32.h" | 24 #include "SkReader32.h" |
| 25 #include "SkWriter32.h" | 25 #include "SkWriter32.h" |
| 26 #include "SkRTree.h" | 26 #include "SkRTree.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 fPlayback = NULL; | 198 fPlayback = NULL; |
| 199 } | 199 } |
| 200 | 200 |
| 201 if (NULL != fRecord) { | 201 if (NULL != fRecord) { |
| 202 fRecord->unref(); | 202 fRecord->unref(); |
| 203 fRecord = NULL; | 203 fRecord = NULL; |
| 204 } | 204 } |
| 205 | 205 |
| 206 SkBitmap bm; | 206 SkBitmap bm; |
| 207 bm.setConfig(SkBitmap::kNo_Config, width, height); | 207 bm.setConfig(SkBitmap::kNo_Config, width, height); |
| 208 SkAutoTUnref<SkDevice> dev(SkNEW_ARGS(SkDevice, (bm))); | 208 SkAutoTUnref<SkBaseDevice> dev(SkNEW_ARGS(SkBitmapDevice, (bm))); |
| 209 | 209 |
| 210 // Must be set before calling createBBoxHierarchy | 210 // Must be set before calling createBBoxHierarchy |
| 211 fWidth = width; | 211 fWidth = width; |
| 212 fHeight = height; | 212 fHeight = height; |
| 213 | 213 |
| 214 if (recordingFlags & kOptimizeForClippedPlayback_RecordingFlag) { | 214 if (recordingFlags & kOptimizeForClippedPlayback_RecordingFlag) { |
| 215 SkBBoxHierarchy* tree = this->createBBoxHierarchy(); | 215 SkBBoxHierarchy* tree = this->createBBoxHierarchy(); |
| 216 SkASSERT(NULL != tree); | 216 SkASSERT(NULL != tree); |
| 217 fRecord = SkNEW_ARGS(SkBBoxHierarchyRecord, (recordingFlags, tree, dev))
; | 217 fRecord = SkNEW_ARGS(SkBBoxHierarchyRecord, (recordingFlags, tree, dev))
; |
| 218 tree->unref(); | 218 tree->unref(); |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 } | 346 } |
| 347 | 347 |
| 348 #ifdef SK_BUILD_FOR_ANDROID | 348 #ifdef SK_BUILD_FOR_ANDROID |
| 349 void SkPicture::abortPlayback() { | 349 void SkPicture::abortPlayback() { |
| 350 if (NULL == fPlayback) { | 350 if (NULL == fPlayback) { |
| 351 return; | 351 return; |
| 352 } | 352 } |
| 353 fPlayback->abort(); | 353 fPlayback->abort(); |
| 354 } | 354 } |
| 355 #endif | 355 #endif |
| OLD | NEW |