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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <list> | 10 #include <list> |
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 EstablishChannelStatus::SUCCESS); | 759 EstablishChannelStatus::SUCCESS); |
760 } | 760 } |
761 | 761 |
762 void GpuProcessHost::OnGpuMemoryBufferCreated( | 762 void GpuProcessHost::OnGpuMemoryBufferCreated( |
763 const gfx::GpuMemoryBufferHandle& handle) { | 763 const gfx::GpuMemoryBufferHandle& handle) { |
764 TRACE_EVENT0("gpu", "GpuProcessHost::OnGpuMemoryBufferCreated"); | 764 TRACE_EVENT0("gpu", "GpuProcessHost::OnGpuMemoryBufferCreated"); |
765 | 765 |
766 DCHECK(!create_gpu_memory_buffer_requests_.empty()); | 766 DCHECK(!create_gpu_memory_buffer_requests_.empty()); |
767 auto callback = create_gpu_memory_buffer_requests_.front(); | 767 auto callback = create_gpu_memory_buffer_requests_.front(); |
768 create_gpu_memory_buffer_requests_.pop(); | 768 create_gpu_memory_buffer_requests_.pop(); |
769 callback.Run(handle); | 769 callback.Run(handle, BufferCreationStatus::SUCCESS); |
770 } | 770 } |
771 | 771 |
772 #if defined(OS_ANDROID) | 772 #if defined(OS_ANDROID) |
773 void GpuProcessHost::OnDestroyingVideoSurfaceAck() { | 773 void GpuProcessHost::OnDestroyingVideoSurfaceAck() { |
774 TRACE_EVENT0("gpu", "GpuProcessHost::OnDestroyingVideoSurfaceAck"); | 774 TRACE_EVENT0("gpu", "GpuProcessHost::OnDestroyingVideoSurfaceAck"); |
775 if (!send_destroying_video_surface_done_cb_.is_null()) | 775 if (!send_destroying_video_surface_done_cb_.is_null()) |
776 base::ResetAndReturn(&send_destroying_video_surface_done_cb_).Run(); | 776 base::ResetAndReturn(&send_destroying_video_surface_done_cb_).Run(); |
777 } | 777 } |
778 #endif | 778 #endif |
779 | 779 |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 while (!channel_requests_.empty()) { | 1044 while (!channel_requests_.empty()) { |
1045 auto callback = channel_requests_.front(); | 1045 auto callback = channel_requests_.front(); |
1046 channel_requests_.pop(); | 1046 channel_requests_.pop(); |
1047 callback.Run(IPC::ChannelHandle(), gpu::GPUInfo(), | 1047 callback.Run(IPC::ChannelHandle(), gpu::GPUInfo(), |
1048 EstablishChannelStatus::GPU_HOST_INVALID); | 1048 EstablishChannelStatus::GPU_HOST_INVALID); |
1049 } | 1049 } |
1050 | 1050 |
1051 while (!create_gpu_memory_buffer_requests_.empty()) { | 1051 while (!create_gpu_memory_buffer_requests_.empty()) { |
1052 auto callback = create_gpu_memory_buffer_requests_.front(); | 1052 auto callback = create_gpu_memory_buffer_requests_.front(); |
1053 create_gpu_memory_buffer_requests_.pop(); | 1053 create_gpu_memory_buffer_requests_.pop(); |
1054 callback.Run(gfx::GpuMemoryBufferHandle()); | 1054 callback.Run(gfx::GpuMemoryBufferHandle(), |
| 1055 BufferCreationStatus::GPU_HOST_INVALID); |
1055 } | 1056 } |
1056 | 1057 |
1057 if (!send_destroying_video_surface_done_cb_.is_null()) | 1058 if (!send_destroying_video_surface_done_cb_.is_null()) |
1058 base::ResetAndReturn(&send_destroying_video_surface_done_cb_).Run(); | 1059 base::ResetAndReturn(&send_destroying_video_surface_done_cb_).Run(); |
1059 } | 1060 } |
1060 | 1061 |
1061 void GpuProcessHost::BlockLiveOffscreenContexts() { | 1062 void GpuProcessHost::BlockLiveOffscreenContexts() { |
1062 for (std::multiset<GURL>::iterator iter = | 1063 for (std::multiset<GURL>::iterator iter = |
1063 urls_with_live_offscreen_contexts_.begin(); | 1064 urls_with_live_offscreen_contexts_.begin(); |
1064 iter != urls_with_live_offscreen_contexts_.end(); ++iter) { | 1065 iter != urls_with_live_offscreen_contexts_.end(); ++iter) { |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1177 if (!cache.get()) | 1178 if (!cache.get()) |
1178 return; | 1179 return; |
1179 | 1180 |
1180 cache->set_shader_loaded_callback(base::Bind(&GpuProcessHost::LoadedShader, | 1181 cache->set_shader_loaded_callback(base::Bind(&GpuProcessHost::LoadedShader, |
1181 weak_ptr_factory_.GetWeakPtr())); | 1182 weak_ptr_factory_.GetWeakPtr())); |
1182 | 1183 |
1183 client_id_to_shader_cache_[client_id] = cache; | 1184 client_id_to_shader_cache_[client_id] = cache; |
1184 } | 1185 } |
1185 | 1186 |
1186 } // namespace content | 1187 } // namespace content |
OLD | NEW |