OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2014 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
| 8 #ifndef SkPictureContentInfo_DEFINED |
| 9 #define SkPictureContentInfo_DEFINED |
| 10 |
| 11 class GrContext; |
| 12 |
| 13 class SkPictureContentInfo { |
| 14 public: |
| 15 SkPictureContentInfo() { this->reset(); } |
| 16 SkPictureContentInfo(const SkPictureContentInfo& src) { this->set(src); } |
| 17 |
| 18 int numOperations() const { return fNumOperations; } |
| 19 bool hasText() const { return fNumTexts > 0; } |
| 20 bool suitableForGpuRasterization(GrContext* context, const char **reason, |
| 21 int sampleCount) const; |
| 22 |
| 23 void addOperation() { ++fNumOperations; } |
| 24 |
| 25 void onDrawPoints(size_t count, const SkPaint& paint); |
| 26 void onDrawPath(const SkPath& path, const SkPaint& paint); |
| 27 void onAddPaintPtr(const SkPaint* paint); |
| 28 void onDrawText() { ++fNumTexts; } |
| 29 |
| 30 void set(const SkPictureContentInfo& src); |
| 31 void reset(); |
| 32 void swap(SkPictureContentInfo* other); |
| 33 |
| 34 private: |
| 35 // Raw count of operations in the picture |
| 36 int fNumOperations; |
| 37 // Count of all forms of drawText |
| 38 int fNumTexts; |
| 39 |
| 40 // This field is incremented every time a paint with a path effect is |
| 41 // used (i.e., it is not a de-duplicated count) |
| 42 int fNumPaintWithPathEffectUses; |
| 43 // This field is incremented every time a paint with a path effect that is |
| 44 // dashed, we are drawing a line, and we can use the gpu fast path |
| 45 int fNumFastPathDashEffects; |
| 46 // This field is incremented every time an anti-aliased drawPath call is |
| 47 // issued with a concave path |
| 48 int fNumAAConcavePaths; |
| 49 // This field is incremented every time a drawPath call is |
| 50 // issued for a hairline stroked concave path. |
| 51 int fNumAAHairlineConcavePaths; |
| 52 }; |
| 53 |
| 54 #endif |
OLD | NEW |