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

Side by Side Diff: gpu/ipc/service/gpu_command_buffer_stub.cc

Issue 2726743002: gpu: Do not call MakeCurrent in wait sync token callback. (Closed)
Patch Set: rebase 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "gpu/ipc/service/gpu_command_buffer_stub.h" 5 #include "gpu/ipc/service/gpu_command_buffer_stub.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 if (mailbox_manager->UsesSync() && MakeCurrent()) 1086 if (mailbox_manager->UsesSync() && MakeCurrent())
1087 mailbox_manager->PullTextureUpdates(sync_token); 1087 mailbox_manager->PullTextureUpdates(sync_token);
1088 return false; 1088 return false;
1089 } 1089 }
1090 1090
1091 void GpuCommandBufferStub::OnWaitSyncTokenCompleted( 1091 void GpuCommandBufferStub::OnWaitSyncTokenCompleted(
1092 const SyncToken& sync_token) { 1092 const SyncToken& sync_token) {
1093 DCHECK(waiting_for_sync_point_); 1093 DCHECK(waiting_for_sync_point_);
1094 TRACE_EVENT_ASYNC_END1("gpu", "WaitSyncTokenCompleted", this, 1094 TRACE_EVENT_ASYNC_END1("gpu", "WaitSyncTokenCompleted", this,
1095 "GpuCommandBufferStub", this); 1095 "GpuCommandBufferStub", this);
1096 // Don't call PullTextureUpdates here because we can't MakeCurrent if we're
1097 // executing commands on another context. The WaitSyncToken command will run
1098 // again and call PullTextureUpdates once this command buffer gets scheduled.
1096 waiting_for_sync_point_ = false; 1099 waiting_for_sync_point_ = false;
1097
1098 gles2::MailboxManager* mailbox_manager = context_group_->mailbox_manager();
1099 if (mailbox_manager->UsesSync() && MakeCurrent())
1100 mailbox_manager->PullTextureUpdates(sync_token);
1101
1102 executor_->SetScheduled(true); 1100 executor_->SetScheduled(true);
1103 channel_->OnStreamRescheduled(stream_id_, true); 1101 channel_->OnStreamRescheduled(stream_id_, true);
1104 } 1102 }
1105 1103
1106 void GpuCommandBufferStub::OnCreateImage( 1104 void GpuCommandBufferStub::OnCreateImage(
1107 const GpuCommandBufferMsg_CreateImage_Params& params) { 1105 const GpuCommandBufferMsg_CreateImage_Params& params) {
1108 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnCreateImage"); 1106 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnCreateImage");
1109 const int32_t id = params.id; 1107 const int32_t id = params.id;
1110 const gfx::GpuMemoryBufferHandle& handle = params.gpu_memory_buffer; 1108 const gfx::GpuMemoryBufferHandle& handle = params.gpu_memory_buffer;
1111 const gfx::Size& size = params.size; 1109 const gfx::Size& size = params.size;
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 command_buffer_->GetLastState().error == error::kLostContext) 1227 command_buffer_->GetLastState().error == error::kLostContext)
1230 return; 1228 return;
1231 1229
1232 command_buffer_->SetContextLostReason(error::kUnknown); 1230 command_buffer_->SetContextLostReason(error::kUnknown);
1233 if (decoder_) 1231 if (decoder_)
1234 decoder_->MarkContextLost(error::kUnknown); 1232 decoder_->MarkContextLost(error::kUnknown);
1235 command_buffer_->SetParseError(error::kLostContext); 1233 command_buffer_->SetParseError(error::kLostContext);
1236 } 1234 }
1237 1235
1238 } // namespace gpu 1236 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698