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

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

Issue 253943002: Remove CommandBuffer::GetState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: I forgot Poland^Wmojo Created 6 years, 8 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/client/command_buffer_proxy_impl.cc ('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 abb6288e1685d775398e49a6f61e88b0dffe060e..6f72157e4369183898cc185b6f169118f9ff6ce7 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -210,7 +210,6 @@ bool GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_ProduceFrontBuffer,
OnProduceFrontBuffer);
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_Echo, OnEcho);
- IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_GetState, OnGetState);
IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_WaitForTokenInRange,
OnWaitForTokenInRange);
IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_WaitForGetOffsetInRange,
@@ -394,7 +393,7 @@ void GpuCommandBufferStub::Destroy() {
bool have_context = false;
if (decoder_ && command_buffer_ &&
- command_buffer_->GetState().error != gpu::error::kLostContext)
+ command_buffer_->GetLastState().error != gpu::error::kLostContext)
have_context = decoder_->MakeCurrent();
FOR_EACH_OBSERVER(DestructionObserver,
destruction_observers_,
@@ -651,23 +650,10 @@ void GpuCommandBufferStub::OnProduceFrontBuffer(const gpu::Mailbox& mailbox) {
decoder_->ProduceFrontBuffer(mailbox);
}
-void GpuCommandBufferStub::OnGetState(IPC::Message* reply_message) {
- TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnGetState");
- if (command_buffer_) {
- gpu::CommandBuffer::State state = command_buffer_->GetState();
- CheckContextLost();
- GpuCommandBufferMsg_GetState::WriteReplyParams(reply_message, state);
- } else {
- DLOG(ERROR) << "no command_buffer.";
- reply_message->set_reply_error();
- }
- Send(reply_message);
-}
-
void GpuCommandBufferStub::OnParseError() {
TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnParseError");
DCHECK(command_buffer_.get());
- gpu::CommandBuffer::State state = command_buffer_->GetState();
+ gpu::CommandBuffer::State state = command_buffer_->GetLastState();
IPC::Message* msg = new GpuCommandBufferMsg_Destroyed(
route_id_, state.context_lost_reason);
msg->set_unblock(true);
@@ -714,7 +700,7 @@ void GpuCommandBufferStub::OnWaitForGetOffsetInRange(
void GpuCommandBufferStub::CheckCompleteWaits() {
if (wait_for_token_ || wait_for_get_offset_) {
- gpu::CommandBuffer::State state = command_buffer_->GetState();
+ gpu::CommandBuffer::State state = command_buffer_->GetLastState();
if (wait_for_token_ &&
(gpu::CommandBuffer::InRange(
wait_for_token_->start, wait_for_token_->end, state.token) ||
@@ -1042,7 +1028,7 @@ void GpuCommandBufferStub::SuggestHaveFrontBuffer(
bool GpuCommandBufferStub::CheckContextLost() {
DCHECK(command_buffer_);
- gpu::CommandBuffer::State state = command_buffer_->GetState();
+ gpu::CommandBuffer::State state = command_buffer_->GetLastState();
bool was_lost = state.error == gpu::error::kLostContext;
// Lose all other contexts if the reset was triggered by the robustness
// extension instead of being synthetic.
@@ -1056,7 +1042,7 @@ bool GpuCommandBufferStub::CheckContextLost() {
void GpuCommandBufferStub::MarkContextLost() {
if (!command_buffer_ ||
- command_buffer_->GetState().error == gpu::error::kLostContext)
+ command_buffer_->GetLastState().error == gpu::error::kLostContext)
return;
command_buffer_->SetContextLostReason(gpu::error::kUnknown);
« no previous file with comments | « content/common/gpu/client/command_buffer_proxy_impl.cc ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698