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

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

Issue 11316238: gpu: don't try to discard/recreate backbuffer while draws are deferred. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reset currently_processing_message_ in RequeueMessage Created 8 years, 1 month 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_channel.h ('k') | content/common/gpu/gpu_command_buffer_stub.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/gpu_channel.cc
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc
index 31a116ebe67fe567804b11dfa2a06007faa3a9d8..64e6a1943216664be4528788aeab5b60ac8dd0d0 100644
--- a/content/common/gpu/gpu_channel.cc
+++ b/content/common/gpu/gpu_channel.cc
@@ -235,6 +235,7 @@ GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager,
software_(software),
handle_messages_scheduled_(false),
processed_get_state_fast_(false),
+ currently_processing_message_(NULL),
weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
DCHECK(gpu_channel_manager);
DCHECK(client_id);
@@ -360,6 +361,14 @@ bool GpuChannel::Send(IPC::Message* message) {
return channel_->Send(message);
}
+void GpuChannel::RequeueMessage() {
+ DCHECK(currently_processing_message_);
+ deferred_messages_.push_front(
+ new IPC::Message(*currently_processing_message_));
+ unprocessed_messages_->IncCount();
+ currently_processing_message_ = NULL;
+}
+
void GpuChannel::OnScheduled() {
if (handle_messages_scheduled_)
return;
@@ -540,8 +549,13 @@ void GpuChannel::HandleMessage() {
processed_get_state_fast_ =
(message->type() == GpuCommandBufferMsg_GetStateFast::ID);
+
+ currently_processing_message_ = message.get();
+ bool result = router_.RouteMessage(*message);
+ currently_processing_message_ = NULL;
+
// Handle deferred control messages.
- if (!router_.RouteMessage(*message)) {
+ if (!result) {
// Respond to sync messages even if router failed to route.
if (message->is_sync()) {
IPC::Message* reply = IPC::SyncMessage::GenerateReply(&*message);
« no previous file with comments | « content/common/gpu/gpu_channel.h ('k') | content/common/gpu/gpu_command_buffer_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698