Index: include/core/SkPicture.h |
=================================================================== |
--- include/core/SkPicture.h (revision 14349) |
+++ include/core/SkPicture.h (working copy) |
@@ -364,6 +364,67 @@ |
SkAutoTUnref<SkPathHeap> fPathHeap; // reference counted |
+ // ContentInfo is not serialized! It is intended solely for use |
+ // with suitableForGpuRasterization. |
+ class ContentInfo { |
+ public: |
+ ContentInfo() { this->reset(); } |
+ |
+ ContentInfo(const ContentInfo& src) { this->set(src); } |
+ |
+ void set(const ContentInfo& src) { |
+ fNumPaintWithPathEffectUses = src.fNumPaintWithPathEffectUses; |
+ fNumAAConcavePaths = src.fNumAAConcavePaths; |
+ fNumAAHairlineConcavePaths = src.fNumAAHairlineConcavePaths; |
+ } |
+ |
+ void reset() { |
+ fNumPaintWithPathEffectUses = 0; |
+ fNumAAConcavePaths = 0; |
+ fNumAAHairlineConcavePaths = 0; |
+ } |
+ |
+ void swap(ContentInfo* other) { |
+ SkTSwap(fNumPaintWithPathEffectUses, other->fNumPaintWithPathEffectUses); |
+ SkTSwap(fNumAAConcavePaths, other->fNumAAConcavePaths); |
+ SkTSwap(fNumAAHairlineConcavePaths, other->fNumAAHairlineConcavePaths); |
+ } |
+ |
+ // This field is incremented every time a paint with a path effect is |
+ // used (i.e., it is not a de-duplicated count) |
+ int fNumPaintWithPathEffectUses; |
+ // This field is incremented every time an anti-aliased drawPath call is |
+ // issued with a concave path |
+ int fNumAAConcavePaths; |
+ // This field is incremented every time a drawPath call is |
+ // issued for a hairline stroked concave path. |
+ int fNumAAHairlineConcavePaths; |
+ }; |
+ |
+ ContentInfo fContentInfo; |
+ |
+ void incPaintWithPathEffectUses() { |
+ ++fContentInfo.fNumPaintWithPathEffectUses; |
+ } |
+ int numPaintWithPathEffectUses() const { |
+ return fContentInfo.fNumPaintWithPathEffectUses; |
+ } |
+ |
+ void incAAConcavePaths() { |
+ ++fContentInfo.fNumAAConcavePaths; |
+ } |
+ int numAAConcavePaths() const { |
+ return fContentInfo.fNumAAConcavePaths; |
+ } |
+ |
+ void incAAHairlineConcavePaths() { |
+ ++fContentInfo.fNumAAHairlineConcavePaths; |
+ SkASSERT(fContentInfo.fNumAAHairlineConcavePaths <= fContentInfo.fNumAAConcavePaths); |
+ } |
+ int numAAHairlineConcavePaths() const { |
+ return fContentInfo.fNumAAHairlineConcavePaths; |
+ } |
+ |
const SkPath& getPath(int index) const; |
int addPathToHeap(const SkPath& path); |