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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/hash.h" | 8 #include "base/hash.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 DCHECK(!sync_points_.empty() && sync_points_.front() == sync_point); | 923 DCHECK(!sync_points_.empty() && sync_points_.front() == sync_point); |
924 sync_points_.pop_front(); | 924 sync_points_.pop_front(); |
925 | 925 |
926 gpu::gles2::MailboxManager* mailbox_manager = | 926 gpu::gles2::MailboxManager* mailbox_manager = |
927 context_group_->mailbox_manager(); | 927 context_group_->mailbox_manager(); |
928 if (mailbox_manager->UsesSync() && MakeCurrent()) { | 928 if (mailbox_manager->UsesSync() && MakeCurrent()) { |
929 // Old sync points are global and do not have a command buffer ID, | 929 // Old sync points are global and do not have a command buffer ID, |
930 // We can simply use the global sync point number as the release count with | 930 // We can simply use the global sync point number as the release count with |
931 // 0 for the command buffer ID (under normal circumstances 0 is invalid so | 931 // 0 for the command buffer ID (under normal circumstances 0 is invalid so |
932 // will not be used) until the old sync points are replaced. | 932 // will not be used) until the old sync points are replaced. |
933 gpu::SyncToken sync_token(gpu::CommandBufferNamespace::GPU_IO, 0, | 933 gpu::SyncToken sync_token(gpu::CommandBufferNamespace::GPU_IO, 0, 0, |
934 sync_point); | 934 sync_point); |
935 mailbox_manager->PushTextureUpdates(sync_token); | 935 mailbox_manager->PushTextureUpdates(sync_token); |
936 } | 936 } |
937 | 937 |
938 sync_point_manager_->RetireSyncPoint(sync_point); | 938 sync_point_manager_->RetireSyncPoint(sync_point); |
939 } | 939 } |
940 | 940 |
941 bool GpuCommandBufferStub::OnWaitSyncPoint(uint32 sync_point) { | 941 bool GpuCommandBufferStub::OnWaitSyncPoint(uint32 sync_point) { |
942 DCHECK(!waiting_for_sync_point_); | 942 DCHECK(!waiting_for_sync_point_); |
943 DCHECK(scheduler_->scheduled()); | 943 DCHECK(scheduler_->scheduled()); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 scheduler_->SetScheduled(true); | 979 scheduler_->SetScheduled(true); |
980 } | 980 } |
981 | 981 |
982 void GpuCommandBufferStub::PullTextureUpdates( | 982 void GpuCommandBufferStub::PullTextureUpdates( |
983 gpu::CommandBufferNamespace namespace_id, | 983 gpu::CommandBufferNamespace namespace_id, |
984 uint64_t command_buffer_id, | 984 uint64_t command_buffer_id, |
985 uint32_t release) { | 985 uint32_t release) { |
986 gpu::gles2::MailboxManager* mailbox_manager = | 986 gpu::gles2::MailboxManager* mailbox_manager = |
987 context_group_->mailbox_manager(); | 987 context_group_->mailbox_manager(); |
988 if (mailbox_manager->UsesSync() && MakeCurrent()) { | 988 if (mailbox_manager->UsesSync() && MakeCurrent()) { |
989 gpu::SyncToken sync_token(namespace_id, command_buffer_id, release); | 989 gpu::SyncToken sync_token(namespace_id, 0, command_buffer_id, release); |
990 mailbox_manager->PullTextureUpdates(sync_token); | 990 mailbox_manager->PullTextureUpdates(sync_token); |
991 } | 991 } |
992 } | 992 } |
993 | 993 |
994 void GpuCommandBufferStub::OnSignalSyncPoint(uint32 sync_point, uint32 id) { | 994 void GpuCommandBufferStub::OnSignalSyncPoint(uint32 sync_point, uint32 id) { |
995 sync_point_manager_->AddSyncPointCallback( | 995 sync_point_manager_->AddSyncPointCallback( |
996 sync_point, | 996 sync_point, |
997 base::Bind(&GpuCommandBufferStub::OnSignalAck, this->AsWeakPtr(), id)); | 997 base::Bind(&GpuCommandBufferStub::OnSignalAck, this->AsWeakPtr(), id)); |
998 } | 998 } |
999 | 999 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 | 1037 |
1038 void GpuCommandBufferStub::OnFenceSyncRelease(uint64_t release) { | 1038 void GpuCommandBufferStub::OnFenceSyncRelease(uint64_t release) { |
1039 if (sync_point_client_->client_state()->IsFenceSyncReleased(release)) { | 1039 if (sync_point_client_->client_state()->IsFenceSyncReleased(release)) { |
1040 DLOG(ERROR) << "Fence Sync has already been released."; | 1040 DLOG(ERROR) << "Fence Sync has already been released."; |
1041 return; | 1041 return; |
1042 } | 1042 } |
1043 | 1043 |
1044 gpu::gles2::MailboxManager* mailbox_manager = | 1044 gpu::gles2::MailboxManager* mailbox_manager = |
1045 context_group_->mailbox_manager(); | 1045 context_group_->mailbox_manager(); |
1046 if (mailbox_manager->UsesSync() && MakeCurrent()) { | 1046 if (mailbox_manager->UsesSync() && MakeCurrent()) { |
1047 gpu::SyncToken sync_token(gpu::CommandBufferNamespace::GPU_IO, | 1047 gpu::SyncToken sync_token(gpu::CommandBufferNamespace::GPU_IO, 0, |
1048 command_buffer_id_, release); | 1048 command_buffer_id_, release); |
1049 mailbox_manager->PushTextureUpdates(sync_token); | 1049 mailbox_manager->PushTextureUpdates(sync_token); |
1050 } | 1050 } |
1051 | 1051 |
1052 sync_point_client_->ReleaseFenceSync(release); | 1052 sync_point_client_->ReleaseFenceSync(release); |
1053 } | 1053 } |
1054 | 1054 |
1055 bool GpuCommandBufferStub::OnWaitFenceSync( | 1055 bool GpuCommandBufferStub::OnWaitFenceSync( |
1056 gpu::CommandBufferNamespace namespace_id, | 1056 gpu::CommandBufferNamespace namespace_id, |
1057 uint64_t command_buffer_id, | 1057 uint64_t command_buffer_id, |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 result)); | 1251 result)); |
1252 } | 1252 } |
1253 | 1253 |
1254 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, | 1254 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, |
1255 base::TimeDelta interval) { | 1255 base::TimeDelta interval) { |
1256 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, | 1256 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, |
1257 interval)); | 1257 interval)); |
1258 } | 1258 } |
1259 | 1259 |
1260 } // namespace content | 1260 } // namespace content |
OLD | NEW |