diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-17 21:52:11 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-17 21:52:11 +0000 |
commit | 6fa9fa1116bfe9f55835fb1586f76ae23a77161f (patch) | |
tree | 5a454b93483ac53a6ac3ccba3f4768a8ebd1ae1e /ui/gfx | |
parent | 86dd17c3a84074f250d91ccff80d776ddba134ee (diff) | |
download | chromium_src-6fa9fa1116bfe9f55835fb1586f76ae23a77161f.zip chromium_src-6fa9fa1116bfe9f55835fb1586f76ae23a77161f.tar.gz chromium_src-6fa9fa1116bfe9f55835fb1586f76ae23a77161f.tar.bz2 |
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
Diffstat (limited to 'ui/gfx')
-rw-r--r-- | ui/gfx/brush.h | 24 | ||||
-rw-r--r-- | ui/gfx/canvas.cc | 33 | ||||
-rw-r--r-- | ui/gfx/canvas.h | 3 |
3 files changed, 0 insertions, 60 deletions
diff --git a/ui/gfx/brush.h b/ui/gfx/brush.h deleted file mode 100644 index d6e92af..0000000 --- a/ui/gfx/brush.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef UI_GFX_BRUSH_H_ -#define UI_GFX_BRUSH_H_ -#pragma once - -namespace gfx { - -// An object that encapsulates a platform native brush. -// Subclasses handle memory management of the underlying native brush. -class Brush { - public: - Brush() {} - virtual ~Brush() {} - - private: - DISALLOW_COPY_AND_ASSIGN(Brush); -}; - -} // namespace gfx - -#endif // UI_GFX_BRUSH_H_ 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<const SkiaShader*>(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); } diff --git a/ui/gfx/canvas.h b/ui/gfx/canvas.h index 4c21642..d266cdd 100644 --- a/ui/gfx/canvas.h +++ b/ui/gfx/canvas.h @@ -184,9 +184,6 @@ class UI_EXPORT Canvas { const SkColor& color, SkXfermode::Mode mode); - // Fills |rect| with the specified |brush|. - void FillRect(const gfx::Rect& rect, const gfx::Brush* brush); - // Draws a single pixel rect in the specified region with the specified // color, using a transfer mode of SkXfermode::kSrcOver_Mode. // |