| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 | 7 |
| 8 #ifndef SkPictureRecorder_DEFINED | 8 #ifndef SkPictureRecorder_DEFINED |
| 9 #define SkPictureRecorder_DEFINED | 9 #define SkPictureRecorder_DEFINED |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 #ifdef SK_LEGACY_PICTURE_SIZE_API | 31 #ifdef SK_LEGACY_PICTURE_SIZE_API |
| 32 SkCanvas* beginRecording(int width, int height, | 32 SkCanvas* beginRecording(int width, int height, |
| 33 SkBBHFactory* bbhFactory = NULL, | 33 SkBBHFactory* bbhFactory = NULL, |
| 34 uint32_t recordFlags = 0) { | 34 uint32_t recordFlags = 0) { |
| 35 return this->beginRecording(SkIntToScalar(width), SkIntToScalar(height), | 35 return this->beginRecording(SkIntToScalar(width), SkIntToScalar(height), |
| 36 bbhFactory, recordFlags); | 36 bbhFactory, recordFlags); |
| 37 } | 37 } |
| 38 #endif | 38 #endif |
| 39 | 39 |
| 40 enum RecordFlags { |
| 41 // This flag indicates that, if some BHH is being computed, saveLayer |
| 42 // information should also be extracted at the same time. |
| 43 kComputeSaveLayerInfo_RecordFlag = 0x01 |
| 44 }; |
| 45 |
| 40 /** Returns the canvas that records the drawing commands. | 46 /** Returns the canvas that records the drawing commands. |
| 41 @param width the width of the cull rect used when recording this picture
. | 47 @param width the width of the cull rect used when recording this picture
. |
| 42 @param height the height of the cull rect used when recording this pictu
re. | 48 @param height the height of the cull rect used when recording this pictu
re. |
| 43 @param bbhFactory factory to create desired acceleration structure | 49 @param bbhFactory factory to create desired acceleration structure |
| 44 @param recordFlags optional flags that control recording. | 50 @param recordFlags optional flags that control recording. |
| 45 @return the canvas. | 51 @return the canvas. |
| 46 */ | 52 */ |
| 47 SkCanvas* beginRecording(SkScalar width, SkScalar height, | 53 SkCanvas* beginRecording(SkScalar width, SkScalar height, |
| 48 SkBBHFactory* bbhFactory = NULL, | 54 SkBBHFactory* bbhFactory = NULL, |
| 49 uint32_t recordFlags = 0); | 55 uint32_t recordFlags = 0); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 65 | 71 |
| 66 /** Replay the current (partially recorded) operation stream into | 72 /** Replay the current (partially recorded) operation stream into |
| 67 canvas. This call doesn't close the current recording. | 73 canvas. This call doesn't close the current recording. |
| 68 */ | 74 */ |
| 69 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK | 75 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK |
| 70 friend class android::Picture; | 76 friend class android::Picture; |
| 71 #endif | 77 #endif |
| 72 friend class SkPictureRecorderReplayTester; // for unit testing | 78 friend class SkPictureRecorderReplayTester; // for unit testing |
| 73 void partialReplay(SkCanvas* canvas) const; | 79 void partialReplay(SkCanvas* canvas) const; |
| 74 | 80 |
| 81 uint32_t fFlags; |
| 75 SkScalar fCullWidth; | 82 SkScalar fCullWidth; |
| 76 SkScalar fCullHeight; | 83 SkScalar fCullHeight; |
| 77 SkAutoTUnref<SkBBoxHierarchy> fBBH; | 84 SkAutoTUnref<SkBBoxHierarchy> fBBH; |
| 78 SkAutoTUnref<SkRecorder> fRecorder; | 85 SkAutoTUnref<SkRecorder> fRecorder; |
| 79 SkAutoTDelete<SkRecord> fRecord; | 86 SkAutoTDelete<SkRecord> fRecord; |
| 80 | 87 |
| 81 typedef SkNoncopyable INHERITED; | 88 typedef SkNoncopyable INHERITED; |
| 82 }; | 89 }; |
| 83 | 90 |
| 84 #endif | 91 #endif |
| OLD | NEW |