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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 static const uint32_t MIN_PICTURE_VERSION = 35; // Produced by Chrome M3
9. | 253 static const uint32_t MIN_PICTURE_VERSION = 35; // Produced by Chrome M3
9. |
254 static const uint32_t CURRENT_PICTURE_VERSION = 41; | 254 static const uint32_t CURRENT_PICTURE_VERSION = 41; |
255 | 255 |
256 static_assert(MIN_PICTURE_VERSION <= 41, | 256 static_assert(MIN_PICTURE_VERSION <= 41, |
257 "Remove kFontFileName and related code from SkFontDescriptor.c
pp."); | 257 "Remove kFontFileName and related code from SkFontDescriptor.c
pp."); |
258 | 258 |
259 void createHeader(SkPictInfo* info) const; | 259 void createHeader(SkPictInfo* info) const; |
260 static bool IsValidPictInfo(const SkPictInfo& info); | 260 static bool IsValidPictInfo(const SkPictInfo& info); |
261 | 261 |
262 // Takes ownership of the SkRecord and (optional) SnapshotArray, refs the (o
ptional) BBH. | 262 // Takes ownership of the SkRecord and (optional) SnapshotArray, refs the (o
ptional) BBH. |
263 SkPicture(const SkRect& cullRect, SkRecord*, SnapshotArray*, SkBBoxHierarchy
*); | 263 SkPicture(const SkRect& cullRect, |
| 264 SkRecord*, |
| 265 SnapshotArray*, |
| 266 SkBBoxHierarchy*, |
| 267 size_t approxBytesUsedBySubPictures); |
264 | 268 |
265 static SkPicture* Forwardport(const SkPictInfo&, const SkPictureData*); | 269 static SkPicture* Forwardport(const SkPictInfo&, const SkPictureData*); |
266 static SkPictureData* Backport(const SkRecord&, const SkPictInfo&, | 270 static SkPictureData* Backport(const SkRecord&, const SkPictInfo&, |
267 SkPicture const* const drawablePics[], int dr
awableCount); | 271 SkPicture const* const drawablePics[], int dr
awableCount); |
268 | 272 |
269 // uint32_t fRefCnt; from SkNVRefCnt<SkPicture> | 273 // uint32_t fRefCnt; from SkNVRefCnt<SkPicture> |
270 mutable uint32_t fUniqueID; | 274 mutable uint32_t fUniqueID; |
271 const SkRect fCullRect; | 275 const SkRect fCullRect; |
272 mutable SkAutoTUnref<const AccelData> fAccelData; | 276 mutable SkAutoTUnref<const AccelData> fAccelData; |
273 SkAutoTUnref<const SkRecord> fRecord; | 277 SkAutoTUnref<const SkRecord> fRecord; |
274 SkAutoTUnref<const SkBBoxHierarchy> fBBH; | 278 SkAutoTUnref<const SkBBoxHierarchy> fBBH; |
275 SkAutoTDelete<const SnapshotArray> fDrawablePicts; | 279 SkAutoTDelete<const SnapshotArray> fDrawablePicts; |
| 280 const size_t fApproxBytesUsedBySubPictures; |
276 | 281 |
277 // helpers for fDrawablePicts | 282 // helpers for fDrawablePicts |
278 int drawableCount() const; | 283 int drawableCount() const; |
279 // will return NULL if drawableCount() returns 0 | 284 // will return NULL if drawableCount() returns 0 |
280 SkPicture const* const* drawablePicts() const; | 285 SkPicture const* const* drawablePicts() const; |
281 | 286 |
282 struct PathCounter; | 287 struct PathCounter; |
283 | 288 |
284 struct Analysis { | 289 struct Analysis { |
285 Analysis() {} // Only used by SkPictureData codepath. | 290 Analysis() {} // Only used by SkPictureData codepath. |
286 explicit Analysis(const SkRecord&); | 291 explicit Analysis(const SkRecord&); |
287 | 292 |
288 bool suitableForGpuRasterization(const char** reason, int sampleCount) c
onst; | 293 bool suitableForGpuRasterization(const char** reason, int sampleCount) c
onst; |
289 | 294 |
290 bool fWillPlaybackBitmaps; | 295 bool fWillPlaybackBitmaps; |
291 bool fHasText; | 296 bool fHasText; |
292 int fNumPaintWithPathEffectUses; | 297 int fNumPaintWithPathEffectUses; |
293 int fNumFastPathDashEffects; | 298 int fNumFastPathDashEffects; |
294 int fNumAAConcavePaths; | 299 int fNumAAConcavePaths; |
295 int fNumAAHairlineConcavePaths; | 300 int fNumAAHairlineConcavePaths; |
296 int fNumAADFEligibleConcavePaths; | 301 int fNumAADFEligibleConcavePaths; |
297 } fAnalysis; | 302 } fAnalysis; |
298 | 303 |
299 friend class SkPictureRecorder; // SkRecord-based constructor. | 304 friend class SkPictureRecorder; // SkRecord-based constructor. |
300 friend class GrLayerHoister; // access to fRecord | 305 friend class GrLayerHoister; // access to fRecord |
301 friend class ReplaceDraw; | 306 friend class ReplaceDraw; |
302 friend class SkPictureUtils; | 307 friend class SkPictureUtils; |
303 friend class SkRecordedDrawable; | 308 friend class SkRecordedDrawable; |
304 }; | 309 }; |
305 SK_COMPILE_ASSERT(sizeof(SkPicture) <= 96, SkPictureSize); | 310 SK_COMPILE_ASSERT(sizeof(SkPicture) <= 104, SkPictureSize); |
306 | 311 |
307 #endif | 312 #endif |
OLD | NEW |