From 6fa9fa1116bfe9f55835fb1586f76ae23a77161f Mon Sep 17 00:00:00 2001 From: "tfarina@chromium.org" Date: Sat, 17 Mar 2012 21:52:11 +0000 Subject: ui/gfx: Kill Canvas::FillRect() function that takes gfx::Brush. BUG=100898 R=pkasting@chromium.org TBR=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/9718014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127376 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/gfx/canvas.cc | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'ui/gfx/canvas.cc') diff --git a/ui/gfx/canvas.cc b/ui/gfx/canvas.cc index 68087ba..7ea77d9 100644 --- a/ui/gfx/canvas.cc +++ b/ui/gfx/canvas.cc @@ -10,7 +10,6 @@ #include "base/logging.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/effects/SkGradientShader.h" -#include "ui/gfx/brush.h" #include "ui/gfx/canvas.h" #include "ui/gfx/font.h" #include "ui/gfx/rect.h" @@ -21,30 +20,6 @@ #include "ui/gfx/canvas_skia_paint.h" #endif -namespace { - -// A platform wrapper for a Skia shader that makes sure the underlying -// SkShader object is unref'ed when this object is destroyed. -class SkiaShader : public gfx::Brush { - public: - explicit SkiaShader(SkShader* shader) : shader_(shader) { - } - virtual ~SkiaShader() { - shader_->unref(); - } - - // Accessor for shader, so it can be associated with a SkPaint. - SkShader* shader() const { return shader_; } - - private: - SkShader* shader_; - - DISALLOW_COPY_AND_ASSIGN(SkiaShader); -}; - - -} // namespace - namespace gfx { Canvas::Canvas(const gfx::Size& size, bool is_opaque) @@ -194,14 +169,6 @@ void Canvas::FillRect(const gfx::Rect& rect, DrawRect(rect, paint); } -void Canvas::FillRect(const gfx::Rect& rect, const gfx::Brush* brush) { - const SkiaShader* shader = static_cast(brush); - SkPaint paint; - paint.setShader(shader->shader()); - // TODO(beng): set shader transform to match canvas transform. - DrawRect(rect, paint); -} - void Canvas::DrawRect(const gfx::Rect& rect, const SkColor& color) { DrawRect(rect, color, SkXfermode::kSrcOver_Mode); } -- cgit v1.1