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

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

Issue 1723303002: Implement GLX for Ozone X11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and cleanup. Created 4 years, 3 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 | ui/events/platform/x11/x11_event_source_libevent.h » ('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) 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 7
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // early, the browser process will never detect it. For this reason 178 // early, the browser process will never detect it. For this reason
179 // we defer tearing down the GPU process until receiving the 179 // we defer tearing down the GPU process until receiving the
180 // GpuMsg_Initialize message from the browser. 180 // GpuMsg_Initialize message from the browser.
181 bool dead_on_arrival = false; 181 bool dead_on_arrival = false;
182 182
183 #if defined(OS_WIN) 183 #if defined(OS_WIN)
184 // Use a UI message loop because ANGLE and the desktop GL platform can 184 // Use a UI message loop because ANGLE and the desktop GL platform can
185 // create child windows to render to. 185 // create child windows to render to.
186 base::MessagePumpForGpu::InitFactory(); 186 base::MessagePumpForGpu::InitFactory();
187 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI); 187 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI);
188 #elif defined(OS_LINUX) && defined(USE_X11) 188 #elif defined(USE_X11)
189 // We need a UI loop so that we can grab the Expose events. See GLSurfaceGLX 189 // We need a UI loop so that we can grab the Expose events. See GLSurfaceGLX
190 // and https://crbug.com/326995. 190 // and https://crbug.com/326995.
191 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI); 191 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI);
192 std::unique_ptr<ui::PlatformEventSource> event_source = 192 std::unique_ptr<ui::PlatformEventSource> event_source =
193 ui::PlatformEventSource::CreateDefault(); 193 ui::PlatformEventSource::CreateDefault();
194 #elif defined(USE_OZONE)
piman 2016/09/06 22:17:55 Is it the case that Ozone + X11 doesn't have USE_X
kylechar 2016/09/07 13:47:16 Yep, Ozone X11 has USE_OZONE=1 and USE_X11=0. It'
piman 2016/09/07 17:07:09 Depending on the platform, there are constraints s
kylechar 2016/09/07 21:10:42 Thanks! That makes more sense about the message lo
piman 2016/09/07 21:44:30 I think the important case is that if X11 is not p
kylechar 2016/09/13 19:59:12 That's fair. Added a #define in content/gpu/BUILD.
195 // Ozone X11 needs a UI loop to grab Expose events. https://crbug.com/326995
196 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI);
194 #elif defined(OS_LINUX) 197 #elif defined(OS_LINUX)
195 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_DEFAULT); 198 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_DEFAULT);
piman 2016/09/07 17:07:09 If the answer to the question above is no, this is
kylechar 2016/09/13 19:59:12 Done.
196 #elif defined(OS_MACOSX) 199 #elif defined(OS_MACOSX)
197 // This is necessary for CoreAnimation layers hosted in the GPU process to be 200 // This is necessary for CoreAnimation layers hosted in the GPU process to be
198 // drawn. See http://crbug.com/312462. 201 // drawn. See http://crbug.com/312462.
199 std::unique_ptr<base::MessagePump> pump(new base::MessagePumpCFRunLoop()); 202 std::unique_ptr<base::MessagePump> pump(new base::MessagePumpCFRunLoop());
200 base::MessageLoop main_message_loop(std::move(pump)); 203 base::MessageLoop main_message_loop(std::move(pump));
201 #else 204 #else
202 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_IO); 205 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_IO);
203 #endif 206 #endif
204 207
205 base::PlatformThread::SetName("CrGpuMain"); 208 base::PlatformThread::SetName("CrGpuMain");
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 return true; 550 return true;
548 } 551 }
549 552
550 return false; 553 return false;
551 } 554 }
552 #endif // defined(OS_WIN) 555 #endif // defined(OS_WIN)
553 556
554 } // namespace. 557 } // namespace.
555 558
556 } // namespace content 559 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | ui/events/platform/x11/x11_event_source_libevent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698