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 23 matching lines...) Expand all Loading... |
34 @param height the base width for the picture, as if the recording | 34 @param height the base width for the picture, as if the recording |
35 canvas' bitmap had this height. | 35 canvas' bitmap had this height. |
36 @param bbhFactory factory to create desired acceleration structure | 36 @param bbhFactory factory to create desired acceleration structure |
37 @param recordFlags optional flags that control recording. | 37 @param recordFlags optional flags that control recording. |
38 @return the canvas. | 38 @return the canvas. |
39 */ | 39 */ |
40 SkCanvas* beginRecording(int width, int height, | 40 SkCanvas* beginRecording(int width, int height, |
41 SkBBHFactory* bbhFactory = NULL, | 41 SkBBHFactory* bbhFactory = NULL, |
42 uint32_t recordFlags = 0); | 42 uint32_t recordFlags = 0); |
43 | 43 |
44 /** Same as beginRecording(), using a new faster backend. */ | 44 // As usual, we have a deprecated old version and a maybe almost working |
| 45 // new version. We currently point beginRecording() to |
| 46 // DEPRECATED_beginRecording() unless SK_PICTURE_USE_SK_RECORD is defined, |
| 47 // then we use EXPERIMENTAL_beginRecording(). |
| 48 |
| 49 // Old slower backend. |
| 50 SkCanvas* DEPRECATED_beginRecording(int width, int height, |
| 51 SkBBHFactory* bbhFactory = NULL, |
| 52 uint32_t recordFlags = 0); |
| 53 |
| 54 // New faster backend. |
45 SkCanvas* EXPERIMENTAL_beginRecording(int width, int height, | 55 SkCanvas* EXPERIMENTAL_beginRecording(int width, int height, |
46 SkBBHFactory* bbhFactory = NULL); | 56 SkBBHFactory* bbhFactory = NULL); |
47 | 57 |
48 /** Returns the recording canvas if one is active, or NULL if recording is | 58 /** Returns the recording canvas if one is active, or NULL if recording is |
49 not active. This does not alter the refcnt on the canvas (if present). | 59 not active. This does not alter the refcnt on the canvas (if present). |
50 */ | 60 */ |
51 SkCanvas* getRecordingCanvas(); | 61 SkCanvas* getRecordingCanvas(); |
52 | 62 |
53 /** Signal that the caller is done recording. This invalidates the canvas | 63 /** Signal that the caller is done recording. This invalidates the canvas |
54 returned by beginRecording/getRecordingCanvas, and returns the | 64 returned by beginRecording/getRecordingCanvas, and returns the |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 SkAutoTUnref<SkPictureRecord> fPictureRecord; // beginRecording() | 96 SkAutoTUnref<SkPictureRecord> fPictureRecord; // beginRecording() |
87 SkAutoTUnref<SkRecorder> fRecorder; // EXPERIMENTAL_beginRecordin
g() | 97 SkAutoTUnref<SkRecorder> fRecorder; // EXPERIMENTAL_beginRecordin
g() |
88 | 98 |
89 // Used by EXPERIMENTAL_beginRecording(). | 99 // Used by EXPERIMENTAL_beginRecording(). |
90 SkAutoTDelete<SkRecord> fRecord; | 100 SkAutoTDelete<SkRecord> fRecord; |
91 | 101 |
92 typedef SkNoncopyable INHERITED; | 102 typedef SkNoncopyable INHERITED; |
93 }; | 103 }; |
94 | 104 |
95 #endif | 105 #endif |
OLD | NEW |