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

Unified Diff: skia/ext/analysis_canvas.h

Issue 63443003: cc: Combine analysis and raster (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Chunk mismatch Created 7 years, 1 month 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 78d72ff9381ff5a5974708e81ac47ab152915777..5cbb5d79bb284971fbaa8df3aaea81fd99d34c91 100644
--- a/skia/ext/analysis_canvas.h
+++ b/skia/ext/analysis_canvas.h
@@ -20,18 +20,15 @@ class AnalysisDevice;
// To use: create a SkBitmap with kNo_Config, create an AnalysisDevice
// using that bitmap, and create an AnalysisCanvas using the device.
// Play a picture into the canvas, and then check result.
-class SK_API AnalysisCanvas : public SkCanvas, public SkDrawPictureCallback {
+class SK_API AnalysisCanvas : public SkCanvas {
public:
- AnalysisCanvas(AnalysisDevice*);
+ explicit AnalysisCanvas(AnalysisDevice* device);
virtual ~AnalysisCanvas();
// Returns true when a SkColor can be used to represent result.
bool GetColorIfSolid(SkColor* color) const;
bool HasText() const;
- // SkDrawPictureCallback override.
- virtual bool abortDrawing() OVERRIDE;
-
// SkCanvas overrides.
virtual bool clipRect(const SkRect& rect,
SkRegion::Op op = SkRegion::kIntersect_Op,
@@ -63,6 +60,9 @@ class SK_API AnalysisCanvas : public SkCanvas, public SkDrawPictureCallback {
// to be derived from SkBaseDevice (rather than SkBitmapDevice)
class SK_API AnalysisDevice : public SkBitmapDevice {
public:
+ // |analysis_rect| is in device space.
+ AnalysisDevice(const SkBitmap& bitmap, SkRect analysis_rect);
+ // Analyze the entire bitmap.
AnalysisDevice(const SkBitmap& bitmap);
virtual ~AnalysisDevice();
@@ -72,6 +72,8 @@ class SK_API AnalysisDevice : public SkBitmapDevice {
void SetForceNotSolid(bool flag);
void SetForceNotTransparent(bool flag);
+ SkRect AnalysisRect() const { return analysis_rect_; }
+
protected:
// SkBaseDevice overrides.
virtual void clear(SkColor color) OVERRIDE;
@@ -154,6 +156,7 @@ class SK_API AnalysisDevice : public SkBitmapDevice {
private:
typedef SkBitmapDevice INHERITED;
+ SkRect analysis_rect_;
bool is_forced_not_solid_;
bool is_forced_not_transparent_;
bool is_solid_color_;

Powered by Google App Engine
This is Rietveld 408576698