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

Unified Diff: gpu/command_buffer/tests/gl_manager.cc

Issue 2752393002: gpu: Add SequenceId for identifying sync point sequences. (Closed)
Patch Set: piman's review 3 Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/tests/gl_manager.h ('k') | gpu/ipc/in_process_command_buffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/tests/gl_manager.cc
diff --git a/gpu/command_buffer/tests/gl_manager.cc b/gpu/command_buffer/tests/gl_manager.cc
index 9ad1017c65715c49be8d4d2e39f5a526ffce22ea..23363d4da957f84eaa68aa62c5e2cdb4aa939dfc 100644
--- a/gpu/command_buffer/tests/gl_manager.cc
+++ b/gpu/command_buffer/tests/gl_manager.cc
@@ -55,7 +55,7 @@
namespace gpu {
namespace {
-uint64_t g_next_command_buffer_id = 0;
+uint64_t g_next_command_buffer_id = 1;
void InitializeGpuPreferencesForTestingFromCommandLine(
const base::CommandLine& command_line,
@@ -349,10 +349,10 @@ void GLManager::InitializeWithCommandLine(
if (options.sync_point_manager) {
sync_point_manager_ = options.sync_point_manager;
- sync_point_order_data_ = SyncPointOrderData::Create();
- sync_point_client_ = base::MakeUnique<SyncPointClient>(
- sync_point_manager_, sync_point_order_data_, GetNamespaceID(),
- GetCommandBufferID());
+ sync_point_order_data_ = sync_point_manager_->CreateSyncPointOrderData();
+ sync_point_client_state_ = sync_point_manager_->CreateSyncPointClientState(
+ GetNamespaceID(), GetCommandBufferID(),
+ sync_point_order_data_->sequence_id());
decoder_->SetFenceSyncReleaseCallback(
base::Bind(&GLManager::OnFenceSyncRelease, base::Unretained(this)));
@@ -361,7 +361,7 @@ void GLManager::InitializeWithCommandLine(
} else {
sync_point_manager_ = nullptr;
sync_point_order_data_ = nullptr;
- sync_point_client_ = nullptr;
+ sync_point_client_state_ = nullptr;
}
command_buffer_->SetPutOffsetChangeCallback(
@@ -409,9 +409,9 @@ void GLManager::SetupBaseContext() {
}
void GLManager::OnFenceSyncRelease(uint64_t release) {
- DCHECK(sync_point_client_);
+ DCHECK(sync_point_client_state_);
command_buffer_->SetReleaseCount(release);
- sync_point_client_->ReleaseFenceSync(release);
+ sync_point_client_state_->ReleaseFenceSync(release);
}
bool GLManager::OnWaitSyncToken(const SyncToken& sync_token) {
@@ -445,11 +445,14 @@ void GLManager::Destroy() {
gles2_helper_.reset();
command_buffer_.reset();
sync_point_manager_ = nullptr;
- sync_point_client_ = nullptr;
if (sync_point_order_data_) {
sync_point_order_data_->Destroy();
sync_point_order_data_ = nullptr;
}
+ if (sync_point_client_state_) {
+ sync_point_client_state_->Destroy();
+ sync_point_client_state_ = nullptr;
+ }
if (decoder_.get()) {
bool have_context = decoder_->GetGLContext() &&
decoder_->GetGLContext()->MakeCurrent(surface_.get());
@@ -476,8 +479,7 @@ void GLManager::PumpCommands() {
order_num = paused_order_num_;
paused_order_num_ = 0;
} else {
- order_num = sync_point_order_data_->GenerateUnprocessedOrderNumber(
- sync_point_manager_);
+ order_num = sync_point_order_data_->GenerateUnprocessedOrderNumber();
}
sync_point_order_data_->BeginProcessingOrderNumber(order_num);
}
@@ -610,10 +612,10 @@ void GLManager::SignalSyncToken(const gpu::SyncToken& sync_token,
const base::Closure& callback) {
if (sync_point_manager_) {
DCHECK(!paused_order_num_);
- uint32_t order_num = sync_point_order_data_->GenerateUnprocessedOrderNumber(
- sync_point_manager_);
+ uint32_t order_num =
+ sync_point_order_data_->GenerateUnprocessedOrderNumber();
sync_point_order_data_->BeginProcessingOrderNumber(order_num);
- if (!sync_point_client_->Wait(sync_token, callback))
+ if (!sync_point_client_state_->Wait(sync_token, callback))
callback.Run();
sync_point_order_data_->FinishProcessingOrderNumber(order_num);
} else {
« no previous file with comments | « gpu/command_buffer/tests/gl_manager.h ('k') | gpu/ipc/in_process_command_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698