Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Side by Side Diff: views/widget/root_view_gtk.cc

Issue 147170: Fixes bug in RootViewGtk where we we might not paint correctly if... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "views/widget/root_view.h" 5 #include "views/widget/root_view.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include "app/gfx/canvas_paint.h" 9 #include "app/gfx/canvas_paint.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "views/widget/widget_gtk.h" 11 #include "views/widget/widget_gtk.h"
12 12
13 namespace views { 13 namespace views {
14 14
15 void RootView::OnPaint(GdkEventExpose* event) { 15 void RootView::OnPaint(GdkEventExpose* event) {
16 gfx::Rect original_dirty_region = GetScheduledPaintRectConstrainedToSize();
17 if (!original_dirty_region.IsEmpty()) {
18 // Between the the time the paint was scheduled and the time we end
19 // up painting more SchedulePaints may have been invoked. Expand the
20 // region Gdk wants us to paint to include the region we want to paint
21 // to make sure everything is painted. Otherwise we may not paint
22 // everything we need to.
23 gfx::Rect complete_area =
24 original_dirty_region.Union(gfx::Rect(event->area));
25 event->area = complete_area.ToGdkRectangle();
26 }
27
16 gfx::CanvasPaint canvas(event); 28 gfx::CanvasPaint canvas(event);
17
18 if (!canvas.is_empty()) { 29 if (!canvas.is_empty()) {
19 canvas.set_composite_alpha( 30 canvas.set_composite_alpha(
20 static_cast<WidgetGtk*>(GetWidget())->is_transparent()); 31 static_cast<WidgetGtk*>(GetWidget())->is_transparent());
21 SchedulePaint(gfx::Rect(canvas.rectangle()), false); 32 SchedulePaint(gfx::Rect(canvas.rectangle()), false);
22 if (NeedsPainting(false)) { 33 if (NeedsPainting(false)) {
23 ProcessPaint(&canvas); 34 ProcessPaint(&canvas);
24 } 35 }
25 } 36 }
26 } 37 }
27 38
28 } 39 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698