OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2007 The Android Open Source Project | 2 * Copyright 2007 The Android Open Source Project |
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 | 8 |
9 #ifndef SkPicture_DEFINED | 9 #ifndef SkPicture_DEFINED |
10 #define SkPicture_DEFINED | 10 #define SkPicture_DEFINED |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 * Serialize to a buffer. | 164 * Serialize to a buffer. |
165 */ | 165 */ |
166 void flatten(SkWriteBuffer&) const; | 166 void flatten(SkWriteBuffer&) const; |
167 | 167 |
168 /** | 168 /** |
169 * Returns true if any bitmaps may be produced when this SkPicture | 169 * Returns true if any bitmaps may be produced when this SkPicture |
170 * is replayed. | 170 * is replayed. |
171 */ | 171 */ |
172 bool willPlayBackBitmaps() const; | 172 bool willPlayBackBitmaps() const; |
173 | 173 |
| 174 /** |
| 175 * This is a general hint that the picture will (soon) be drawn into a SkCa
nvas with |
| 176 * corresponding attributes (e.g. clip, matrix, props). No drawing occurs,
but some |
| 177 * expensive operations may be run (e.g. image decoding). |
| 178 * |
| 179 * Any of the parameters may be NULL. |
| 180 * |
| 181 * @param srcBounds If not NULL, this is the subset of the picture (in the
same coordinates |
| 182 * as the picture's bounds) that preroll() should focus on
. |
| 183 * @param initialMatrix If not NULL, this is the initialMatrix that is expe
cted when the |
| 184 * picture is actually drawn. |
| 185 * @param props If not NULL, these are the expected props when the picture
is actually drawn. |
| 186 */ |
| 187 void preroll(const SkRect* srcBounds, const SkMatrix* initialMatrix, const S
kSurfaceProps*, |
| 188 void* gpuCacheAccessor) const; |
| 189 |
174 /** Return true if the SkStream/Buffer represents a serialized picture, and | 190 /** Return true if the SkStream/Buffer represents a serialized picture, and |
175 fills out SkPictInfo. After this function returns, the data source is no
t | 191 fills out SkPictInfo. After this function returns, the data source is no
t |
176 rewound so it will have to be manually reset before passing to | 192 rewound so it will have to be manually reset before passing to |
177 CreateFromStream or CreateFromBuffer. Note, CreateFromStream and | 193 CreateFromStream or CreateFromBuffer. Note, CreateFromStream and |
178 CreateFromBuffer perform this check internally so these entry points are | 194 CreateFromBuffer perform this check internally so these entry points are |
179 intended for stand alone tools. | 195 intended for stand alone tools. |
180 If false is returned, SkPictInfo is unmodified. | 196 If false is returned, SkPictInfo is unmodified. |
181 */ | 197 */ |
182 static bool InternalOnly_StreamIsSKP(SkStream*, SkPictInfo*); | 198 static bool InternalOnly_StreamIsSKP(SkStream*, SkPictInfo*); |
183 static bool InternalOnly_BufferIsSKP(SkReadBuffer*, SkPictInfo*); | 199 static bool InternalOnly_BufferIsSKP(SkReadBuffer*, SkPictInfo*); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 | 323 |
308 friend class SkPictureRecorder; // SkRecord-based constructor. | 324 friend class SkPictureRecorder; // SkRecord-based constructor. |
309 friend class GrLayerHoister; // access to fRecord | 325 friend class GrLayerHoister; // access to fRecord |
310 friend class ReplaceDraw; | 326 friend class ReplaceDraw; |
311 friend class SkPictureUtils; | 327 friend class SkPictureUtils; |
312 friend class SkRecordedDrawable; | 328 friend class SkRecordedDrawable; |
313 }; | 329 }; |
314 SK_COMPILE_ASSERT(sizeof(SkPicture) <= 96, SkPictureSize); | 330 SK_COMPILE_ASSERT(sizeof(SkPicture) <= 96, SkPictureSize); |
315 | 331 |
316 #endif | 332 #endif |
OLD | NEW |