OLD | NEW |
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 "content/browser/gpu/gpu_process_host.h" | 5 #include "content/browser/gpu/gpu_process_host.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 BrowserThread::PostTask(BrowserThread::UI, | 263 BrowserThread::PostTask(BrowserThread::UI, |
264 FROM_HERE, | 264 FROM_HERE, |
265 NewRunnableFunction(GpuProcessHostUIShim::Destroy, | 265 NewRunnableFunction(GpuProcessHostUIShim::Destroy, |
266 host_id_)); | 266 host_id_)); |
267 } | 267 } |
268 | 268 |
269 bool GpuProcessHost::Init() { | 269 bool GpuProcessHost::Init() { |
270 if (!CreateChannel()) | 270 if (!CreateChannel()) |
271 return false; | 271 return false; |
272 | 272 |
273 #if defined(TOUCH_UI) | |
274 if (CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | |
275 switches::kUseGL) != gfx::kGLImplementationEGLName) { | |
276 LOG(ERROR) << "GPU process needs EGL_KHR_image_pixmap extension. " | |
277 << "Try --use-gl=egl on the command line."; | |
278 return false; | |
279 } | |
280 #endif | |
281 | |
282 if (in_process_) { | 273 if (in_process_) { |
283 CommandLine::ForCurrentProcess()->AppendSwitch( | 274 CommandLine::ForCurrentProcess()->AppendSwitch( |
284 switches::kDisableGpuWatchdog); | 275 switches::kDisableGpuWatchdog); |
285 | 276 |
286 in_process_gpu_thread_.reset(new GpuMainThread(channel_id())); | 277 in_process_gpu_thread_.reset(new GpuMainThread(channel_id())); |
287 | 278 |
288 base::Thread::Options options; | 279 base::Thread::Options options; |
289 #if defined(OS_WIN) | 280 #if defined(OS_WIN) |
290 // On Windows the GPU thread needs to pump the compositor child window's | 281 // On Windows the GPU thread needs to pump the compositor child window's |
291 // message loop. TODO(apatrick): make this an IO thread if / when we get rid | 282 // message loop. TODO(apatrick): make this an IO thread if / when we get rid |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 scoped_ptr<EstablishChannelCallback> wrapped_callback(callback); | 581 scoped_ptr<EstablishChannelCallback> wrapped_callback(callback); |
591 wrapped_callback->Run(channel_handle, renderer_process_for_gpu, gpu_info); | 582 wrapped_callback->Run(channel_handle, renderer_process_for_gpu, gpu_info); |
592 } | 583 } |
593 | 584 |
594 void GpuProcessHost::CreateCommandBufferError( | 585 void GpuProcessHost::CreateCommandBufferError( |
595 CreateCommandBufferCallback* callback, int32 route_id) { | 586 CreateCommandBufferCallback* callback, int32 route_id) { |
596 scoped_ptr<GpuProcessHost::CreateCommandBufferCallback> | 587 scoped_ptr<GpuProcessHost::CreateCommandBufferCallback> |
597 wrapped_callback(callback); | 588 wrapped_callback(callback); |
598 callback->Run(route_id); | 589 callback->Run(route_id); |
599 } | 590 } |
OLD | NEW |