OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
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 #ifndef SkBigPicture_DEFINED | 8 #ifndef SkBigPicture_DEFINED |
9 #define SkBigPicture_DEFINED | 9 #define SkBigPicture_DEFINED |
10 | 10 |
11 #include "SkOncePtr.h" | 11 #include "SkOnce.h" |
12 #include "SkPicture.h" | 12 #include "SkPicture.h" |
13 #include "SkRect.h" | 13 #include "SkRect.h" |
14 #include "SkTemplates.h" | 14 #include "SkTemplates.h" |
15 | 15 |
16 class SkBBoxHierarchy; | 16 class SkBBoxHierarchy; |
17 class SkMatrix; | 17 class SkMatrix; |
18 class SkRecord; | 18 class SkRecord; |
19 | 19 |
20 // An implementation of SkPicture supporting an arbitrary number of drawing comm
ands. | 20 // An implementation of SkPicture supporting an arbitrary number of drawing comm
ands. |
21 class SkBigPicture final : public SkPicture { | 21 class SkBigPicture final : public SkPicture { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 int start, | 58 int start, |
59 int stop, | 59 int stop, |
60 const SkMatrix& initialCTM) const; | 60 const SkMatrix& initialCTM) const; |
61 // Used by GrRecordReplaceDraw | 61 // Used by GrRecordReplaceDraw |
62 const SkBBoxHierarchy* bbh() const { return fBBH; } | 62 const SkBBoxHierarchy* bbh() const { return fBBH; } |
63 const SkRecord* record() const { return fRecord; } | 63 const SkRecord* record() const { return fRecord; } |
64 const AccelData* accelData() const { return fAccelData; } | 64 const AccelData* accelData() const { return fAccelData; } |
65 | 65 |
66 private: | 66 private: |
67 struct Analysis { | 67 struct Analysis { |
68 explicit Analysis(const SkRecord&); | 68 void init(const SkRecord&); |
69 | 69 |
70 bool suitableForGpuRasterization(const char** reason) const; | 70 bool suitableForGpuRasterization(const char** reason) const; |
71 | 71 |
72 uint8_t fNumSlowPathsAndDashEffects; | 72 uint8_t fNumSlowPathsAndDashEffects; |
73 bool fWillPlaybackBitmaps : 1; | 73 bool fWillPlaybackBitmaps : 1; |
74 bool fHasText : 1; | 74 bool fHasText : 1; |
75 }; | 75 }; |
76 | 76 |
77 int numSlowPaths() const override; | 77 int numSlowPaths() const override; |
78 const Analysis& analysis() const; | 78 const Analysis& analysis() const; |
79 int drawableCount() const; | 79 int drawableCount() const; |
80 SkPicture const* const* drawablePicts() const; | 80 SkPicture const* const* drawablePicts() const; |
81 | 81 |
82 const SkRect fCullRect; | 82 const SkRect fCullRect; |
83 const size_t fApproxBytesUsedBySubPictures; | 83 const size_t fApproxBytesUsedBySubPictures; |
84 SkOncePtr<const Analysis> fAnalysis; | 84 mutable SkOnce fAnalysisOnce; |
| 85 mutable Analysis fAnalysis; |
85 SkAutoTUnref<const SkRecord> fRecord; | 86 SkAutoTUnref<const SkRecord> fRecord; |
86 SkAutoTDelete<const SnapshotArray> fDrawablePicts; | 87 SkAutoTDelete<const SnapshotArray> fDrawablePicts; |
87 SkAutoTUnref<const SkBBoxHierarchy> fBBH; | 88 SkAutoTUnref<const SkBBoxHierarchy> fBBH; |
88 SkAutoTUnref<const AccelData> fAccelData; | 89 SkAutoTUnref<const AccelData> fAccelData; |
89 }; | 90 }; |
90 | 91 |
91 #endif//SkBigPicture_DEFINED | 92 #endif//SkBigPicture_DEFINED |
OLD | NEW |