summaryrefslogtreecommitdiffstats
path: root/ui/gfx/canvas_skia.cc
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-25 02:45:21 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-25 02:45:21 +0000
commit27488c22fe34d431fa34576032d8a0fc92b61572 (patch)
tree1f3d7e4462dc50196ae294767f7be70a5f44fb9e /ui/gfx/canvas_skia.cc
parent4b16ba30c174bcda4879df8f826f046c0120417e (diff)
downloadchromium_src-27488c22fe34d431fa34576032d8a0fc92b61572.zip
chromium_src-27488c22fe34d431fa34576032d8a0fc92b61572.tar.gz
chromium_src-27488c22fe34d431fa34576032d8a0fc92b61572.tar.bz2
ui/gfx: Convert Canvas::DrawFocusRect() to use gfx::Rect.
BUG=100898 R=pkasting@chromium.org Review URL: http://codereview.chromium.org/8359029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107050 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/canvas_skia.cc')
-rw-r--r--ui/gfx/canvas_skia.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/ui/gfx/canvas_skia.cc b/ui/gfx/canvas_skia.cc
index c93dd09..4e481ef 100644
--- a/ui/gfx/canvas_skia.cc
+++ b/ui/gfx/canvas_skia.cc
@@ -181,7 +181,7 @@ void CanvasSkia::DrawLineInt(const SkColor& color,
SkIntToScalar(y2), paint);
}
-void CanvasSkia::DrawFocusRect(int x, int y, int width, int height) {
+void CanvasSkia::DrawFocusRect(const gfx::Rect& rect) {
// Create a 2D bitmap containing alternating on/off pixels - we do this
// so that you never get two pixels of the same color around the edges
// of the focus rect (this may mean that opposing edges of the rect may
@@ -206,8 +206,6 @@ void CanvasSkia::DrawFocusRect(int x, int y, int width, int height) {
}
}
- // First the horizontal lines.
-
// Make a shader for the bitmap with an origin of the box we'll draw. This
// shader is refcounted and will have an initial refcount of 1.
SkShader* shader = SkShader::CreateBitmapShader(
@@ -219,10 +217,10 @@ void CanvasSkia::DrawFocusRect(int x, int y, int width, int height) {
paint.setShader(shader);
shader->unref();
- DrawRectInt(x, y, width, 1, paint);
- DrawRectInt(x, y + height - 1, width, 1, paint);
- DrawRectInt(x, y, 1, height, paint);
- DrawRectInt(x + width - 1, y, 1, height, paint);
+ DrawRectInt(rect.x(), rect.y(), rect.width(), 1, paint);
+ DrawRectInt(rect.x(), rect.y() + rect.height() - 1, rect.width(), 1, paint);
+ DrawRectInt(rect.x(), rect.y(), 1, rect.height(), paint);
+ DrawRectInt(rect.x() + rect.width() - 1, rect.y(), 1, rect.height(), paint);
}
void CanvasSkia::DrawBitmapInt(const SkBitmap& bitmap, int x, int y) {