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 #ifndef SkPicture_DEFINED | 10 #ifndef SkPicture_DEFINED |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 118 |
119 In most cases the record cost is offset by the playback improvement | 119 In most cases the record cost is offset by the playback improvement |
120 after a frame or two of tiled rendering (and complex pictures that | 120 after a frame or two of tiled rendering (and complex pictures that |
121 induce the worst record times will generally get the largest | 121 induce the worst record times will generally get the largest |
122 speedups at playback time). | 122 speedups at playback time). |
123 | 123 |
124 Note: Currently this is not serializable, the bounding data will be | 124 Note: Currently this is not serializable, the bounding data will be |
125 discarded if you serialize into a stream and then deserialize. | 125 discarded if you serialize into a stream and then deserialize. |
126 */ | 126 */ |
127 kOptimizeForClippedPlayback_RecordingFlag = 0x02, | 127 kOptimizeForClippedPlayback_RecordingFlag = 0x02, |
128 /* | |
129 This flag disables all the picture recording optimizations (i.e., | |
130 those in SkPictureRecord). It is mainly intended for testing the | |
131 existing optimizations (i.e., to actually have the pattern | |
132 appear in an .skp we have to disable the optimization). This | |
133 option doesn't affect the optimizations controlled by | |
134 'kOptimizeForClippedPlayback_RecordingFlag'. | |
135 */ | |
136 kDisableRecordOptimizations_RecordingFlag = 0x04 | |
137 }; | 128 }; |
138 | 129 |
139 /** Returns the canvas that records the drawing commands. | 130 /** Returns the canvas that records the drawing commands. |
140 @param width the base width for the picture, as if the recording | 131 @param width the base width for the picture, as if the recording |
141 canvas' bitmap had this width. | 132 canvas' bitmap had this width. |
142 @param height the base width for the picture, as if the recording | 133 @param height the base width for the picture, as if the recording |
143 canvas' bitmap had this height. | 134 canvas' bitmap had this height. |
144 @param recordFlags optional flags that control recording. | 135 @param recordFlags optional flags that control recording. |
145 @return the picture canvas. | 136 @return the picture canvas. |
146 */ | 137 */ |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 fills out SkPictInfo. After this function returns, the data source is no
t | 212 fills out SkPictInfo. After this function returns, the data source is no
t |
222 rewound so it will have to be manually reset before passing to | 213 rewound so it will have to be manually reset before passing to |
223 CreateFromStream or CreateFromBuffer. Note, CreateFromStream and | 214 CreateFromStream or CreateFromBuffer. Note, CreateFromStream and |
224 CreateFromBuffer perform this check internally so these entry points are | 215 CreateFromBuffer perform this check internally so these entry points are |
225 intended for stand alone tools. | 216 intended for stand alone tools. |
226 If false is returned, SkPictInfo is unmodified. | 217 If false is returned, SkPictInfo is unmodified. |
227 */ | 218 */ |
228 static bool InternalOnly_StreamIsSKP(SkStream*, SkPictInfo*); | 219 static bool InternalOnly_StreamIsSKP(SkStream*, SkPictInfo*); |
229 static bool InternalOnly_BufferIsSKP(SkReadBuffer&, SkPictInfo*); | 220 static bool InternalOnly_BufferIsSKP(SkReadBuffer&, SkPictInfo*); |
230 | 221 |
| 222 /** Enable/disable all the picture recording optimizations (i.e., |
| 223 those in SkPictureRecord). It is mainly intended for testing the |
| 224 existing optimizations (i.e., to actually have the pattern |
| 225 appear in an .skp we have to disable the optimization). Call right |
| 226 after 'beginRecording'. |
| 227 */ |
| 228 void internalOnly_EnableOpts(bool enableOpts); |
| 229 |
231 protected: | 230 protected: |
232 // V2 : adds SkPixelRef's generation ID. | 231 // V2 : adds SkPixelRef's generation ID. |
233 // V3 : PictInfo tag at beginning, and EOF tag at the end | 232 // V3 : PictInfo tag at beginning, and EOF tag at the end |
234 // V4 : move SkPictInfo to be the header | 233 // V4 : move SkPictInfo to be the header |
235 // V5 : don't read/write FunctionPtr on cross-process (we can detect that) | 234 // V5 : don't read/write FunctionPtr on cross-process (we can detect that) |
236 // V6 : added serialization of SkPath's bounds (and packed its flags tighter
) | 235 // V6 : added serialization of SkPath's bounds (and packed its flags tighter
) |
237 // V7 : changed drawBitmapRect(IRect) to drawBitmapRectToRect(Rect) | 236 // V7 : changed drawBitmapRect(IRect) to drawBitmapRectToRect(Rect) |
238 // V8 : Add an option for encoding bitmaps | 237 // V8 : Add an option for encoding bitmaps |
239 // V9 : Allow the reader and writer of an SKP disagree on whether to support | 238 // V9 : Allow the reader and writer of an SKP disagree on whether to support |
240 // SK_SUPPORT_HINTING_SCALE_FACTOR | 239 // SK_SUPPORT_HINTING_SCALE_FACTOR |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 */ | 293 */ |
295 class SK_API SkDrawPictureCallback { | 294 class SK_API SkDrawPictureCallback { |
296 public: | 295 public: |
297 SkDrawPictureCallback() {} | 296 SkDrawPictureCallback() {} |
298 virtual ~SkDrawPictureCallback() {} | 297 virtual ~SkDrawPictureCallback() {} |
299 | 298 |
300 virtual bool abortDrawing() = 0; | 299 virtual bool abortDrawing() = 0; |
301 }; | 300 }; |
302 | 301 |
303 #endif | 302 #endif |
OLD | NEW |