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

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: win warning fix Created 7 years, 9 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 | « content/renderer/gpu/render_widget_compositor.cc ('k') | skia/ext/analysis_canvas.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/analysis_canvas.h
diff --git a/skia/ext/analysis_canvas.h b/skia/ext/analysis_canvas.h
index e2eedd2fddd121f3209682b35a240278b3b4a736..fd7ee25c56863a8973738de99e4ec9364425967a 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,17 @@ 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;
+ static const int kNoLayer;
+
+ int savedStackSize_;
+ int forceNotSolidStackLevel_;
+ int forceNotTransparentStackLevel_;
};
class SK_API AnalysisDevice : public SkDevice {
@@ -52,6 +63,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 +121,12 @@ class SK_API AnalysisDevice : public SkDevice {
private:
typedef SkDevice INHERITED;
+
+ bool isForcedNotSolid_;
+ bool isForcedNotTransparent_;
+ bool isSolidColor_;
+ SkColor color_;
+ bool isTransparent_;
};
} // namespace skia
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.cc ('k') | skia/ext/analysis_canvas.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698