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

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

Issue 1331843005: Implemented new fence syncs which replaces the old sync points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed memory leak Created 5 years, 3 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
Index: content/common/gpu/gpu_channel.cc
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc
index 4a43a7522d538046d3bbfa9377d5d761300fe185..a6924c0ddce9499ad259906c9aec534bcb438125 100644
--- a/content/common/gpu/gpu_channel.cc
+++ b/content/common/gpu/gpu_channel.cc
@@ -76,16 +76,16 @@ scoped_refptr<GpuChannelMessageQueue> GpuChannelMessageQueue::Create(
return new GpuChannelMessageQueue(gpu_channel, task_runner);
}
-scoped_refptr<gpu::SyncPointClientState>
- GpuChannelMessageQueue::GetSyncPointClientState() {
- return sync_point_client_state_;
+scoped_refptr<gpu::SyncPointOrderData>
+ GpuChannelMessageQueue::GetSyncPointOrderData() {
+ return sync_point_order_data_;
}
GpuChannelMessageQueue::GpuChannelMessageQueue(
const base::WeakPtr<GpuChannel>& gpu_channel,
base::SingleThreadTaskRunner* task_runner)
: enabled_(true),
- sync_point_client_state_(gpu::SyncPointClientState::Create()),
+ sync_point_order_data_(gpu::SyncPointOrderData::Create()),
gpu_channel_(gpu_channel),
task_runner_(task_runner) {}
@@ -94,11 +94,11 @@ GpuChannelMessageQueue::~GpuChannelMessageQueue() {
}
uint32_t GpuChannelMessageQueue::GetUnprocessedOrderNum() const {
- return sync_point_client_state_->unprocessed_order_num();
+ return sync_point_order_data_->unprocessed_order_num();
}
uint32_t GpuChannelMessageQueue::GetProcessedOrderNum() const {
- return sync_point_client_state_->processed_order_num();
+ return sync_point_order_data_->processed_order_num();
}
void GpuChannelMessageQueue::PushBackMessage(
@@ -147,9 +147,9 @@ GpuChannelMessage* GpuChannelMessageQueue::GetNextMessage() const {
base::AutoLock auto_lock(channel_messages_lock_);
if (!channel_messages_.empty()) {
DCHECK_GT(channel_messages_.front()->order_number,
- sync_point_client_state_->processed_order_num());
+ sync_point_order_data_->processed_order_num());
DCHECK_LE(channel_messages_.front()->order_number,
- sync_point_client_state_->unprocessed_order_num());
+ sync_point_order_data_->unprocessed_order_num());
return channel_messages_.front();
}
@@ -158,7 +158,7 @@ GpuChannelMessage* GpuChannelMessageQueue::GetNextMessage() const {
void GpuChannelMessageQueue::BeginMessageProcessing(
const GpuChannelMessage* msg) {
- sync_point_client_state_->BeginProcessingOrderNumber(msg->order_number);
+ sync_point_order_data_->BeginProcessingOrderNumber(msg->order_number);
}
bool GpuChannelMessageQueue::MessageProcessed() {
@@ -166,7 +166,7 @@ bool GpuChannelMessageQueue::MessageProcessed() {
DCHECK(!channel_messages_.empty());
scoped_ptr<GpuChannelMessage> msg(channel_messages_.front());
channel_messages_.pop_front();
- sync_point_client_state_->FinishProcessingOrderNumber(msg->order_number);
+ sync_point_order_data_->FinishProcessingOrderNumber(msg->order_number);
return !channel_messages_.empty();
}
@@ -193,6 +193,11 @@ void GpuChannelMessageQueue::DeleteAndDisableMessages(
msg->sync_point);
}
}
+
+ if (sync_point_order_data_) {
+ sync_point_order_data_->Destroy();
+ sync_point_order_data_ = nullptr;
+ }
}
void GpuChannelMessageQueue::ScheduleHandleMessage() {
@@ -207,7 +212,7 @@ void GpuChannelMessageQueue::PushMessageHelper(
DCHECK(enabled_);
msg->order_number =
- sync_point_client_state_->GenerateUnprocessedOrderNumber(
+ sync_point_order_data_->GenerateUnprocessedOrderNumber(
sync_point_manager);
msg->time_received = base::TimeTicks::Now();
@@ -301,6 +306,9 @@ bool GpuChannelMessageFilter::OnMessageReceived(const IPC::Message& message) {
return true;
}
+ if (message.type() == GpuChannelMsg_Nop::ID)
+ return true;
piman 2015/09/30 22:50:22 You will need to send the reply here. This is typi
David Yen 2015/09/30 23:55:18 Done.
+
for (scoped_refptr<IPC::MessageFilter>& filter : channel_filters_) {
if (filter->OnMessageReceived(message)) {
return true;
@@ -788,8 +796,8 @@ bool GpuChannel::OnControlMessageReceived(const IPC::Message& msg) {
return handled;
}
-scoped_refptr<gpu::SyncPointClientState> GpuChannel::GetSyncPointClientState() {
- return message_queue_->GetSyncPointClientState();
+scoped_refptr<gpu::SyncPointOrderData> GpuChannel::GetSyncPointOrderData() {
+ return message_queue_->GetSyncPointOrderData();
}
void GpuChannel::HandleMessage() {

Powered by Google App Engine
This is Rietveld 408576698