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 "content/common/gpu/gpu_channel_manager.h" | 5 #include "content/common/gpu/gpu_channel_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
11 #include "base/thread_task_runner_handle.h" | 11 #include "base/thread_task_runner_handle.h" |
12 #include "content/common/gpu/gpu_channel.h" | 12 #include "content/common/gpu/gpu_channel.h" |
13 #include "content/common/gpu/gpu_memory_buffer_factory.h" | 13 #include "content/common/gpu/gpu_memory_buffer_factory.h" |
14 #include "content/common/gpu/gpu_memory_manager.h" | 14 #include "content/common/gpu/gpu_memory_manager.h" |
15 #include "content/common/gpu/gpu_messages.h" | 15 #include "content/common/gpu/gpu_messages.h" |
16 #include "content/common/message_router.h" | 16 #include "content/common/message_router.h" |
17 #include "gpu/command_buffer/common/value_state.h" | 17 #include "gpu/command_buffer/common/value_state.h" |
18 #include "gpu/command_buffer/service/feature_info.h" | 18 #include "gpu/command_buffer/service/feature_info.h" |
19 #include "gpu/command_buffer/service/gpu_switches.h" | 19 #include "gpu/command_buffer/service/gpu_switches.h" |
20 #include "gpu/command_buffer/service/mailbox_manager.h" | 20 #include "gpu/command_buffer/service/mailbox_manager.h" |
21 #include "gpu/command_buffer/service/memory_program_cache.h" | 21 #include "gpu/command_buffer/service/memory_program_cache.h" |
22 #include "gpu/command_buffer/service/shader_translator_cache.h" | 22 #include "gpu/command_buffer/service/shader_translator_cache.h" |
23 #include "gpu/command_buffer/service/sync_point_manager.h" | 23 #include "gpu/command_buffer/service/sync_point_manager.h" |
24 #include "ipc/message_filter.h" | 24 #include "ipc/message_filter.h" |
25 #include "ui/gl/gl_bindings.h" | 25 #include "ui/gl/gl_bindings.h" |
26 #include "ui/gl/gl_gl_api_implementation.h" | |
27 #include "ui/gl/gl_share_group.h" | 26 #include "ui/gl/gl_share_group.h" |
28 #if defined(USE_OZONE) | 27 #if defined(USE_OZONE) |
29 #include "ui/ozone/public/gpu_platform_support.h" | 28 #include "ui/ozone/public/gpu_platform_support.h" |
30 #include "ui/ozone/public/ozone_platform.h" | 29 #include "ui/ozone/public/ozone_platform.h" |
31 #endif | 30 #endif |
32 | 31 |
33 namespace content { | 32 namespace content { |
34 | 33 |
35 GpuChannelManager::GpuChannelManager( | 34 GpuChannelManager::GpuChannelManager( |
36 MessageRouter* router, | 35 MessageRouter* router, |
(...skipping 25 matching lines...) Expand all Loading... |
62 gpu_channels_.clear(); | 61 gpu_channels_.clear(); |
63 if (default_offscreen_surface_.get()) { | 62 if (default_offscreen_surface_.get()) { |
64 default_offscreen_surface_->Destroy(); | 63 default_offscreen_surface_->Destroy(); |
65 default_offscreen_surface_ = NULL; | 64 default_offscreen_surface_ = NULL; |
66 } | 65 } |
67 } | 66 } |
68 | 67 |
69 gpu::gles2::ProgramCache* GpuChannelManager::program_cache() { | 68 gpu::gles2::ProgramCache* GpuChannelManager::program_cache() { |
70 if (!program_cache_.get() && | 69 if (!program_cache_.get() && |
71 (gfx::g_driver_gl.ext.b_GL_ARB_get_program_binary || | 70 (gfx::g_driver_gl.ext.b_GL_ARB_get_program_binary || |
72 gfx::g_driver_gl.ext.b_GL_OES_get_program_binary || | 71 gfx::g_driver_gl.ext.b_GL_OES_get_program_binary) && |
73 gfx::GetGLVersionInfo()->is_es3) && | |
74 !base::CommandLine::ForCurrentProcess()->HasSwitch( | 72 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
75 switches::kDisableGpuProgramCache)) { | 73 switches::kDisableGpuProgramCache)) { |
76 program_cache_.reset(new gpu::gles2::MemoryProgramCache()); | 74 program_cache_.reset(new gpu::gles2::MemoryProgramCache()); |
77 } | 75 } |
78 return program_cache_.get(); | 76 return program_cache_.get(); |
79 } | 77 } |
80 | 78 |
81 gpu::gles2::ShaderTranslatorCache* | 79 gpu::gles2::ShaderTranslatorCache* |
82 GpuChannelManager::shader_translator_cache() { | 80 GpuChannelManager::shader_translator_cache() { |
83 if (!shader_translator_cache_.get()) | 81 if (!shader_translator_cache_.get()) |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 OnResourcesRelinquished(); | 307 OnResourcesRelinquished(); |
310 #endif | 308 #endif |
311 } | 309 } |
312 } | 310 } |
313 | 311 |
314 void GpuChannelManager::OnResourcesRelinquished() { | 312 void GpuChannelManager::OnResourcesRelinquished() { |
315 Send(new GpuHostMsg_ResourcesRelinquished()); | 313 Send(new GpuHostMsg_ResourcesRelinquished()); |
316 } | 314 } |
317 | 315 |
318 } // namespace content | 316 } // namespace content |
OLD | NEW |