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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 static bool IsValidPictInfo(const SkPictInfo& info); | 276 static bool IsValidPictInfo(const SkPictInfo& info); |
277 | 277 |
278 friend class SkPictureRecorder; // SkRecord-based constructor. | 278 friend class SkPictureRecorder; // SkRecord-based constructor. |
279 friend class SkGpuDevice; // for fData access | 279 friend class SkGpuDevice; // for fData access |
280 friend class GrLayerHoister; // access to fRecord | 280 friend class GrLayerHoister; // access to fRecord |
281 friend class SkPicturePlayback; // to get fData | 281 friend class SkPicturePlayback; // to get fData |
282 friend class ReplaceDraw; | 282 friend class ReplaceDraw; |
283 | 283 |
284 typedef SkRefCnt INHERITED; | 284 typedef SkRefCnt INHERITED; |
285 | 285 |
286 // Takes ownership of the SkRecord, refs the (optional) BBH. | 286 // Takes ownership of the SkRecord, refs the (optional) drawablePicts and BB
H. |
287 SkPicture(SkScalar width, SkScalar height, SkRecord*, SkBBoxHierarchy*); | 287 SkPicture(SkScalar width, SkScalar height, SkRecord*, SkData* drawablePicts, |
| 288 SkBBoxHierarchy*); |
288 // Return as a new SkPicture that's backed by SkRecord. | 289 // Return as a new SkPicture that's backed by SkRecord. |
289 static SkPicture* Forwardport(const SkPicture&); | 290 static SkPicture* Forwardport(const SkPicture&); |
290 // Return as a new SkPicture that's backed by the old backend. | 291 // Return as a new SkPicture that's backed by the old backend. |
291 static SkPicture* Backport(const SkRecord& src, const SkRect& cullRect); | 292 static SkPicture* Backport(const SkRecord& src, |
| 293 SkPicture* const drawablePicts[], int drawableCou
nt, |
| 294 const SkRect& cullRect); |
292 | 295 |
293 SkAutoTDelete<SkRecord> fRecord; | 296 SkAutoTDelete<SkRecord> fRecord; |
294 SkAutoTUnref<SkBBoxHierarchy> fBBH; | 297 SkAutoTUnref<SkBBoxHierarchy> fBBH; |
| 298 SkAutoTUnref<SkData> fDrawablePicts; |
| 299 |
| 300 // helpers for fDrawablePicts |
| 301 int drawableCount() const; |
| 302 // will return NULL if drawableCount() returns 0 |
| 303 SkPicture* const* drawablePicts() const; |
295 | 304 |
296 struct PathCounter; | 305 struct PathCounter; |
297 | 306 |
298 struct Analysis { | 307 struct Analysis { |
299 Analysis() {} // Only used by SkPictureData codepath. | 308 Analysis() {} // Only used by SkPictureData codepath. |
300 explicit Analysis(const SkRecord&); | 309 explicit Analysis(const SkRecord&); |
301 | 310 |
302 bool suitableForGpuRasterization(const char** reason, int sampleCount) c
onst; | 311 bool suitableForGpuRasterization(const char** reason, int sampleCount) c
onst; |
303 | 312 |
304 bool fWillPlaybackBitmaps; | 313 bool fWillPlaybackBitmaps; |
305 bool fHasText; | 314 bool fHasText; |
306 int fNumPaintWithPathEffectUses; | 315 int fNumPaintWithPathEffectUses; |
307 int fNumFastPathDashEffects; | 316 int fNumFastPathDashEffects; |
308 int fNumAAConcavePaths; | 317 int fNumAAConcavePaths; |
309 int fNumAAHairlineConcavePaths; | 318 int fNumAAHairlineConcavePaths; |
310 int fNumAADFEligibleConcavePaths; | 319 int fNumAADFEligibleConcavePaths; |
311 } fAnalysis; | 320 } fAnalysis; |
312 }; | 321 }; |
313 | 322 |
314 #endif | 323 #endif |
OLD | NEW |