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 11 matching lines...) Expand all Loading... |
22 | 22 |
23 /** Returns the canvas that records the drawing commands. | 23 /** Returns the canvas that records the drawing commands. |
24 @param width the base width for the picture, as if the recording | 24 @param width the base width for the picture, as if the recording |
25 canvas' bitmap had this width. | 25 canvas' bitmap had this width. |
26 @param height the base width for the picture, as if the recording | 26 @param height the base width for the picture, as if the recording |
27 canvas' bitmap had this height. | 27 canvas' bitmap had this height. |
28 @param bbhFactory factory to create desired acceleration structure | 28 @param bbhFactory factory to create desired acceleration structure |
29 @param recordFlags optional flags that control recording. | 29 @param recordFlags optional flags that control recording. |
30 @return the canvas. | 30 @return the canvas. |
31 */ | 31 */ |
32 // TODO: allow default parameters once the other beginRecoding entry point i
s gone | |
33 SkCanvas* beginRecording(int width, int height, | 32 SkCanvas* beginRecording(int width, int height, |
34 SkBBHFactory* bbhFactory /* = NULL */, | 33 SkBBHFactory* bbhFactory = NULL, |
35 uint32_t recordFlags /* = 0 */); | 34 uint32_t recordFlags = 0); |
36 | 35 |
37 /** Returns the recording canvas if one is active, or NULL if recording is | 36 /** Returns the recording canvas if one is active, or NULL if recording is |
38 not active. This does not alter the refcnt on the canvas (if present). | 37 not active. This does not alter the refcnt on the canvas (if present). |
39 */ | 38 */ |
40 SkCanvas* getRecordingCanvas(); | 39 SkCanvas* getRecordingCanvas(); |
41 | 40 |
42 /** Signal that the caller is done recording. This invalidates the canvas | 41 /** Signal that the caller is done recording. This invalidates the canvas |
43 returned by beginRecording/getRecordingCanvas, and returns the | 42 returned by beginRecording/getRecordingCanvas, and returns the |
44 created SkPicture. Note that the returned picture has its creation | 43 created SkPicture. Note that the returned picture has its creation |
45 ref which the caller must take ownership of. | 44 ref which the caller must take ownership of. |
(...skipping 16 matching lines...) Expand all Loading... |
62 friend class SkPictureRecorderReplayTester; // for unit testing | 61 friend class SkPictureRecorderReplayTester; // for unit testing |
63 void partialReplay(SkCanvas* canvas) const; | 62 void partialReplay(SkCanvas* canvas) const; |
64 | 63 |
65 SkAutoTUnref<SkPicture> fPicture; | 64 SkAutoTUnref<SkPicture> fPicture; |
66 SkPictureRecord* fCanvas; // ref counted | 65 SkPictureRecord* fCanvas; // ref counted |
67 | 66 |
68 typedef SkNoncopyable INHERITED; | 67 typedef SkNoncopyable INHERITED; |
69 }; | 68 }; |
70 | 69 |
71 #endif | 70 #endif |
OLD | NEW |