diff options
-rw-r--r-- | chrome/browser/renderer_host/render_widget_host_view_views.cc | 4 | ||||
-rw-r--r-- | chrome/browser/ui/views/constrained_window_win.cc | 2 | ||||
-rw-r--r-- | chrome/browser/ui/views/download_shelf_view.cc | 2 | ||||
-rw-r--r-- | chrome/browser/ui/views/wrench_menu.cc | 4 | ||||
-rw-r--r-- | views/animation/bounds_animator.cc | 2 | ||||
-rw-r--r-- | views/animation/bounds_animator_unittest.cc | 2 | ||||
-rw-r--r-- | views/controls/menu/submenu_view.cc | 2 | ||||
-rw-r--r-- | views/controls/scroll_view.cc | 4 | ||||
-rw-r--r-- | views/controls/textfield/native_textfield_views.cc | 2 | ||||
-rw-r--r-- | views/view.cc | 12 | ||||
-rw-r--r-- | views/view.h | 11 | ||||
-rw-r--r-- | views/view_unittest.cc | 2 | ||||
-rw-r--r-- | views/widget/root_view.cc | 2 | ||||
-rw-r--r-- | views/widget/root_view.h | 2 | ||||
-rw-r--r-- | views/widget/root_view_gtk.cc | 4 | ||||
-rw-r--r-- | views/widget/root_view_win.cc | 2 | ||||
-rw-r--r-- | views/window/window_win.cc | 2 |
17 files changed, 30 insertions, 31 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host_view_views.cc b/chrome/browser/renderer_host/render_widget_host_view_views.cc index cd38138..df1dc20 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_views.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_views.cc @@ -442,7 +442,7 @@ void RenderWidgetHostViewViews::DidUpdateBackingStore( if (about_to_validate_and_paint_) invalid_rect_ = invalid_rect_.Union(scroll_rect); else - SchedulePaint(scroll_rect, false); + SchedulePaintInRect(scroll_rect, false); for (size_t i = 0; i < copy_rects.size(); ++i) { // Avoid double painting. NOTE: This is only relevant given the call to @@ -454,7 +454,7 @@ void RenderWidgetHostViewViews::DidUpdateBackingStore( if (about_to_validate_and_paint_) invalid_rect_ = invalid_rect_.Union(rect); else - SchedulePaint(rect, false); + SchedulePaintInRect(rect, false); } invalid_rect_ = invalid_rect_.Intersect(bounds()); } diff --git a/chrome/browser/ui/views/constrained_window_win.cc b/chrome/browser/ui/views/constrained_window_win.cc index 116a072..5827e52 100644 --- a/chrome/browser/ui/views/constrained_window_win.cc +++ b/chrome/browser/ui/views/constrained_window_win.cc @@ -278,7 +278,7 @@ ConstrainedWindowFrameView::~ConstrainedWindowFrameView() { } void ConstrainedWindowFrameView::UpdateWindowTitle() { - SchedulePaint(title_bounds_, false); + SchedulePaintInRect(title_bounds_, false); } //////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/browser/ui/views/download_shelf_view.cc b/chrome/browser/ui/views/download_shelf_view.cc index fa2fc37..1db8bd2 100644 --- a/chrome/browser/ui/views/download_shelf_view.cc +++ b/chrome/browser/ui/views/download_shelf_view.cc @@ -426,7 +426,7 @@ void DownloadShelfView::SchedulePaintForDownloadItem(views::View* view) { // Invalidate it gfx::Rect invalid_rect = GetFocusRectBounds(static_cast<DownloadItemView*>(view)); - SchedulePaint(invalid_rect, false); + SchedulePaintInRect(invalid_rect, false); } gfx::Rect DownloadShelfView::GetFocusRectBounds( diff --git a/chrome/browser/ui/views/wrench_menu.cc b/chrome/browser/ui/views/wrench_menu.cc index 8f769bd..710997a 100644 --- a/chrome/browser/ui/views/wrench_menu.cc +++ b/chrome/browser/ui/views/wrench_menu.cc @@ -231,12 +231,12 @@ class ScheduleAllView : public views::View { public: ScheduleAllView() {} - virtual void SchedulePaint(const gfx::Rect& r, bool urgent) { + virtual void SchedulePaintInRect(const gfx::Rect& r, bool urgent) { if (!IsVisible()) return; if (parent()) - parent()->SchedulePaint(GetMirroredBounds(), urgent); + parent()->SchedulePaintInRect(GetMirroredBounds(), urgent); } private: diff --git a/views/animation/bounds_animator.cc b/views/animation/bounds_animator.cc index a517854..20a6616 100644 --- a/views/animation/bounds_animator.cc +++ b/views/animation/bounds_animator.cc @@ -236,7 +236,7 @@ void BoundsAnimator::AnimationContainerProgressed( // Adjust for rtl. repaint_bounds_.set_x(parent_->GetMirroredXWithWidthInView( repaint_bounds_.x(), repaint_bounds_.width())); - parent_->SchedulePaint(repaint_bounds_, false); + parent_->SchedulePaintInRect(repaint_bounds_, false); repaint_bounds_.SetRect(0, 0, 0, 0); } diff --git a/views/animation/bounds_animator_unittest.cc b/views/animation/bounds_animator_unittest.cc index ba4b93b..7dc0f37 100644 --- a/views/animation/bounds_animator_unittest.cc +++ b/views/animation/bounds_animator_unittest.cc @@ -75,7 +75,7 @@ bool OwnedDelegate::canceled_ = false; class TestView : public views::View { public: TestView() {} - virtual void SchedulePaint(const gfx::Rect& r, bool urgent) { + virtual void SchedulePaintInRect(const gfx::Rect& r, bool urgent) { if (dirty_rect_.IsEmpty()) dirty_rect_ = r; else diff --git a/views/controls/menu/submenu_view.cc b/views/controls/menu/submenu_view.cc index 8a1f079..67486cd 100644 --- a/views/controls/menu/submenu_view.cc +++ b/views/controls/menu/submenu_view.cc @@ -351,7 +351,7 @@ void SubmenuView::SchedulePaintForDropIndicator( if (position == MenuDelegate::DROP_ON) { item->SchedulePaint(); } else if (position != MenuDelegate::DROP_NONE) { - SchedulePaint(CalculateDropIndicatorBounds(item, position), false); + SchedulePaintInRect(CalculateDropIndicatorBounds(item, position), false); } } diff --git a/views/controls/scroll_view.cc b/views/controls/scroll_view.cc index 05ab89f..707c8d6 100644 --- a/views/controls/scroll_view.cc +++ b/views/controls/scroll_view.cc @@ -346,7 +346,7 @@ void ScrollView::ScrollToPosition(ScrollBar* source, int position) { else if (position > max_pos) position = max_pos; contents_->SetX(-position); - contents_->SchedulePaint(contents_->GetVisibleBounds(), true); + contents_->SchedulePaintInRect(contents_->GetVisibleBounds(), true); } } else if (source == vert_sb_ && vert_sb_->IsVisible()) { int vh = viewport_->height(); @@ -359,7 +359,7 @@ void ScrollView::ScrollToPosition(ScrollBar* source, int position) { else if (position > max_pos) position = max_pos; contents_->SetY(-position); - contents_->SchedulePaint(contents_->GetVisibleBounds(), true); + contents_->SchedulePaintInRect(contents_->GetVisibleBounds(), true); } } } diff --git a/views/controls/textfield/native_textfield_views.cc b/views/controls/textfield/native_textfield_views.cc index 529fed1..0568eea 100644 --- a/views/controls/textfield/native_textfield_views.cc +++ b/views/controls/textfield/native_textfield_views.cc @@ -437,7 +437,7 @@ void NativeTextfieldViews::UpdateCursor() { void NativeTextfieldViews::RepaintCursor() { gfx::Rect r = cursor_bounds_; r.Inset(-1, -1, -1, -1); - SchedulePaint(r, false); + SchedulePaintInRect(r, false); } void NativeTextfieldViews::UpdateCursorBoundsAndTextOffset() { diff --git a/views/view.cc b/views/view.cc index d4ff9b1..94ce088 100644 --- a/views/view.cc +++ b/views/view.cc @@ -551,7 +551,11 @@ void View::ConvertPointToScreen(const View* src, gfx::Point* p) { // Painting -------------------------------------------------------------------- -void View::SchedulePaint(const gfx::Rect& r, bool urgent) { +void View::SchedulePaint() { + SchedulePaintInRect(GetLocalBounds(), false); +} + +void View::SchedulePaintInRect(const gfx::Rect& r, bool urgent) { if (!IsVisible()) return; @@ -560,14 +564,10 @@ void View::SchedulePaint(const gfx::Rect& r, bool urgent) { // then pass this notification up to the parent. gfx::Rect paint_rect = r; paint_rect.Offset(GetMirroredPosition()); - parent_->SchedulePaint(paint_rect, urgent); + parent_->SchedulePaintInRect(paint_rect, urgent); } } -void View::SchedulePaint() { - SchedulePaint(GetLocalBounds(), false); -} - void View::Paint(gfx::Canvas* canvas) { PaintBackground(canvas); PaintFocusBorder(canvas); diff --git a/views/view.h b/views/view.h index f8f331a..69c1d2c 100644 --- a/views/view.h +++ b/views/view.h @@ -474,14 +474,13 @@ class View : public AcceleratorTarget { // Painting ------------------------------------------------------------------ - // Mark the specified rectangle as dirty (needing repaint). If |urgent| is - // true, the view will be repainted when the current event processing is - // done. Otherwise, painting will take place as soon as possible. - virtual void SchedulePaint(const gfx::Rect& r, bool urgent); - - // Mark the entire View's bounds as dirty. Painting will occur as soon as + // Mark all or part of the View's bounds as dirty (needing repaint). + // |r| is in the View's coordinates. + // When |urgent| is true, the view will be repainted when the current event + // processing is done. Otherwise, painting will take place as soon as // possible. virtual void SchedulePaint(); + virtual void SchedulePaintInRect(const gfx::Rect& r, bool urgent); // Paint the receiving view. g is prepared such as it is in // receiver's coordinate system. g's state is restored after this diff --git a/views/view_unittest.cc b/views/view_unittest.cc index d50bac6..8733ffe 100644 --- a/views/view_unittest.cc +++ b/views/view_unittest.cc @@ -605,7 +605,7 @@ TEST_F(ViewTest, DISABLED_Painting) { v2->Reset(); v3->Reset(); v4->Reset(); - v3->SchedulePaint(gfx::Rect(10, 10, 10, 10), false); + v3->SchedulePaintInRect(gfx::Rect(10, 10, 10, 10), false); PaintRootView(root, empty_paint); SkRect tmp_rect; diff --git a/views/widget/root_view.cc b/views/widget/root_view.cc index 0a20f10..3a5ce87 100644 --- a/views/widget/root_view.cc +++ b/views/widget/root_view.cc @@ -136,7 +136,7 @@ void RootView::SetContentsView(View* contents_view) { // ///////////////////////////////////////////////////////////////////////////// -void RootView::SchedulePaint(const gfx::Rect& r, bool urgent) { +void RootView::SchedulePaintInRect(const gfx::Rect& r, bool urgent) { // If there is an existing invalid rect, add the union of the scheduled // rect with the invalid rect. This could be optimized further if // necessary. diff --git a/views/widget/root_view.h b/views/widget/root_view.h index 4a8f07f..680b8a5 100644 --- a/views/widget/root_view.h +++ b/views/widget/root_view.h @@ -54,7 +54,7 @@ class RootView : public View, // Layout and Painting functions // Overridden from View to implement paint scheduling. - virtual void SchedulePaint(const gfx::Rect& r, bool urgent); + virtual void SchedulePaintInRect(const gfx::Rect& r, bool urgent); // Convenience to schedule the whole view virtual void SchedulePaint(); diff --git a/views/widget/root_view_gtk.cc b/views/widget/root_view_gtk.cc index deffbe4..df10fd8 100644 --- a/views/widget/root_view_gtk.cc +++ b/views/widget/root_view_gtk.cc @@ -40,7 +40,7 @@ void RootView::OnPaint(GdkEventExpose* event) { bool invoked_process_paint = false; if (!canvas.is_empty()) { canvas.set_composite_alpha(widget->is_transparent()); - SchedulePaint(gfx::Rect(canvas.rectangle()), false); + SchedulePaintInRect(gfx::Rect(canvas.rectangle()), false); if (NeedsPainting(false)) { ProcessPaint(&canvas); invoked_process_paint = true; @@ -62,7 +62,7 @@ void RootView::OnPaint(GdkEventExpose* event) { // scheduled_dirty_rect as that results in us drawing on top of any GTK // widgets that don't have a window. We have to schedule the paint through // GTK so that such widgets are painted. - SchedulePaint(scheduled_dirty_rect, false); + SchedulePaintInRect(scheduled_dirty_rect, false); } } diff --git a/views/widget/root_view_win.cc b/views/widget/root_view_win.cc index 51f86a7..65691a6 100644 --- a/views/widget/root_view_win.cc +++ b/views/widget/root_view_win.cc @@ -29,7 +29,7 @@ void RootView::OnPaint(HWND hwnd) { scoped_ptr<gfx::CanvasPaint> canvas( gfx::CanvasPaint::CreateCanvasPaint(hwnd)); if (!canvas->IsValid()) { - SchedulePaint(canvas->GetInvalidRect(), false); + SchedulePaintInRect(canvas->GetInvalidRect(), false); if (NeedsPainting(false)) ProcessPaint(canvas->AsCanvas()); } diff --git a/views/window/window_win.cc b/views/window/window_win.cc index fdca1e9..44bb608 100644 --- a/views/window/window_win.cc +++ b/views/window/window_win.cc @@ -1072,7 +1072,7 @@ void WindowWin::OnNCPaint(HRGN rgn) { UnionRect(&dirty_region, &tmp, &old_paint_region_crect); } - root_view->SchedulePaint(gfx::Rect(dirty_region), false); + root_view->SchedulePaintInRect(gfx::Rect(dirty_region), false); // gfx::CanvasSkiaPaint's destructor does the actual painting. As such, wrap // the following in a block to force paint to occur so that we can release |