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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
207 preemption_flag_(preempt_by_flag), | 207 preemption_flag_(preempt_by_flag), |
208 active_url_(active_url) { | 208 active_url_(active_url) { |
209 active_url_hash_ = base::Hash(active_url.possibly_invalid_spec()); | 209 active_url_hash_ = base::Hash(active_url.possibly_invalid_spec()); |
210 FastSetActiveURL(active_url_, active_url_hash_); | 210 FastSetActiveURL(active_url_, active_url_hash_); |
211 | 211 |
212 gpu::gles2::ContextCreationAttribHelper attrib_parser; | 212 gpu::gles2::ContextCreationAttribHelper attrib_parser; |
213 attrib_parser.Parse(requested_attribs_); | 213 attrib_parser.Parse(requested_attribs_); |
214 | 214 |
215 if (share_group) { | 215 if (share_group) { |
216 context_group_ = share_group->context_group_; | 216 context_group_ = share_group->context_group_; |
217 DCHECK(context_group_->bind_generates_resource() == | 217 DCHECK(context_group_->bind_generatse_resource() == |
piman
2015/11/30 20:59:23
??
David Yen
2015/11/30 22:45:06
Strange... not sure how that happened. Reverted.
| |
218 attrib_parser.bind_generates_resource); | 218 attrib_parser.bind_generates_resource); |
219 } else { | 219 } else { |
220 context_group_ = new gpu::gles2::ContextGroup( | 220 context_group_ = new gpu::gles2::ContextGroup( |
221 mailbox_manager, | 221 mailbox_manager, |
222 new GpuCommandBufferMemoryTracker(channel, command_buffer_id_), | 222 new GpuCommandBufferMemoryTracker(channel, command_buffer_id_), |
223 channel_->gpu_channel_manager()->shader_translator_cache(), | 223 channel_->gpu_channel_manager()->shader_translator_cache(), |
224 channel_->gpu_channel_manager()->framebuffer_completeness_cache(), NULL, | 224 channel_->gpu_channel_manager()->framebuffer_completeness_cache(), NULL, |
225 subscription_ref_set, pending_valuebuffer_state, | 225 subscription_ref_set, pending_valuebuffer_state, |
226 attrib_parser.bind_generates_resource); | 226 attrib_parser.bind_generates_resource); |
227 } | 227 } |
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
930 DCHECK(!sync_points_.empty() && sync_points_.front() == sync_point); | 930 DCHECK(!sync_points_.empty() && sync_points_.front() == sync_point); |
931 sync_points_.pop_front(); | 931 sync_points_.pop_front(); |
932 | 932 |
933 gpu::gles2::MailboxManager* mailbox_manager = | 933 gpu::gles2::MailboxManager* mailbox_manager = |
934 context_group_->mailbox_manager(); | 934 context_group_->mailbox_manager(); |
935 if (mailbox_manager->UsesSync() && MakeCurrent()) { | 935 if (mailbox_manager->UsesSync() && MakeCurrent()) { |
936 // Old sync points are global and do not have a command buffer ID, | 936 // Old sync points are global and do not have a command buffer ID, |
937 // We can simply use the global sync point number as the release count with | 937 // We can simply use the global sync point number as the release count with |
938 // 0 for the command buffer ID (under normal circumstances 0 is invalid so | 938 // 0 for the command buffer ID (under normal circumstances 0 is invalid so |
939 // will not be used) until the old sync points are replaced. | 939 // will not be used) until the old sync points are replaced. |
940 gpu::SyncToken sync_token(gpu::CommandBufferNamespace::GPU_IO, 0, | 940 gpu::SyncToken sync_token(gpu::CommandBufferNamespace::GPU_IO, 0, 0, |
941 sync_point); | 941 sync_point); |
942 mailbox_manager->PushTextureUpdates(sync_token); | 942 mailbox_manager->PushTextureUpdates(sync_token); |
943 } | 943 } |
944 | 944 |
945 sync_point_manager_->RetireSyncPoint(sync_point); | 945 sync_point_manager_->RetireSyncPoint(sync_point); |
946 } | 946 } |
947 | 947 |
948 bool GpuCommandBufferStub::OnWaitSyncPoint(uint32 sync_point) { | 948 bool GpuCommandBufferStub::OnWaitSyncPoint(uint32 sync_point) { |
949 DCHECK(!waiting_for_sync_point_); | 949 DCHECK(!waiting_for_sync_point_); |
950 DCHECK(scheduler_->scheduled()); | 950 DCHECK(scheduler_->scheduled()); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
986 scheduler_->SetScheduled(true); | 986 scheduler_->SetScheduled(true); |
987 } | 987 } |
988 | 988 |
989 void GpuCommandBufferStub::PullTextureUpdates( | 989 void GpuCommandBufferStub::PullTextureUpdates( |
990 gpu::CommandBufferNamespace namespace_id, | 990 gpu::CommandBufferNamespace namespace_id, |
991 uint64_t command_buffer_id, | 991 uint64_t command_buffer_id, |
992 uint32_t release) { | 992 uint32_t release) { |
993 gpu::gles2::MailboxManager* mailbox_manager = | 993 gpu::gles2::MailboxManager* mailbox_manager = |
994 context_group_->mailbox_manager(); | 994 context_group_->mailbox_manager(); |
995 if (mailbox_manager->UsesSync() && MakeCurrent()) { | 995 if (mailbox_manager->UsesSync() && MakeCurrent()) { |
996 gpu::SyncToken sync_token(namespace_id, command_buffer_id, release); | 996 gpu::SyncToken sync_token(namespace_id, 0, command_buffer_id, release); |
997 mailbox_manager->PullTextureUpdates(sync_token); | 997 mailbox_manager->PullTextureUpdates(sync_token); |
998 } | 998 } |
999 } | 999 } |
1000 | 1000 |
1001 void GpuCommandBufferStub::OnSignalSyncPoint(uint32 sync_point, uint32 id) { | 1001 void GpuCommandBufferStub::OnSignalSyncPoint(uint32 sync_point, uint32 id) { |
1002 sync_point_manager_->AddSyncPointCallback( | 1002 sync_point_manager_->AddSyncPointCallback( |
1003 sync_point, | 1003 sync_point, |
1004 base::Bind(&GpuCommandBufferStub::OnSignalAck, this->AsWeakPtr(), id)); | 1004 base::Bind(&GpuCommandBufferStub::OnSignalAck, this->AsWeakPtr(), id)); |
1005 } | 1005 } |
1006 | 1006 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1045 void GpuCommandBufferStub::OnFenceSyncRelease(uint64_t release) { | 1045 void GpuCommandBufferStub::OnFenceSyncRelease(uint64_t release) { |
1046 if (sync_point_client_->client_state()->IsFenceSyncReleased(release)) { | 1046 if (sync_point_client_->client_state()->IsFenceSyncReleased(release)) { |
1047 DLOG(ERROR) << "Fence Sync has already been released."; | 1047 DLOG(ERROR) << "Fence Sync has already been released."; |
1048 return; | 1048 return; |
1049 } | 1049 } |
1050 | 1050 |
1051 gpu::gles2::MailboxManager* mailbox_manager = | 1051 gpu::gles2::MailboxManager* mailbox_manager = |
1052 context_group_->mailbox_manager(); | 1052 context_group_->mailbox_manager(); |
1053 if (mailbox_manager->UsesSync() && MakeCurrent()) { | 1053 if (mailbox_manager->UsesSync() && MakeCurrent()) { |
1054 gpu::SyncToken sync_token(gpu::CommandBufferNamespace::GPU_IO, | 1054 gpu::SyncToken sync_token(gpu::CommandBufferNamespace::GPU_IO, |
1055 command_buffer_id_, release); | 1055 0, command_buffer_id_, release); |
1056 mailbox_manager->PushTextureUpdates(sync_token); | 1056 mailbox_manager->PushTextureUpdates(sync_token); |
1057 } | 1057 } |
1058 | 1058 |
1059 sync_point_client_->ReleaseFenceSync(release); | 1059 sync_point_client_->ReleaseFenceSync(release); |
1060 } | 1060 } |
1061 | 1061 |
1062 bool GpuCommandBufferStub::OnWaitFenceSync( | 1062 bool GpuCommandBufferStub::OnWaitFenceSync( |
1063 gpu::CommandBufferNamespace namespace_id, | 1063 gpu::CommandBufferNamespace namespace_id, |
1064 uint64_t command_buffer_id, | 1064 uint64_t command_buffer_id, |
1065 uint64_t release) { | 1065 uint64_t release) { |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1258 result)); | 1258 result)); |
1259 } | 1259 } |
1260 | 1260 |
1261 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, | 1261 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, |
1262 base::TimeDelta interval) { | 1262 base::TimeDelta interval) { |
1263 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, | 1263 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, |
1264 interval)); | 1264 interval)); |
1265 } | 1265 } |
1266 | 1266 |
1267 } // namespace content | 1267 } // namespace content |
OLD | NEW |