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

Side by Side Diff: content/gpu/gpu_main.cc

Issue 1097283005: Always use a UI message loop in the GPU process on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« 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) 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // safely until the IPC channel is set up, because the detection of 148 // safely until the IPC channel is set up, because the detection of
149 // early return of a child process is implemented using an IPC 149 // early return of a child process is implemented using an IPC
150 // channel error. If the IPC channel is not fully set up between the 150 // channel error. If the IPC channel is not fully set up between the
151 // browser and GPU process, and the GPU process crashes or exits 151 // browser and GPU process, and the GPU process crashes or exits
152 // early, the browser process will never detect it. For this reason 152 // early, the browser process will never detect it. For this reason
153 // we defer tearing down the GPU process until receiving the 153 // we defer tearing down the GPU process until receiving the
154 // GpuMsg_Initialize message from the browser. 154 // GpuMsg_Initialize message from the browser.
155 bool dead_on_arrival = false; 155 bool dead_on_arrival = false;
156 156
157 #if defined(OS_WIN) 157 #if defined(OS_WIN)
158 base::MessageLoop::Type message_loop_type = base::MessageLoop::TYPE_IO; 158 // Use a UI message loop because ANGLE and the desktop GL platform can
159 // Unless we're running on desktop GL, we don't need a UI message 159 // create child windows to render to.
160 // loop, so avoid its use to work around apparent problems with some 160 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI);
161 // third-party software.
162 if (command_line.HasSwitch(switches::kUseGL) &&
163 command_line.GetSwitchValueASCII(switches::kUseGL) ==
164 gfx::kGLImplementationDesktopName) {
165 message_loop_type = base::MessageLoop::TYPE_UI;
166 }
167 base::MessageLoop main_message_loop(message_loop_type);
168 #elif defined(OS_LINUX) && defined(USE_X11) 161 #elif defined(OS_LINUX) && defined(USE_X11)
169 // We need a UI loop so that we can grab the Expose events. See GLSurfaceGLX 162 // We need a UI loop so that we can grab the Expose events. See GLSurfaceGLX
170 // and https://crbug.com/326995. 163 // and https://crbug.com/326995.
171 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI); 164 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI);
172 scoped_ptr<ui::PlatformEventSource> event_source = 165 scoped_ptr<ui::PlatformEventSource> event_source =
173 ui::PlatformEventSource::CreateDefault(); 166 ui::PlatformEventSource::CreateDefault();
174 #elif defined(OS_LINUX) 167 #elif defined(OS_LINUX)
175 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_DEFAULT); 168 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_DEFAULT);
176 #elif defined(OS_MACOSX) 169 #elif defined(OS_MACOSX)
177 // This is necessary for CoreAnimation layers hosted in the GPU process to be 170 // This is necessary for CoreAnimation layers hosted in the GPU process to be
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 return true; 530 return true;
538 } 531 }
539 532
540 return false; 533 return false;
541 } 534 }
542 #endif // defined(OS_WIN) 535 #endif // defined(OS_WIN)
543 536
544 } // namespace. 537 } // namespace.
545 538
546 } // namespace content 539 } // namespace content
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