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

Unified Diff: skia/ext/analysis_canvas.h

Issue 12316084: cc: Consolidate the analysis_canvas operations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed unittest Created 7 years, 10 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
Index: skia/ext/analysis_canvas.h
diff --git a/skia/ext/analysis_canvas.h b/skia/ext/analysis_canvas.h
index e2eedd2fddd121f3209682b35a240278b3b4a736..f7787cb940f4e2bd3142559ce7073bc343a5b468 100644
--- a/skia/ext/analysis_canvas.h
+++ b/skia/ext/analysis_canvas.h
@@ -26,6 +26,8 @@ class SK_API AnalysisCanvas : public SkCanvas {
// Returns true if the estimated cost of drawing is below an
// arbitrary threshold.
bool isCheap() const;
+ bool getColorIfSolid(SkColor* color) const;
+ bool isTransparent() const;
// Returns the estimated cost of drawing, in arbitrary units.
int getEstimatedCost() const;
@@ -42,8 +44,14 @@ class SK_API AnalysisCanvas : public SkCanvas {
virtual int saveLayer(const SkRect* bounds, const SkPaint*,
SkCanvas::SaveFlags flags) OVERRIDE;
+ virtual int save(SaveFlags flags = kMatrixClip_SaveFlag) OVERRIDE;
+
+ virtual void restore() OVERRIDE;
+
private:
typedef SkCanvas INHERITED;
+
+ int savedLayerStackSize_;
};
class SK_API AnalysisDevice : public SkDevice {
@@ -52,6 +60,11 @@ class SK_API AnalysisDevice : public SkDevice {
virtual ~AnalysisDevice();
int getEstimatedCost() const;
+ bool getColorIfSolid(SkColor* color) const;
+ bool isTransparent() const;
+
+ void setForceNotSolid(bool flag);
+ void setForceNotTransparent(bool flag);
protected:
virtual void clear(SkColor color) OVERRIDE;
@@ -105,6 +118,12 @@ class SK_API AnalysisDevice : public SkDevice {
private:
typedef SkDevice INHERITED;
+
+ bool isForcedNotSolid_;
+ bool isForcedNotTransparent_;
+ bool isSolidColor_;
+ SkColor color_;
+ bool isTransparent_;
};
} // namespace skia

Powered by Google App Engine
This is Rietveld 408576698