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

Unified Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 12330129: Make WaitSyncPoint go through command buffers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 7 years, 10 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 | « content/common/gpu/gpu_command_buffer_stub.h ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/gpu_command_buffer_stub.cc
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index c0cf2150bcdd69d23d04b73376b6682ec6abcc49..550c17433f05f26415d07ccc53718e2c66d05563 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -161,8 +161,7 @@ bool GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) {
// Echo, RetireSyncPoint, or WaitSyncPoint).
if (decoder_.get() &&
message.type() != GpuCommandBufferMsg_Echo::ID &&
- message.type() != GpuCommandBufferMsg_RetireSyncPoint::ID &&
- message.type() != GpuCommandBufferMsg_WaitSyncPoint::ID) {
+ message.type() != GpuCommandBufferMsg_RetireSyncPoint::ID) {
if (!MakeCurrent())
return false;
}
@@ -201,8 +200,6 @@ bool GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) {
OnEnsureBackbuffer)
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_RetireSyncPoint,
OnRetireSyncPoint)
- IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_WaitSyncPoint,
- OnWaitSyncPoint)
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalSyncPoint,
OnSignalSyncPoint)
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SendClientManagedMemoryStats,
@@ -225,8 +222,7 @@ bool GpuCommandBufferStub::Send(IPC::Message* message) {
}
bool GpuCommandBufferStub::IsScheduled() {
- return sync_point_wait_count_ == 0 &&
- (!scheduler_.get() || scheduler_->IsScheduled());
+ return (!scheduler_.get() || scheduler_->IsScheduled());
}
bool GpuCommandBufferStub::HasMoreWork() {
@@ -478,6 +474,9 @@ void GpuCommandBufferStub::OnInitialize(
decoder_->SetMsgCallback(
base::Bind(&GpuCommandBufferStub::SendConsoleMessage,
base::Unretained(this)));
+ decoder_->SetWaitSyncPointCallback(
+ base::Bind(&GpuCommandBufferStub::OnWaitSyncPoint,
+ base::Unretained(this)));
command_buffer_->SetPutOffsetChangeCallback(
base::Bind(&GpuCommandBufferStub::PutChanged, base::Unretained(this)));
@@ -758,17 +757,19 @@ void GpuCommandBufferStub::OnRetireSyncPoint(uint32 sync_point) {
manager->sync_point_manager()->RetireSyncPoint(sync_point);
}
-void GpuCommandBufferStub::OnWaitSyncPoint(uint32 sync_point) {
+bool GpuCommandBufferStub::OnWaitSyncPoint(uint32 sync_point) {
if (sync_point_wait_count_ == 0) {
TRACE_EVENT_ASYNC_BEGIN1("gpu", "WaitSyncPoint", this,
"GpuCommandBufferStub", this);
}
+ scheduler_->SetScheduled(false);
++sync_point_wait_count_;
GpuChannelManager* manager = channel_->gpu_channel_manager();
manager->sync_point_manager()->AddSyncPointCallback(
sync_point,
base::Bind(&GpuCommandBufferStub::OnSyncPointRetired,
this->AsWeakPtr()));
+ return scheduler_->IsScheduled();
}
void GpuCommandBufferStub::OnSyncPointRetired() {
@@ -777,7 +778,7 @@ void GpuCommandBufferStub::OnSyncPointRetired() {
TRACE_EVENT_ASYNC_END1("gpu", "WaitSyncPoint", this,
"GpuCommandBufferStub", this);
}
- OnReschedule();
+ scheduler_->SetScheduled(true);
}
void GpuCommandBufferStub::OnSignalSyncPoint(uint32 sync_point, uint32 id) {
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.h ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698