| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 intended for stand alone tools. | 161 intended for stand alone tools. |
| 162 If false is returned, SkPictInfo is unmodified. | 162 If false is returned, SkPictInfo is unmodified. |
| 163 */ | 163 */ |
| 164 static bool InternalOnly_StreamIsSKP(SkStream*, SkPictInfo*); | 164 static bool InternalOnly_StreamIsSKP(SkStream*, SkPictInfo*); |
| 165 static bool InternalOnly_BufferIsSKP(SkReadBuffer*, SkPictInfo*); | 165 static bool InternalOnly_BufferIsSKP(SkReadBuffer*, SkPictInfo*); |
| 166 | 166 |
| 167 /** Return true if the picture is suitable for rendering on the GPU. | 167 /** Return true if the picture is suitable for rendering on the GPU. |
| 168 */ | 168 */ |
| 169 | 169 |
| 170 #if SK_SUPPORT_GPU | 170 #if SK_SUPPORT_GPU |
| 171 bool suitableForGpuRasterization(GrContext*, const char ** = NULL) const; | 171 bool suitableForGpuRasterization(GrContext*, const char ** = NULL); |
| 172 #endif | 172 #endif |
| 173 | 173 |
| 174 /** Return the approximate number of operations in this picture. This | 174 /** Return the approximate number of operations in this picture. This |
| 175 * number may be greater or less than the number of SkCanvas calls | 175 * number may be greater or less than the number of SkCanvas calls |
| 176 * recorded: some calls may be recorded as more than one operation, or some | 176 * recorded: some calls may be recorded as more than one operation, or some |
| 177 * calls may be optimized away. | 177 * calls may be optimized away. |
| 178 */ | 178 */ |
| 179 int approximateOpCount() const; | 179 int approximateOpCount() const; |
| 180 | 180 |
| 181 /** Return true if this picture contains text. | 181 /** Return true if this picture contains text. |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 int drawableCount() const; | 281 int drawableCount() const; |
| 282 // will return NULL if drawableCount() returns 0 | 282 // will return NULL if drawableCount() returns 0 |
| 283 SkPicture const* const* drawablePicts() const; | 283 SkPicture const* const* drawablePicts() const; |
| 284 | 284 |
| 285 struct PathCounter; | 285 struct PathCounter; |
| 286 | 286 |
| 287 struct Analysis { | 287 struct Analysis { |
| 288 Analysis() {} // Only used by SkPictureData codepath. | 288 Analysis() {} // Only used by SkPictureData codepath. |
| 289 explicit Analysis(const SkRecord&); | 289 explicit Analysis(const SkRecord&); |
| 290 | 290 |
| 291 bool isAnalyzed() const {return fIsAnalyzed;} |
| 292 void performAnalysis(const SkRecord&); |
| 291 bool suitableForGpuRasterization(const char** reason, int sampleCount) c
onst; | 293 bool suitableForGpuRasterization(const char** reason, int sampleCount) c
onst; |
| 292 | 294 |
| 293 uint8_t fNumSlowPathsAndDashEffects; | 295 uint8_t fNumSlowPathsAndDashEffects; |
| 294 bool fWillPlaybackBitmaps : 1; | 296 bool fWillPlaybackBitmaps : 1; |
| 295 bool fHasText : 1; | 297 bool fHasText : 1; |
| 298 bool fIsAnalyzed : 1; |
| 296 } fAnalysis; | 299 } fAnalysis; |
| 297 | 300 |
| 298 friend class SkPictureRecorder; // SkRecord-based constructor. | 301 friend class SkPictureRecorder; // SkRecord-based constructor. |
| 299 friend class GrLayerHoister; // access to fRecord | 302 friend class GrLayerHoister; // access to fRecord |
| 300 friend class ReplaceDraw; | 303 friend class ReplaceDraw; |
| 301 friend class SkPictureUtils; | 304 friend class SkPictureUtils; |
| 302 friend class SkRecordedDrawable; | 305 friend class SkRecordedDrawable; |
| 303 }; | 306 }; |
| 304 SK_COMPILE_ASSERT(sizeof(SkPicture) <= 88, SkPictureSize); | 307 SK_COMPILE_ASSERT(sizeof(SkPicture) <= 88, SkPictureSize); |
| 305 | 308 |
| 306 #endif | 309 #endif |
| OLD | NEW |