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

Side by Side Diff: base/message_pump_gtk.cc

Issue 10078018: Final(?) eradications of GDK / GTK from the GPU process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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 | content/gpu/gpu_main.cc » ('j') | content/gpu/gpu_main.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/message_pump_gtk.h" 5 #include "base/message_pump_gtk.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 #include <gdk/gdkx.h> 8 #include <gdk/gdkx.h>
9 9
10 #include "base/profiler/scoped_profile.h" 10 #include "base/profiler/scoped_profile.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 MessagePumpDispatcher* dispatcher = GetDispatcher(); 79 MessagePumpDispatcher* dispatcher = GetDispatcher();
80 if (!dispatcher) 80 if (!dispatcher)
81 gtk_main_do_event(event); 81 gtk_main_do_event(event);
82 else if (!dispatcher->Dispatch(event)) 82 else if (!dispatcher->Dispatch(event))
83 Quit(); 83 Quit();
84 84
85 DidProcessEvent(event); 85 DidProcessEvent(event);
86 } 86 }
87 87
88 // static 88 // static
89 Display* MessagePumpGtk::GetDefaultXDisplay() { 89 Display* MessagePumpGtk::GetDefaultXDisplay() {
darin (slow to review) 2012/04/23 16:52:57 why do we need to involve a class named *Gtk in co
90 static GdkDisplay* display = gdk_display_get_default(); 90 static GdkDisplay* display = gdk_display_get_default();
91 return display ? GDK_DISPLAY_XDISPLAY(display) : NULL; 91 if (!display) {
92 // GTK / GDK has not been initialized, which is a decision we wish to
93 // support, for example for the GPU process.
94 static Display* xdisplay = XOpenDisplay(NULL);
95 return xdisplay;
96 }
97 return GDK_DISPLAY_XDISPLAY(display);
92 } 98 }
93 99
94 void MessagePumpGtk::WillProcessEvent(GdkEvent* event) { 100 void MessagePumpGtk::WillProcessEvent(GdkEvent* event) {
95 FOR_EACH_OBSERVER(MessagePumpObserver, observers(), WillProcessEvent(event)); 101 FOR_EACH_OBSERVER(MessagePumpObserver, observers(), WillProcessEvent(event));
96 } 102 }
97 103
98 void MessagePumpGtk::DidProcessEvent(GdkEvent* event) { 104 void MessagePumpGtk::DidProcessEvent(GdkEvent* event) {
99 FOR_EACH_OBSERVER(MessagePumpObserver, observers(), DidProcessEvent(event)); 105 FOR_EACH_OBSERVER(MessagePumpObserver, observers(), DidProcessEvent(event));
100 } 106 }
101 107
102 // static 108 // static
103 void MessagePumpGtk::EventDispatcher(GdkEvent* event, gpointer data) { 109 void MessagePumpGtk::EventDispatcher(GdkEvent* event, gpointer data) {
104 MessagePumpGtk* message_pump = reinterpret_cast<MessagePumpGtk*>(data); 110 MessagePumpGtk* message_pump = reinterpret_cast<MessagePumpGtk*>(data);
105 message_pump->DispatchEvents(event); 111 message_pump->DispatchEvents(event);
106 } 112 }
107 113
108 } // namespace base 114 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | content/gpu/gpu_main.cc » ('j') | content/gpu/gpu_main.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698