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 #ifndef SkPicture_DEFINED | 8 #ifndef SkPicture_DEFINED |
9 #define SkPicture_DEFINED | 9 #define SkPicture_DEFINED |
10 | 10 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 fills out SkPictInfo. After this function returns, the data source is no
t | 146 fills out SkPictInfo. After this function returns, the data source is no
t |
147 rewound so it will have to be manually reset before passing to | 147 rewound so it will have to be manually reset before passing to |
148 CreateFromStream or CreateFromBuffer. Note, CreateFromStream and | 148 CreateFromStream or CreateFromBuffer. Note, CreateFromStream and |
149 CreateFromBuffer perform this check internally so these entry points are | 149 CreateFromBuffer perform this check internally so these entry points are |
150 intended for stand alone tools. | 150 intended for stand alone tools. |
151 If false is returned, SkPictInfo is unmodified. | 151 If false is returned, SkPictInfo is unmodified. |
152 */ | 152 */ |
153 static bool InternalOnly_StreamIsSKP(SkStream*, SkPictInfo*); | 153 static bool InternalOnly_StreamIsSKP(SkStream*, SkPictInfo*); |
154 static bool InternalOnly_BufferIsSKP(SkReadBuffer*, SkPictInfo*); | 154 static bool InternalOnly_BufferIsSKP(SkReadBuffer*, SkPictInfo*); |
155 | 155 |
| 156 #ifdef SK_SUPPORT_LEGACY_PICTURE_GPUVETO |
156 /** Return true if the picture is suitable for rendering on the GPU. */ | 157 /** Return true if the picture is suitable for rendering on the GPU. */ |
157 bool suitableForGpuRasterization(GrContext*, const char** whyNot = NULL) con
st; | 158 bool suitableForGpuRasterization(GrContext*, const char** whyNot = NULL) con
st; |
| 159 #endif |
158 | 160 |
159 // Sent via SkMessageBus from destructor. | 161 // Sent via SkMessageBus from destructor. |
160 struct DeletionMessage { int32_t fUniqueID; }; // TODO: -> uint32_t? | 162 struct DeletionMessage { int32_t fUniqueID; }; // TODO: -> uint32_t? |
161 | 163 |
162 // Returns NULL if this is not an SkBigPicture. | 164 // Returns NULL if this is not an SkBigPicture. |
163 virtual const SkBigPicture* asSkBigPicture() const { return NULL; } | 165 virtual const SkBigPicture* asSkBigPicture() const { return NULL; } |
164 | 166 |
165 // Global setting to enable or disable security precautions for serializatio
n. | 167 // Global setting to enable or disable security precautions for serializatio
n. |
166 static void SetPictureIOSecurityPrecautionsEnabled_Dangerous(bool set); | 168 static void SetPictureIOSecurityPrecautionsEnabled_Dangerous(bool set); |
167 static bool PictureIOSecurityPrecautionsEnabled(); | 169 static bool PictureIOSecurityPrecautionsEnabled(); |
(...skipping 15 matching lines...) Expand all Loading... |
183 SkPicture(); | 185 SkPicture(); |
184 friend class SkBigPicture; | 186 friend class SkBigPicture; |
185 friend class SkEmptyPicture; | 187 friend class SkEmptyPicture; |
186 template <typename> friend class SkMiniPicture; | 188 template <typename> friend class SkMiniPicture; |
187 | 189 |
188 void serialize(SkWStream*, SkPixelSerializer*, SkRefCntSet* typefaces) const
; | 190 void serialize(SkWStream*, SkPixelSerializer*, SkRefCntSet* typefaces) const
; |
189 static sk_sp<SkPicture> MakeFromStream(SkStream*, InstallPixelRefProc, SkTyp
efacePlayback*); | 191 static sk_sp<SkPicture> MakeFromStream(SkStream*, InstallPixelRefProc, SkTyp
efacePlayback*); |
190 friend class SkPictureData; | 192 friend class SkPictureData; |
191 | 193 |
192 virtual int numSlowPaths() const = 0; | 194 virtual int numSlowPaths() const = 0; |
| 195 friend class SkPictureGpuAnalyzer; |
193 friend struct SkPathCounter; | 196 friend struct SkPathCounter; |
194 | 197 |
195 // V35: Store SkRect (rather then width & height) in header | 198 // V35: Store SkRect (rather then width & height) in header |
196 // V36: Remove (obsolete) alphatype from SkColorTable | 199 // V36: Remove (obsolete) alphatype from SkColorTable |
197 // V37: Added shadow only option to SkDropShadowImageFilter (last version to
record CLEAR) | 200 // V37: Added shadow only option to SkDropShadowImageFilter (last version to
record CLEAR) |
198 // V38: Added PictureResolution option to SkPictureImageFilter | 201 // V38: Added PictureResolution option to SkPictureImageFilter |
199 // V39: Added FilterLevel option to SkPictureImageFilter | 202 // V39: Added FilterLevel option to SkPictureImageFilter |
200 // V40: Remove UniqueID serialization from SkImageFilter. | 203 // V40: Remove UniqueID serialization from SkImageFilter. |
201 // V41: Added serialization of SkBitmapSource's filterQuality parameter | 204 // V41: Added serialization of SkBitmapSource's filterQuality parameter |
202 // V42: Added a bool to SkPictureShader serialization to indicate did-we-ser
ialize-a-picture? | 205 // V42: Added a bool to SkPictureShader serialization to indicate did-we-ser
ialize-a-picture? |
(...skipping 19 matching lines...) Expand all Loading... |
222 const SkPictureData*, | 225 const SkPictureData*, |
223 const SkReadBuffer* buffer); | 226 const SkReadBuffer* buffer); |
224 | 227 |
225 SkPictInfo createHeader() const; | 228 SkPictInfo createHeader() const; |
226 SkPictureData* backport() const; | 229 SkPictureData* backport() const; |
227 | 230 |
228 mutable uint32_t fUniqueID; | 231 mutable uint32_t fUniqueID; |
229 }; | 232 }; |
230 | 233 |
231 #endif | 234 #endif |
OLD | NEW |