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 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 callback.Run(IPC::ChannelHandle(), GPUInfo()); | 710 callback.Run(IPC::ChannelHandle(), GPUInfo()); |
711 return; | 711 return; |
712 } | 712 } |
713 | 713 |
714 if (Send(new GpuMsg_EstablishChannel(client_id, share_context))) { | 714 if (Send(new GpuMsg_EstablishChannel(client_id, share_context))) { |
715 channel_requests_.push(callback); | 715 channel_requests_.push(callback); |
716 } else { | 716 } else { |
717 callback.Run(IPC::ChannelHandle(), GPUInfo()); | 717 callback.Run(IPC::ChannelHandle(), GPUInfo()); |
718 } | 718 } |
719 | 719 |
720 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 720 if (CommandLine::ForCurrentProcess()->HasSwitch( |
721 switches::kDisableGpuShaderDiskCache)) { | 721 switches::kEnableGpuShaderDiskCache)) { |
722 CreateChannelCache(client_id, gpu::kDefaultMaxProgramCacheMemoryBytes); | 722 CreateChannelCache(client_id, gpu::kDefaultMaxProgramCacheMemoryBytes); |
723 } | 723 } |
724 } | 724 } |
725 | 725 |
726 void GpuProcessHost::CreateViewCommandBuffer( | 726 void GpuProcessHost::CreateViewCommandBuffer( |
727 const gfx::GLSurfaceHandle& compositing_surface, | 727 const gfx::GLSurfaceHandle& compositing_surface, |
728 int surface_id, | 728 int surface_id, |
729 int client_id, | 729 int client_id, |
730 const GPUCreateCommandBufferConfig& init_params, | 730 const GPUCreateCommandBufferConfig& init_params, |
731 const CreateCommandBufferCallback& callback) { | 731 const CreateCommandBufferCallback& callback) { |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1246 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1246 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
1247 ClientIdToShaderCacheMap::iterator iter = | 1247 ClientIdToShaderCacheMap::iterator iter = |
1248 client_id_to_shader_cache_.find(client_id); | 1248 client_id_to_shader_cache_.find(client_id); |
1249 // If the cache doesn't exist then this is an off the record profile. | 1249 // If the cache doesn't exist then this is an off the record profile. |
1250 if (iter == client_id_to_shader_cache_.end()) | 1250 if (iter == client_id_to_shader_cache_.end()) |
1251 return; | 1251 return; |
1252 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1252 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
1253 } | 1253 } |
1254 | 1254 |
1255 } // namespace content | 1255 } // namespace content |
OLD | NEW |