diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-14 23:53:43 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-14 23:53:43 +0000 |
commit | a9a5fa93c3778eda06937fdb80767bde1169782a (patch) | |
tree | 1e236620656efc2c3802b6efeab2f65ae542dd3c /ui/views/painter.cc | |
parent | d82a35eca9a3486a3ba7a80cde7dbffd65dc9fb4 (diff) | |
download | chromium_src-a9a5fa93c3778eda06937fdb80767bde1169782a.zip chromium_src-a9a5fa93c3778eda06937fdb80767bde1169782a.tar.gz chromium_src-a9a5fa93c3778eda06937fdb80767bde1169782a.tar.bz2 |
views: Change Painter::PaintPainterAt to take a gfx::Rect instead of ints.
BUG=100898
R=pkasting@chromium.org,sky@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9361072
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121974 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/painter.cc')
-rw-r--r-- | ui/views/painter.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ui/views/painter.cc b/ui/views/painter.cc index ef5cfbf..6b23c37 100644 --- a/ui/views/painter.cc +++ b/ui/views/painter.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -12,6 +12,7 @@ #include "ui/gfx/canvas_skia.h" #include "ui/gfx/insets.h" #include "ui/gfx/point.h" +#include "ui/gfx/rect.h" namespace views { @@ -144,14 +145,13 @@ class ImagePainter : public Painter { } // namespace // static -void Painter::PaintPainterAt(int x, int y, int w, int h, - gfx::Canvas* canvas, Painter* painter) { +void Painter::PaintPainterAt(gfx::Canvas* canvas, + Painter* painter, + const gfx::Rect& rect) { DCHECK(canvas && painter); - if (w < 0 || h < 0) - return; canvas->Save(); - canvas->Translate(gfx::Point(x, y)); - painter->Paint(w, h, canvas); + canvas->Translate(rect.origin()); + painter->Paint(rect.width(), rect.height(), canvas); canvas->Restore(); } |