OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/mus/gles2/command_buffer_local.h" | 5 #include "components/mus/gles2/command_buffer_local.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "components/mus/gles2/command_buffer_local_client.h" | 8 #include "components/mus/gles2/command_buffer_local_client.h" |
9 #include "components/mus/gles2/gpu_memory_tracker.h" | 9 #include "components/mus/gles2/gpu_memory_tracker.h" |
10 #include "components/mus/gles2/mojo_gpu_memory_buffer.h" | 10 #include "components/mus/gles2/mojo_gpu_memory_buffer.h" |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 | 243 |
244 bool CommandBufferLocal::OnWaitSyncPoint(uint32_t sync_point) { | 244 bool CommandBufferLocal::OnWaitSyncPoint(uint32_t sync_point) { |
245 if (!sync_point) | 245 if (!sync_point) |
246 return true; | 246 return true; |
247 if (gpu_state_->sync_point_manager()->IsSyncPointRetired(sync_point)) | 247 if (gpu_state_->sync_point_manager()->IsSyncPointRetired(sync_point)) |
248 return true; | 248 return true; |
249 scheduler_->SetScheduled(false); | 249 scheduler_->SetScheduled(false); |
250 gpu_state_->sync_point_manager()->AddSyncPointCallback( | 250 gpu_state_->sync_point_manager()->AddSyncPointCallback( |
251 sync_point, base::Bind(&CommandBufferLocal::OnSyncPointRetired, | 251 sync_point, base::Bind(&CommandBufferLocal::OnSyncPointRetired, |
252 weak_factory_.GetWeakPtr())); | 252 weak_factory_.GetWeakPtr())); |
253 return scheduler_->IsScheduled(); | 253 return scheduler_->scheduled(); |
254 } | 254 } |
255 | 255 |
256 void CommandBufferLocal::OnParseError() { | 256 void CommandBufferLocal::OnParseError() { |
257 gpu::CommandBuffer::State state = command_buffer_->GetLastState(); | 257 gpu::CommandBuffer::State state = command_buffer_->GetLastState(); |
258 OnContextLost(state.context_lost_reason); | 258 OnContextLost(state.context_lost_reason); |
259 } | 259 } |
260 | 260 |
261 void CommandBufferLocal::OnContextLost(uint32_t reason) { | 261 void CommandBufferLocal::OnContextLost(uint32_t reason) { |
262 if (client_) | 262 if (client_) |
263 client_->DidLoseContext(); | 263 client_->DidLoseContext(); |
264 } | 264 } |
265 | 265 |
266 void CommandBufferLocal::OnSyncPointRetired() { | 266 void CommandBufferLocal::OnSyncPointRetired() { |
267 scheduler_->SetScheduled(true); | 267 scheduler_->SetScheduled(true); |
268 } | 268 } |
269 | 269 |
270 } // namespace mus | 270 } // namespace mus |
OLD | NEW |