diff options
author | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-13 23:59:14 +0000 |
---|---|---|
committer | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-13 23:59:14 +0000 |
commit | 046a230ecb3236086aba08f2d558ea87c28c0ac3 (patch) | |
tree | 7b2ae562c20726ea0fd96405e3c9b3d19c12bcd8 /skia/ext/analysis_canvas.h | |
parent | f7394b04b54261f8a53e652f6f89f7a9c79e782f (diff) | |
download | chromium_src-046a230ecb3236086aba08f2d558ea87c28c0ac3.zip chromium_src-046a230ecb3236086aba08f2d558ea87c28c0ac3.tar.gz chromium_src-046a230ecb3236086aba08f2d558ea87c28c0ac3.tar.bz2 |
Revert 234641 "cc: Combine analysis and raster"
This breaks rasterization. Reverting to investigate.
> cc: Combine analysis and raster
>
> This changes the analysis of PicturePiles from optimistic (hoping to
> save raster work by checking if a rastered bitmap would be a solid
> color) to pessimistic (assuming most bitmaps are not solid colors and
> just checking afterwards). It does this by rastering to both an
> AnalysisCanvas and a normal SkCanvas via SkNWayCanvas and then
> checking the results afterwards.
>
> R=reveman@chromium.org, senorblanco@chromium.org
> BUG=310796
>
> Review URL: https://codereview.chromium.org/63443003
TBR=enne@chromium.org, senorblanco@chromium.org
BUG=318782
Review URL: https://codereview.chromium.org/62103012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234962 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/analysis_canvas.h')
-rw-r--r-- | skia/ext/analysis_canvas.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/skia/ext/analysis_canvas.h b/skia/ext/analysis_canvas.h index 00fadac..909a198 100644 --- a/skia/ext/analysis_canvas.h +++ b/skia/ext/analysis_canvas.h @@ -20,15 +20,18 @@ 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 { +class SK_API AnalysisCanvas : public SkCanvas, public SkDrawPictureCallback { public: - explicit AnalysisCanvas(AnalysisDevice* device); + AnalysisCanvas(AnalysisDevice*); 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, @@ -60,9 +63,6 @@ class SK_API AnalysisCanvas : public SkCanvas { // 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,8 +72,6 @@ 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; @@ -159,7 +157,6 @@ 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_; |