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/browser/gpu/gpu_process_host.h" | 5 #include "content/browser/gpu/gpu_process_host.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 callback.Run(IPC::ChannelHandle(), GPUInfo()); | 749 callback.Run(IPC::ChannelHandle(), GPUInfo()); |
750 return; | 750 return; |
751 } | 751 } |
752 | 752 |
753 if (Send(new GpuMsg_EstablishChannel(client_id, share_context))) { | 753 if (Send(new GpuMsg_EstablishChannel(client_id, share_context))) { |
754 channel_requests_.push(callback); | 754 channel_requests_.push(callback); |
755 } else { | 755 } else { |
756 callback.Run(IPC::ChannelHandle(), GPUInfo()); | 756 callback.Run(IPC::ChannelHandle(), GPUInfo()); |
757 } | 757 } |
758 | 758 |
759 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 759 if (CommandLine::ForCurrentProcess()->HasSwitch( |
760 switches::kDisableGpuShaderDiskCache)) { | 760 switches::kEnableGpuShaderDiskCache)) { |
761 CreateChannelCache(client_id, gpu::kDefaultMaxProgramCacheMemoryBytes); | 761 CreateChannelCache(client_id, gpu::kDefaultMaxProgramCacheMemoryBytes); |
762 } | 762 } |
763 } | 763 } |
764 | 764 |
765 void GpuProcessHost::CreateViewCommandBuffer( | 765 void GpuProcessHost::CreateViewCommandBuffer( |
766 const gfx::GLSurfaceHandle& compositing_surface, | 766 const gfx::GLSurfaceHandle& compositing_surface, |
767 int surface_id, | 767 int surface_id, |
768 int client_id, | 768 int client_id, |
769 const GPUCreateCommandBufferConfig& init_params, | 769 const GPUCreateCommandBufferConfig& init_params, |
770 const CreateCommandBufferCallback& callback) { | 770 const CreateCommandBufferCallback& callback) { |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1301 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1301 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
1302 ClientIdToShaderCacheMap::iterator iter = | 1302 ClientIdToShaderCacheMap::iterator iter = |
1303 client_id_to_shader_cache_.find(client_id); | 1303 client_id_to_shader_cache_.find(client_id); |
1304 // If the cache doesn't exist then this is an off the record profile. | 1304 // If the cache doesn't exist then this is an off the record profile. |
1305 if (iter == client_id_to_shader_cache_.end()) | 1305 if (iter == client_id_to_shader_cache_.end()) |
1306 return; | 1306 return; |
1307 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1307 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
1308 } | 1308 } |
1309 | 1309 |
1310 } // namespace content | 1310 } // namespace content |
OLD | NEW |