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

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

Issue 6529037: Rename ProcessPaint to Paint() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 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 | « views/widget/root_view.cc ('k') | views/widget/root_view_win.cc » ('j') | 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 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 24 matching lines...) Expand all
35 XSync(ui::GetXDisplay(), false /* don't discard events */); 35 XSync(ui::GetXDisplay(), false /* don't discard events */);
36 } 36 }
37 gfx::Rect scheduled_dirty_rect = GetScheduledPaintRectConstrainedToSize(); 37 gfx::Rect scheduled_dirty_rect = GetScheduledPaintRectConstrainedToSize();
38 gfx::Rect expose_rect = gfx::Rect(event->area); 38 gfx::Rect expose_rect = gfx::Rect(event->area);
39 gfx::CanvasSkiaPaint canvas(event); 39 gfx::CanvasSkiaPaint canvas(event);
40 bool invoked_process_paint = false; 40 bool invoked_process_paint = false;
41 if (!canvas.is_empty()) { 41 if (!canvas.is_empty()) {
42 canvas.set_composite_alpha(widget->is_transparent()); 42 canvas.set_composite_alpha(widget->is_transparent());
43 SchedulePaintInRect(gfx::Rect(canvas.rectangle()), false); 43 SchedulePaintInRect(gfx::Rect(canvas.rectangle()), false);
44 if (NeedsPainting(false)) { 44 if (NeedsPainting(false)) {
45 ProcessPaint(&canvas); 45 Paint(&canvas);
46 invoked_process_paint = true; 46 invoked_process_paint = true;
47 } 47 }
48 } 48 }
49 49
50 if (invoked_process_paint && !scheduled_dirty_rect.IsEmpty() && 50 if (invoked_process_paint && !scheduled_dirty_rect.IsEmpty() &&
51 !expose_rect.Contains(scheduled_dirty_rect) && widget && 51 !expose_rect.Contains(scheduled_dirty_rect) && widget &&
52 !widget->in_paint_now()) { 52 !widget->in_paint_now()) {
53 // We're painting as the result of Gtk wanting us to paint (not from views) 53 // We're painting as the result of Gtk wanting us to paint (not from views)
54 // and there was a region scheduled by views to be painted that is not 54 // and there was a region scheduled by views to be painted that is not
55 // contained in the region gtk wants us to paint. As a result of the 55 // contained in the region gtk wants us to paint. As a result of the
56 // ProcessPaint call above views no longer thinks it needs to be painted. 56 // Paint() call above views no longer thinks it needs to be painted.
57 // We have to invoke SchedulePaint here to be sure we end up painting the 57 // We have to invoke SchedulePaint here to be sure we end up painting the
58 // region views wants to paint, otherwise we'll drop the views paint region 58 // region views wants to paint, otherwise we'll drop the views paint region
59 // on the floor. 59 // on the floor.
60 // 60 //
61 // NOTE: We don't expand the region to paint to include 61 // NOTE: We don't expand the region to paint to include
62 // scheduled_dirty_rect as that results in us drawing on top of any GTK 62 // scheduled_dirty_rect as that results in us drawing on top of any GTK
63 // widgets that don't have a window. We have to schedule the paint through 63 // widgets that don't have a window. We have to schedule the paint through
64 // GTK so that such widgets are painted. 64 // GTK so that such widgets are painted.
65 SchedulePaintInRect(scheduled_dirty_rect, false); 65 SchedulePaintInRect(scheduled_dirty_rect, false);
66 } 66 }
67 } 67 }
68 68
69 void RootView::StartDragForViewFromMouseEvent( 69 void RootView::StartDragForViewFromMouseEvent(
70 View* view, 70 View* view,
71 const OSExchangeData& data, 71 const OSExchangeData& data,
72 int operation) { 72 int operation) {
73 // NOTE: view may be null. 73 // NOTE: view may be null.
74 drag_view_ = view; 74 drag_view_ = view;
75 static_cast<WidgetGtk*>(GetWidget())->DoDrag(data, operation); 75 static_cast<WidgetGtk*>(GetWidget())->DoDrag(data, operation);
76 // If the view is removed during the drag operation, drag_view_ is set to 76 // If the view is removed during the drag operation, drag_view_ is set to
77 // NULL. 77 // NULL.
78 if (view && drag_view_ == view) { 78 if (view && drag_view_ == view) {
79 View* drag_view = drag_view_; 79 View* drag_view = drag_view_;
80 drag_view_ = NULL; 80 drag_view_ = NULL;
81 drag_view->OnDragDone(); 81 drag_view->OnDragDone();
82 } 82 }
83 } 83 }
84 84
85 } 85 }
OLDNEW
« no previous file with comments | « views/widget/root_view.cc ('k') | views/widget/root_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698