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 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 } else { | 643 } else { |
644 // Could distinguish here between compositing_surface being NULL | 644 // Could distinguish here between compositing_surface being NULL |
645 // and Send failing, if desired. | 645 // and Send failing, if desired. |
646 callback.Run(CREATE_COMMAND_BUFFER_FAILED_AND_CHANNEL_LOST); | 646 callback.Run(CREATE_COMMAND_BUFFER_FAILED_AND_CHANNEL_LOST); |
647 } | 647 } |
648 } | 648 } |
649 | 649 |
650 void GpuProcessHost::CreateGpuMemoryBuffer( | 650 void GpuProcessHost::CreateGpuMemoryBuffer( |
651 const gfx::GpuMemoryBufferHandle& handle, | 651 const gfx::GpuMemoryBufferHandle& handle, |
652 const gfx::Size& size, | 652 const gfx::Size& size, |
653 unsigned internalformat, | 653 gfx::GpuMemoryBuffer::Format format, |
654 unsigned usage, | 654 gfx::GpuMemoryBuffer::Usage usage, |
655 const CreateGpuMemoryBufferCallback& callback) { | 655 const CreateGpuMemoryBufferCallback& callback) { |
656 TRACE_EVENT0("gpu", "GpuProcessHost::CreateGpuMemoryBuffer"); | 656 TRACE_EVENT0("gpu", "GpuProcessHost::CreateGpuMemoryBuffer"); |
657 | 657 |
658 DCHECK(CalledOnValidThread()); | 658 DCHECK(CalledOnValidThread()); |
659 | 659 |
660 if (Send(new GpuMsg_CreateGpuMemoryBuffer( | 660 if (Send(new GpuMsg_CreateGpuMemoryBuffer(handle, size, format, usage))) { |
661 handle, size, internalformat, usage))) { | |
662 create_gpu_memory_buffer_requests_.push(callback); | 661 create_gpu_memory_buffer_requests_.push(callback); |
663 } else { | 662 } else { |
664 callback.Run(gfx::GpuMemoryBufferHandle()); | 663 callback.Run(gfx::GpuMemoryBufferHandle()); |
665 } | 664 } |
666 } | 665 } |
667 | 666 |
668 void GpuProcessHost::DestroyGpuMemoryBuffer( | 667 void GpuProcessHost::DestroyGpuMemoryBuffer( |
669 const gfx::GpuMemoryBufferHandle& handle, | 668 const gfx::GpuMemoryBufferHandle& handle, |
670 int sync_point) { | 669 int sync_point) { |
671 TRACE_EVENT0("gpu", "GpuProcessHost::DestroyGpuMemoryBuffer"); | 670 TRACE_EVENT0("gpu", "GpuProcessHost::DestroyGpuMemoryBuffer"); |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1057 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
1059 ClientIdToShaderCacheMap::iterator iter = | 1058 ClientIdToShaderCacheMap::iterator iter = |
1060 client_id_to_shader_cache_.find(client_id); | 1059 client_id_to_shader_cache_.find(client_id); |
1061 // If the cache doesn't exist then this is an off the record profile. | 1060 // If the cache doesn't exist then this is an off the record profile. |
1062 if (iter == client_id_to_shader_cache_.end()) | 1061 if (iter == client_id_to_shader_cache_.end()) |
1063 return; | 1062 return; |
1064 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1063 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
1065 } | 1064 } |
1066 | 1065 |
1067 } // namespace content | 1066 } // namespace content |
OLD | NEW |