| 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 "content/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
| 10 #include "content/common/gpu/gpu_memory_buffer_factory.h" | 10 #include "content/common/gpu/gpu_memory_buffer_factory.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 if (default_offscreen_surface_.get()) { | 114 if (default_offscreen_surface_.get()) { |
| 115 default_offscreen_surface_->Destroy(); | 115 default_offscreen_surface_->Destroy(); |
| 116 default_offscreen_surface_ = NULL; | 116 default_offscreen_surface_ = NULL; |
| 117 } | 117 } |
| 118 } | 118 } |
| 119 | 119 |
| 120 gpu::gles2::ProgramCache* GpuChannelManager::program_cache() { | 120 gpu::gles2::ProgramCache* GpuChannelManager::program_cache() { |
| 121 if (!program_cache_.get() && | 121 if (!program_cache_.get() && |
| 122 (gfx::g_driver_gl.ext.b_GL_ARB_get_program_binary || | 122 (gfx::g_driver_gl.ext.b_GL_ARB_get_program_binary || |
| 123 gfx::g_driver_gl.ext.b_GL_OES_get_program_binary) && | 123 gfx::g_driver_gl.ext.b_GL_OES_get_program_binary) && |
| 124 !CommandLine::ForCurrentProcess()->HasSwitch( | 124 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 125 switches::kDisableGpuProgramCache)) { | 125 switches::kDisableGpuProgramCache)) { |
| 126 program_cache_.reset(new gpu::gles2::MemoryProgramCache()); | 126 program_cache_.reset(new gpu::gles2::MemoryProgramCache()); |
| 127 } | 127 } |
| 128 return program_cache_.get(); | 128 return program_cache_.get(); |
| 129 } | 129 } |
| 130 | 130 |
| 131 gpu::gles2::ShaderTranslatorCache* | 131 gpu::gles2::ShaderTranslatorCache* |
| 132 GpuChannelManager::shader_translator_cache() { | 132 GpuChannelManager::shader_translator_cache() { |
| 133 if (!shader_translator_cache_.get()) | 133 if (!shader_translator_cache_.get()) |
| 134 shader_translator_cache_ = new gpu::gles2::ShaderTranslatorCache; | 134 shader_translator_cache_ = new gpu::gles2::ShaderTranslatorCache; |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 OnResourcesRelinquished(); | 363 OnResourcesRelinquished(); |
| 364 #endif | 364 #endif |
| 365 } | 365 } |
| 366 } | 366 } |
| 367 | 367 |
| 368 void GpuChannelManager::OnResourcesRelinquished() { | 368 void GpuChannelManager::OnResourcesRelinquished() { |
| 369 Send(new GpuHostMsg_ResourcesRelinquished()); | 369 Send(new GpuHostMsg_ResourcesRelinquished()); |
| 370 } | 370 } |
| 371 | 371 |
| 372 } // namespace content | 372 } // namespace content |
| OLD | NEW |