OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <dwmapi.h> | 8 #include <dwmapi.h> |
9 #include <windows.h> | 9 #include <windows.h> |
10 #endif | 10 #endif |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 // safely until the IPC channel is set up, because the detection of | 153 // safely until the IPC channel is set up, because the detection of |
154 // early return of a child process is implemented using an IPC | 154 // early return of a child process is implemented using an IPC |
155 // channel error. If the IPC channel is not fully set up between the | 155 // channel error. If the IPC channel is not fully set up between the |
156 // browser and GPU process, and the GPU process crashes or exits | 156 // browser and GPU process, and the GPU process crashes or exits |
157 // early, the browser process will never detect it. For this reason | 157 // early, the browser process will never detect it. For this reason |
158 // we defer tearing down the GPU process until receiving the | 158 // we defer tearing down the GPU process until receiving the |
159 // GpuMsg_Initialize message from the browser. | 159 // GpuMsg_Initialize message from the browser. |
160 bool dead_on_arrival = false; | 160 bool dead_on_arrival = false; |
161 | 161 |
162 #if defined(OS_WIN) | 162 #if defined(OS_WIN) |
163 base::MessageLoop::Type loop_type = base::MessageLoop::TYPE_IO; | |
164 // Use a UI message loop because ANGLE and the desktop GL platform can | 163 // Use a UI message loop because ANGLE and the desktop GL platform can |
165 // create child windows to render to. | 164 // create child windows to render to. |
166 // TODO(ananta) : Recent changes to the UI message pump class on Windows | 165 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI); |
167 // will cause delays in tasks getting processed in the GPU process which | |
168 // will show up on the bots in webgl conformance tests, perf tests etc. | |
169 // It will be great if we can work around the issues with desktop GL and | |
170 // avoid creating a child window in the GPU process which requires a UI | |
171 // message pump. | |
172 if ((command_line.HasSwitch(switches::kUseGL) && | |
173 command_line.GetSwitchValueASCII(switches::kUseGL) == "desktop") || | |
174 (command_line.HasSwitch(switches::kUseANGLE) && | |
175 command_line.GetSwitchValueASCII(switches::kUseANGLE) == "gl")) { | |
176 loop_type = base::MessageLoop::TYPE_UI; | |
177 } | |
178 base::MessageLoop main_message_loop(loop_type); | |
179 #elif defined(OS_LINUX) && defined(USE_X11) | 166 #elif defined(OS_LINUX) && defined(USE_X11) |
180 // We need a UI loop so that we can grab the Expose events. See GLSurfaceGLX | 167 // We need a UI loop so that we can grab the Expose events. See GLSurfaceGLX |
181 // and https://crbug.com/326995. | 168 // and https://crbug.com/326995. |
182 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI); | 169 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI); |
183 scoped_ptr<ui::PlatformEventSource> event_source = | 170 scoped_ptr<ui::PlatformEventSource> event_source = |
184 ui::PlatformEventSource::CreateDefault(); | 171 ui::PlatformEventSource::CreateDefault(); |
185 #elif defined(OS_LINUX) | 172 #elif defined(OS_LINUX) |
186 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_DEFAULT); | 173 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_DEFAULT); |
187 #elif defined(OS_MACOSX) | 174 #elif defined(OS_MACOSX) |
188 // This is necessary for CoreAnimation layers hosted in the GPU process to be | 175 // This is necessary for CoreAnimation layers hosted in the GPU process to be |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 return true; | 539 return true; |
553 } | 540 } |
554 | 541 |
555 return false; | 542 return false; |
556 } | 543 } |
557 #endif // defined(OS_WIN) | 544 #endif // defined(OS_WIN) |
558 | 545 |
559 } // namespace. | 546 } // namespace. |
560 | 547 |
561 } // namespace content | 548 } // namespace content |
OLD | NEW |