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/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 params.client_id = client_id; | 759 params.client_id = client_id; |
760 if (Send(new GpuMsg_CreateGpuMemoryBufferFromHandle(params))) { | 760 if (Send(new GpuMsg_CreateGpuMemoryBufferFromHandle(params))) { |
761 create_gpu_memory_buffer_requests_.push(callback); | 761 create_gpu_memory_buffer_requests_.push(callback); |
762 } else { | 762 } else { |
763 callback.Run(gfx::GpuMemoryBufferHandle()); | 763 callback.Run(gfx::GpuMemoryBufferHandle()); |
764 } | 764 } |
765 } | 765 } |
766 | 766 |
767 void GpuProcessHost::DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, | 767 void GpuProcessHost::DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, |
768 int client_id, | 768 int client_id, |
769 int sync_point) { | 769 const gpu::SyncToken& sync_token) { |
770 TRACE_EVENT0("gpu", "GpuProcessHost::DestroyGpuMemoryBuffer"); | 770 TRACE_EVENT0("gpu", "GpuProcessHost::DestroyGpuMemoryBuffer"); |
771 | 771 |
772 DCHECK(CalledOnValidThread()); | 772 DCHECK(CalledOnValidThread()); |
773 | 773 |
774 Send(new GpuMsg_DestroyGpuMemoryBuffer(id, client_id, sync_point)); | 774 Send(new GpuMsg_DestroyGpuMemoryBuffer(id, client_id, sync_token)); |
775 } | 775 } |
776 | 776 |
777 void GpuProcessHost::OnInitialized(bool result, const gpu::GPUInfo& gpu_info) { | 777 void GpuProcessHost::OnInitialized(bool result, const gpu::GPUInfo& gpu_info) { |
778 UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", result); | 778 UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", result); |
779 initialized_ = result; | 779 initialized_ = result; |
780 | 780 |
781 if (!initialized_) | 781 if (!initialized_) |
782 GpuDataManagerImpl::GetInstance()->OnGpuProcessInitFailure(); | 782 GpuDataManagerImpl::GetInstance()->OnGpuProcessInitFailure(); |
783 else if (!in_process_) | 783 else if (!in_process_) |
784 GpuDataManagerImpl::GetInstance()->UpdateGpuInfo(gpu_info); | 784 GpuDataManagerImpl::GetInstance()->UpdateGpuInfo(gpu_info); |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1173 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1173 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
1174 ClientIdToShaderCacheMap::iterator iter = | 1174 ClientIdToShaderCacheMap::iterator iter = |
1175 client_id_to_shader_cache_.find(client_id); | 1175 client_id_to_shader_cache_.find(client_id); |
1176 // If the cache doesn't exist then this is an off the record profile. | 1176 // If the cache doesn't exist then this is an off the record profile. |
1177 if (iter == client_id_to_shader_cache_.end()) | 1177 if (iter == client_id_to_shader_cache_.end()) |
1178 return; | 1178 return; |
1179 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1179 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
1180 } | 1180 } |
1181 | 1181 |
1182 } // namespace content | 1182 } // namespace content |
OLD | NEW |