| 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 |
| 11 #define SkPicture_DEFINED | 11 #define SkPicture_DEFINED |
| 12 | 12 |
| 13 #include "SkBitmap.h" | 13 #include "SkBitmap.h" |
| 14 #include "SkDrawPictureCallback.h" | 14 #include "SkDrawPictureCallback.h" |
| 15 #include "SkImageDecoder.h" | 15 #include "SkImageDecoder.h" |
| 16 #include "SkRefCnt.h" | 16 #include "SkRefCnt.h" |
| 17 #include "SkTDArray.h" | 17 #include "SkTDArray.h" |
| 18 | 18 |
| 19 #if SK_SUPPORT_GPU | 19 #if SK_SUPPORT_GPU |
| 20 class GrContext; | 20 class GrContext; |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 class GrReplacements; |
| 23 class SkBBoxHierarchy; | 24 class SkBBoxHierarchy; |
| 24 class SkCanvas; | 25 class SkCanvas; |
| 25 class SkData; | 26 class SkData; |
| 26 class SkPictureData; | 27 class SkPictureData; |
| 27 class SkPictureRecord; | 28 class SkPictureRecord; |
| 28 class SkStream; | 29 class SkStream; |
| 29 class SkWStream; | 30 class SkWStream; |
| 30 | 31 |
| 31 struct SkPictInfo; | 32 struct SkPictInfo; |
| 32 | 33 |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 | 293 |
| 293 void createHeader(SkPictInfo* info) const; | 294 void createHeader(SkPictInfo* info) const; |
| 294 static bool IsValidPictInfo(const SkPictInfo& info); | 295 static bool IsValidPictInfo(const SkPictInfo& info); |
| 295 | 296 |
| 296 friend class SkPictureData; // to access OperationList | 297 friend class SkPictureData; // to access OperationList |
| 297 friend class SkPictureRecorder; // just for SkPicture-based const
ructor | 298 friend class SkPictureRecorder; // just for SkPicture-based const
ructor |
| 298 friend class SkGpuDevice; // for fData access | 299 friend class SkGpuDevice; // for fData access |
| 299 friend class GrLayerHoister; // access to fRecord | 300 friend class GrLayerHoister; // access to fRecord |
| 300 friend class CollectLayers; // access to fRecord | 301 friend class CollectLayers; // access to fRecord |
| 301 friend class SkPicturePlayback; // to get fData & OperationList | 302 friend class SkPicturePlayback; // to get fData & OperationList |
| 302 friend class SkPictureReplacementPlayback; // to access OperationList | 303 friend void GrRecordReplaceDraw(const SkPicture* picture, |
| 304 SkCanvas* canvas, |
| 305 const GrReplacements* replacements, |
| 306 const SkMatrix& initialMatrix, |
| 307 SkDrawPictureCallback* callback); |
| 303 | 308 |
| 304 typedef SkRefCnt INHERITED; | 309 typedef SkRefCnt INHERITED; |
| 305 | 310 |
| 306 // Takes ownership of the SkRecord, refs the (optional) BBH. | 311 // Takes ownership of the SkRecord, refs the (optional) BBH. |
| 307 SkPicture(SkScalar width, SkScalar height, SkRecord*, SkBBoxHierarchy*); | 312 SkPicture(SkScalar width, SkScalar height, SkRecord*, SkBBoxHierarchy*); |
| 308 // Return as a new SkPicture that's backed by SkRecord. | 313 // Return as a new SkPicture that's backed by SkRecord. |
| 309 static SkPicture* Forwardport(const SkPicture&); | 314 static SkPicture* Forwardport(const SkPicture&); |
| 310 | 315 |
| 311 SkAutoTDelete<SkRecord> fRecord; | 316 SkAutoTDelete<SkRecord> fRecord; |
| 312 SkAutoTUnref<SkBBoxHierarchy> fBBH; | 317 SkAutoTUnref<SkBBoxHierarchy> fBBH; |
| 313 | 318 |
| 314 struct PathCounter; | 319 struct PathCounter; |
| 315 | 320 |
| 316 struct Analysis { | 321 struct Analysis { |
| 317 Analysis() {} // Only used by SkPictureData codepath. | 322 Analysis() {} // Only used by SkPictureData codepath. |
| 318 explicit Analysis(const SkRecord&); | 323 explicit Analysis(const SkRecord&); |
| 319 | 324 |
| 320 bool suitableForGpuRasterization(const char** reason, int sampleCount) c
onst; | 325 bool suitableForGpuRasterization(const char** reason, int sampleCount) c
onst; |
| 321 | 326 |
| 322 bool fWillPlaybackBitmaps; | 327 bool fWillPlaybackBitmaps; |
| 323 bool fHasText; | 328 bool fHasText; |
| 324 int fNumPaintWithPathEffectUses; | 329 int fNumPaintWithPathEffectUses; |
| 325 int fNumFastPathDashEffects; | 330 int fNumFastPathDashEffects; |
| 326 int fNumAAConcavePaths; | 331 int fNumAAConcavePaths; |
| 327 int fNumAAHairlineConcavePaths; | 332 int fNumAAHairlineConcavePaths; |
| 328 } fAnalysis; | 333 } fAnalysis; |
| 329 }; | 334 }; |
| 330 | 335 |
| 331 #endif | 336 #endif |
| OLD | NEW |