Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Unified Diff: src/core/SkPictureContentInfo.h

Issue 464433002: Add layer counting to SkPictureRecord (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix bug Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkPictureContentInfo.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPictureContentInfo.h
diff --git a/src/core/SkPictureContentInfo.h b/src/core/SkPictureContentInfo.h
index cfeedcf48312317ca0c4684b7cb536c5c78aa297..d4d1d4fc5f76af0cde01bf59ceb4253f9c13c05e 100644
--- a/src/core/SkPictureContentInfo.h
+++ b/src/core/SkPictureContentInfo.h
@@ -17,6 +17,11 @@ public:
int numOperations() const { return fNumOperations; }
bool hasText() const { return fNumTexts > 0; }
+
+ int numLayers() const { return fNumLayers; }
+ int numInteriorLayers() const { return fNumInteriorLayers; }
+ int numLeafLayers() const { return fNumLeafLayers; }
+
bool suitableForGpuRasterization(GrContext* context, const char **reason,
int sampleCount) const;
@@ -27,6 +32,12 @@ public:
void onAddPaintPtr(const SkPaint* paint);
void onDrawText() { ++fNumTexts; }
+ void onSaveLayer();
+ void onSave();
+ void onRestore();
+ void rescindLastSave();
+ void rescindLastSaveLayer();
+
void set(const SkPictureContentInfo& src);
void reset();
void swap(SkPictureContentInfo* other);
@@ -49,6 +60,25 @@ private:
// This field is incremented every time a drawPath call is
// issued for a hairline stroked concave path.
int fNumAAHairlineConcavePaths;
+ // These fields track the different layer flavors. fNumLayers is just
+ // a count of all saveLayers, fNumInteriorLayers is the number of layers
+ // with a layer inside them, fNumLeafLayers is the number of layers with
+ // no layer inside them.
+ int fNumLayers;
+ int fNumInteriorLayers;
+ int fNumLeafLayers;
+
+ enum Flags {
+ kSave_Flag = 0x1,
+ kSaveLayer_Flag = 0x2,
+
+ // Did the current save or saveLayer contain another saveLayer.
+ // Percolated back down the save stack.
+ kContainedSaveLayer_Flag = 0x4
+ };
+
+ // Stack of save vs saveLayer information to track nesting
+ SkTDArray<uint32_t> fSaveStack;
};
#endif
« no previous file with comments | « no previous file | src/core/SkPictureContentInfo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698