diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-26 04:36:11 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-26 04:36:11 +0000 |
commit | 69cefe5a49b26986323632736c8c898627dd33a0 (patch) | |
tree | ad7395ae1fabcbcfc02f320c2ae416e554a1e75b /views | |
parent | beb36b7f79a9ce774f0944b30eca91d2499bbeaa (diff) | |
download | chromium_src-69cefe5a49b26986323632736c8c898627dd33a0.zip chromium_src-69cefe5a49b26986323632736c8c898627dd33a0.tar.gz chromium_src-69cefe5a49b26986323632736c8c898627dd33a0.tar.bz2 |
Fixes bug in RootViewGtk where we we might not paint correctly if
SchedulePaint is invoked consecutively with different regions. Windows
has similar code.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/147170
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19338 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rwxr-xr-x | views/widget/root_view_gtk.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/views/widget/root_view_gtk.cc b/views/widget/root_view_gtk.cc index 1225efe..6984429 100755 --- a/views/widget/root_view_gtk.cc +++ b/views/widget/root_view_gtk.cc @@ -13,8 +13,19 @@ namespace views { void RootView::OnPaint(GdkEventExpose* event) { - gfx::CanvasPaint canvas(event); + gfx::Rect original_dirty_region = GetScheduledPaintRectConstrainedToSize(); + if (!original_dirty_region.IsEmpty()) { + // Between the the time the paint was scheduled and the time we end + // up painting more SchedulePaints may have been invoked. Expand the + // region Gdk wants us to paint to include the region we want to paint + // to make sure everything is painted. Otherwise we may not paint + // everything we need to. + gfx::Rect complete_area = + original_dirty_region.Union(gfx::Rect(event->area)); + event->area = complete_area.ToGdkRectangle(); + } + gfx::CanvasPaint canvas(event); if (!canvas.is_empty()) { canvas.set_composite_alpha( static_cast<WidgetGtk*>(GetWidget())->is_transparent()); |