OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "gpu/command_buffer/service/in_process_command_buffer.h" | 5 #include "gpu/command_buffer/service/in_process_command_buffer.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <queue> | 10 #include <queue> |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 gfx::g_driver_gl.ext.b_GL_OES_get_program_binary) && | 191 gfx::g_driver_gl.ext.b_GL_OES_get_program_binary) && |
192 !base::CommandLine::ForCurrentProcess()->HasSwitch( | 192 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
193 switches::kDisableGpuProgramCache)) { | 193 switches::kDisableGpuProgramCache)) { |
194 program_cache_.reset(new gpu::gles2::MemoryProgramCache()); | 194 program_cache_.reset(new gpu::gles2::MemoryProgramCache()); |
195 } | 195 } |
196 return program_cache_.get(); | 196 return program_cache_.get(); |
197 } | 197 } |
198 | 198 |
199 InProcessCommandBuffer::InProcessCommandBuffer( | 199 InProcessCommandBuffer::InProcessCommandBuffer( |
200 const scoped_refptr<Service>& service) | 200 const scoped_refptr<Service>& service) |
201 : command_buffer_id_(g_next_command_buffer_id.GetNext()), | 201 : command_buffer_id_( |
| 202 CommandBufferId::FromUnsafeValue(g_next_command_buffer_id.GetNext())), |
202 context_lost_(false), | 203 context_lost_(false), |
203 delayed_work_pending_(false), | 204 delayed_work_pending_(false), |
204 image_factory_(nullptr), | 205 image_factory_(nullptr), |
205 last_put_offset_(-1), | 206 last_put_offset_(-1), |
206 gpu_memory_buffer_manager_(nullptr), | 207 gpu_memory_buffer_manager_(nullptr), |
207 next_fence_sync_release_(1), | 208 next_fence_sync_release_(1), |
208 flushed_fence_sync_release_(0), | 209 flushed_fence_sync_release_(0), |
209 flush_event_(false, false), | 210 flush_event_(false, false), |
210 service_(GetInitialService(service)), | 211 service_(GetInitialService(service)), |
211 fence_sync_wait_event_(false, false), | 212 fence_sync_wait_event_(false, false), |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 SyncToken sync_token(GetNamespaceID(), GetExtraCommandBufferData(), | 832 SyncToken sync_token(GetNamespaceID(), GetExtraCommandBufferData(), |
832 GetCommandBufferID(), release); | 833 GetCommandBufferID(), release); |
833 mailbox_manager->PushTextureUpdates(sync_token); | 834 mailbox_manager->PushTextureUpdates(sync_token); |
834 } | 835 } |
835 | 836 |
836 sync_point_client_->ReleaseFenceSync(release); | 837 sync_point_client_->ReleaseFenceSync(release); |
837 } | 838 } |
838 | 839 |
839 bool InProcessCommandBuffer::WaitFenceSyncOnGpuThread( | 840 bool InProcessCommandBuffer::WaitFenceSyncOnGpuThread( |
840 gpu::CommandBufferNamespace namespace_id, | 841 gpu::CommandBufferNamespace namespace_id, |
841 uint64_t command_buffer_id, | 842 gpu::CommandBufferId command_buffer_id, |
842 uint64_t release) { | 843 uint64_t release) { |
843 gpu::SyncPointManager* sync_point_manager = service_->sync_point_manager(); | 844 gpu::SyncPointManager* sync_point_manager = service_->sync_point_manager(); |
844 DCHECK(sync_point_manager); | 845 DCHECK(sync_point_manager); |
845 | 846 |
846 scoped_refptr<gpu::SyncPointClientState> release_state = | 847 scoped_refptr<gpu::SyncPointClientState> release_state = |
847 sync_point_manager->GetSyncPointClientState(namespace_id, | 848 sync_point_manager->GetSyncPointClientState(namespace_id, |
848 command_buffer_id); | 849 command_buffer_id); |
849 | 850 |
850 if (!release_state) | 851 if (!release_state) |
851 return true; | 852 return true; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 } | 917 } |
917 | 918 |
918 void InProcessCommandBuffer::EnsureWorkVisible() { | 919 void InProcessCommandBuffer::EnsureWorkVisible() { |
919 // This is only relevant for out-of-process command buffers. | 920 // This is only relevant for out-of-process command buffers. |
920 } | 921 } |
921 | 922 |
922 CommandBufferNamespace InProcessCommandBuffer::GetNamespaceID() const { | 923 CommandBufferNamespace InProcessCommandBuffer::GetNamespaceID() const { |
923 return CommandBufferNamespace::IN_PROCESS; | 924 return CommandBufferNamespace::IN_PROCESS; |
924 } | 925 } |
925 | 926 |
926 uint64_t InProcessCommandBuffer::GetCommandBufferID() const { | 927 CommandBufferId InProcessCommandBuffer::GetCommandBufferID() const { |
927 return command_buffer_id_; | 928 return command_buffer_id_; |
928 } | 929 } |
929 | 930 |
930 int32_t InProcessCommandBuffer::GetExtraCommandBufferData() const { | 931 int32_t InProcessCommandBuffer::GetExtraCommandBufferData() const { |
931 return 0; | 932 return 0; |
932 } | 933 } |
933 | 934 |
934 uint64_t InProcessCommandBuffer::GenerateFenceSyncRelease() { | 935 uint64_t InProcessCommandBuffer::GenerateFenceSyncRelease() { |
935 return next_fence_sync_release_++; | 936 return next_fence_sync_release_++; |
936 } | 937 } |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 framebuffer_completeness_cache_ = | 1081 framebuffer_completeness_cache_ = |
1081 new gpu::gles2::FramebufferCompletenessCache; | 1082 new gpu::gles2::FramebufferCompletenessCache; |
1082 return framebuffer_completeness_cache_; | 1083 return framebuffer_completeness_cache_; |
1083 } | 1084 } |
1084 | 1085 |
1085 SyncPointManager* GpuInProcessThread::sync_point_manager() { | 1086 SyncPointManager* GpuInProcessThread::sync_point_manager() { |
1086 return sync_point_manager_; | 1087 return sync_point_manager_; |
1087 } | 1088 } |
1088 | 1089 |
1089 } // namespace gpu | 1090 } // namespace gpu |
OLD | NEW |