diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-17 19:33:09 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-17 19:33:09 +0000 |
commit | 0a1d36b22de76ac7d8e0af2efb222c5ae85d099b (patch) | |
tree | f3c3a1bb493dd98baaec6489dcc3b35eb93694da /chrome/views/view.cc | |
parent | 251b16cffbfca46fd038b13c702d9309d0948eb0 (diff) | |
download | chromium_src-0a1d36b22de76ac7d8e0af2efb222c5ae85d099b.zip chromium_src-0a1d36b22de76ac7d8e0af2efb222c5ae85d099b.tar.gz chromium_src-0a1d36b22de76ac7d8e0af2efb222c5ae85d099b.tar.bz2 |
Convert SchedulePaint and a few other methods to use gfx types.
http://crbug.com/2186
Review URL: http://codereview.chromium.org/7468
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3550 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/view.cc')
-rw-r--r-- | chrome/views/view.cc | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/chrome/views/view.cc b/chrome/views/view.cc index 2b6c7cd..285aed7 100644 --- a/chrome/views/view.cc +++ b/chrome/views/view.cc @@ -159,9 +159,8 @@ gfx::Rect View::GetLocalBounds(bool include_border) const { width() - insets.width(), height() - insets.height()); } -void View::GetPosition(CPoint* p) const { - p->x = GetX(APPLY_MIRRORING_TRANSFORMATION); - p->y = y(); +gfx::Point View::GetPosition() const { + return gfx::Point(GetX(APPLY_MIRRORING_TRANSFORMATION), y()); } gfx::Size View::GetPreferredSize() { @@ -317,29 +316,25 @@ void View::SetHotTracked(bool flag) { // ///////////////////////////////////////////////////////////////////////////// -void View::SchedulePaint(const CRect& r, bool urgent) { - if (!IsVisible()) { +void View::SchedulePaint(const gfx::Rect& r, bool urgent) { + if (!IsVisible()) return; - } if (parent_) { // Translate the requested paint rect to the parent's coordinate system // then pass this notification up to the parent. - CRect paint_rect(r); - CPoint p; - GetPosition(&p); - paint_rect.OffsetRect(p); + gfx::Rect paint_rect = r; + paint_rect.Offset(GetPosition()); parent_->SchedulePaint(paint_rect, urgent); } } void View::SchedulePaint() { - SchedulePaint(GetLocalBounds(true).ToRECT(), false); + SchedulePaint(GetLocalBounds(true), false); } void View::SchedulePaint(int x, int y, int w, int h) { - CRect r(x, y, x + w, y + h); - SchedulePaint(&r, false); + SchedulePaint(gfx::Rect(x, y, w, h), false); } void View::Paint(ChromeCanvas* canvas) { @@ -1506,7 +1501,7 @@ bool View::GetTooltipText(int x, int y, std::wstring* tooltip) { return false; } -bool View::GetTooltipTextOrigin(int x, int y, CPoint* loc) { +bool View::GetTooltipTextOrigin(int x, int y, gfx::Point* loc) { return false; } |