Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Side by Side Diff: content/common/gpu/client/command_buffer_proxy_impl.cc

Issue 1559893003: Added method to synchronize command buffers within GpuControl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: SynchronizeCommandBuffer() -> EnsureWorkVisible() Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/common/gpu/client/command_buffer_proxy_impl.h" 5 #include "content/common/gpu/client/command_buffer_proxy_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 params.image_release_count = image_fence_sync; 448 params.image_release_count = image_fence_sync;
449 449
450 if (!Send(new GpuCommandBufferMsg_CreateImage(route_id_, params))) 450 if (!Send(new GpuCommandBufferMsg_CreateImage(route_id_, params)))
451 return -1; 451 return -1;
452 452
453 if (image_fence_sync) { 453 if (image_fence_sync) {
454 gpu::SyncToken sync_token(GetNamespaceID(), GetExtraCommandBufferData(), 454 gpu::SyncToken sync_token(GetNamespaceID(), GetExtraCommandBufferData(),
455 GetCommandBufferID(), image_fence_sync); 455 GetCommandBufferID(), image_fence_sync);
456 456
457 // Force a synchronous IPC to validate sync token. 457 // Force a synchronous IPC to validate sync token.
458 channel_->ValidateFlushIDReachedServer(stream_id_, true); 458 EnsureWorkVisible();
459 sync_token.SetVerifyFlush(); 459 sync_token.SetVerifyFlush();
460 460
461 gpu_memory_buffer_manager->SetDestructionSyncToken(gpu_memory_buffer, 461 gpu_memory_buffer_manager->SetDestructionSyncToken(gpu_memory_buffer,
462 sync_token); 462 sync_token);
463 } 463 }
464 464
465 return new_id; 465 return new_id;
466 } 466 }
467 467
468 void CommandBufferProxyImpl::DestroyImage(int32_t id) { 468 void CommandBufferProxyImpl::DestroyImage(int32_t id) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 } 507 }
508 508
509 void CommandBufferProxyImpl::SetLock(base::Lock* lock) { 509 void CommandBufferProxyImpl::SetLock(base::Lock* lock) {
510 lock_ = lock; 510 lock_ = lock;
511 } 511 }
512 512
513 bool CommandBufferProxyImpl::IsGpuChannelLost() { 513 bool CommandBufferProxyImpl::IsGpuChannelLost() {
514 return !channel_ || channel_->IsLost(); 514 return !channel_ || channel_->IsLost();
515 } 515 }
516 516
517 void CommandBufferProxyImpl::EnsureWorkVisible() {
518 channel_->ValidateFlushIDReachedServer(stream_id_, true);
519 }
520
517 gpu::CommandBufferNamespace CommandBufferProxyImpl::GetNamespaceID() const { 521 gpu::CommandBufferNamespace CommandBufferProxyImpl::GetNamespaceID() const {
518 return gpu::CommandBufferNamespace::GPU_IO; 522 return gpu::CommandBufferNamespace::GPU_IO;
519 } 523 }
520 524
521 uint64_t CommandBufferProxyImpl::GetCommandBufferID() const { 525 uint64_t CommandBufferProxyImpl::GetCommandBufferID() const {
522 return command_buffer_id_; 526 return command_buffer_id_;
523 } 527 }
524 528
525 int32_t CommandBufferProxyImpl::GetExtraCommandBufferData() const { 529 int32_t CommandBufferProxyImpl::GetExtraCommandBufferData() const {
526 return stream_id_; 530 return stream_id_;
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 } 772 }
769 } 773 }
770 774
771 void CommandBufferProxyImpl::OnUpdateVSyncParameters(base::TimeTicks timebase, 775 void CommandBufferProxyImpl::OnUpdateVSyncParameters(base::TimeTicks timebase,
772 base::TimeDelta interval) { 776 base::TimeDelta interval) {
773 if (!update_vsync_parameters_completion_callback_.is_null()) 777 if (!update_vsync_parameters_completion_callback_.is_null())
774 update_vsync_parameters_completion_callback_.Run(timebase, interval); 778 update_vsync_parameters_completion_callback_.Run(timebase, interval);
775 } 779 }
776 780
777 } // namespace content 781 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/client/command_buffer_proxy_impl.h ('k') | gpu/command_buffer/client/client_test_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698