summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-30 01:26:33 +0000
committerpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-30 01:26:33 +0000
commit68957916094e7d2eabaccab37ca70da3aff44499 (patch)
tree744b90667b6a884291144adaba9e18fad694ed92
parent292b1692914b12c4427784a923de0d0615e57d2d (diff)
downloadchromium_src-68957916094e7d2eabaccab37ca70da3aff44499.zip
chromium_src-68957916094e7d2eabaccab37ca70da3aff44499.tar.gz
chromium_src-68957916094e7d2eabaccab37ca70da3aff44499.tar.bz2
Remove CommandBuffer::GetState
https://codereview.chromium.org/220243003 removed the last client-side caller. Service-side implementation of GetState is identical to GetLastState. So replace all instances of GetState by GetLastState and remove the former. BUG=None Review URL: https://codereview.chromium.org/253943002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267027 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/common/gpu/client/command_buffer_proxy_impl.cc12
-rw-r--r--content/common/gpu/client/command_buffer_proxy_impl.h1
-rw-r--r--content/common/gpu/gpu_command_buffer_stub.cc24
-rw-r--r--content/common/gpu/gpu_messages.h4
-rw-r--r--content/renderer/pepper/ppb_graphics_3d_impl.cc4
-rw-r--r--content/renderer/pepper/ppb_graphics_3d_impl.h1
-rw-r--r--gpu/command_buffer/client/client_test_helper.cc4
-rw-r--r--gpu/command_buffer/client/client_test_helper.h1
-rw-r--r--gpu/command_buffer/client/cmd_buffer_helper_test.cc6
-rw-r--r--gpu/command_buffer/client/fenced_allocator_test.cc2
-rw-r--r--gpu/command_buffer/client/gles2_implementation_unittest.cc2
-rw-r--r--gpu/command_buffer/client/mapped_memory_unittest.cc2
-rw-r--r--gpu/command_buffer/client/ring_buffer_test.cc4
-rw-r--r--gpu/command_buffer/common/command_buffer.h3
-rw-r--r--gpu/command_buffer/common/command_buffer_mock.h1
-rw-r--r--gpu/command_buffer/service/command_buffer_service.cc10
-rw-r--r--gpu/command_buffer/service/command_buffer_service.h1
-rw-r--r--gpu/command_buffer/service/command_buffer_service_unittest.cc10
-rw-r--r--gpu/command_buffer/service/gpu_scheduler.cc2
-rw-r--r--gpu/command_buffer/service/gpu_scheduler_unittest.cc14
-rw-r--r--gpu/command_buffer/service/in_process_command_buffer.cc9
-rw-r--r--gpu/command_buffer/service/in_process_command_buffer.h1
-rw-r--r--gpu/command_buffer/tests/gl_manager.cc2
-rw-r--r--mojo/examples/pepper_container_app/graphics_3d_resource.cc5
-rw-r--r--mojo/examples/pepper_container_app/graphics_3d_resource.h1
-rw-r--r--mojo/gles2/command_buffer_client_impl.cc5
-rw-r--r--mojo/gles2/command_buffer_client_impl.h1
-rw-r--r--mojo/services/gles2/command_buffer_impl.cc4
-rw-r--r--ppapi/proxy/ppapi_command_buffer_proxy.cc14
-rw-r--r--ppapi/proxy/ppapi_command_buffer_proxy.h1
-rw-r--r--ppapi/proxy/ppapi_messages.h4
-rw-r--r--ppapi/proxy/ppb_graphics_3d_proxy.cc18
-rw-r--r--ppapi/proxy/ppb_graphics_3d_proxy.h4
-rw-r--r--ppapi/thunk/ppb_graphics_3d_api.h1
34 files changed, 34 insertions, 144 deletions
diff --git a/content/common/gpu/client/command_buffer_proxy_impl.cc b/content/common/gpu/client/command_buffer_proxy_impl.cc
index b24823a..b24e7c6 100644
--- a/content/common/gpu/client/command_buffer_proxy_impl.cc
+++ b/content/common/gpu/client/command_buffer_proxy_impl.cc
@@ -163,18 +163,6 @@ bool CommandBufferProxyImpl::Initialize() {
return true;
}
-gpu::CommandBuffer::State CommandBufferProxyImpl::GetState() {
- // Send will flag state with lost context if IPC fails.
- if (last_state_.error == gpu::error::kNoError) {
- gpu::CommandBuffer::State state;
- if (Send(new GpuCommandBufferMsg_GetState(route_id_, &state)))
- OnUpdateState(state);
- }
-
- TryUpdateState();
- return last_state_;
-}
-
gpu::CommandBuffer::State CommandBufferProxyImpl::GetLastState() {
return last_state_;
}
diff --git a/content/common/gpu/client/command_buffer_proxy_impl.h b/content/common/gpu/client/command_buffer_proxy_impl.h
index 4163cb6..c1227ae 100644
--- a/content/common/gpu/client/command_buffer_proxy_impl.h
+++ b/content/common/gpu/client/command_buffer_proxy_impl.h
@@ -89,7 +89,6 @@ class CommandBufferProxyImpl
// CommandBuffer implementation:
virtual bool Initialize() OVERRIDE;
- virtual State GetState() OVERRIDE;
virtual State GetLastState() OVERRIDE;
virtual int32 GetLastToken() OVERRIDE;
virtual void Flush(int32 put_offset) OVERRIDE;
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index abb6288..6f72157 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);
diff --git a/content/common/gpu/gpu_messages.h b/content/common/gpu/gpu_messages.h
index d304367..b283e9a 100644
--- a/content/common/gpu/gpu_messages.h
+++ b/content/common/gpu/gpu_messages.h
@@ -508,10 +508,6 @@ IPC_SYNC_MESSAGE_ROUTED1_0(GpuCommandBufferMsg_SetGetBuffer,
IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_ProduceFrontBuffer,
gpu::Mailbox /* mailbox */)
-// Get the current state of the command buffer.
-IPC_SYNC_MESSAGE_ROUTED0_1(GpuCommandBufferMsg_GetState,
- gpu::CommandBuffer::State /* state */)
-
// Wait until the token is in a specific range, inclusive.
IPC_SYNC_MESSAGE_ROUTED2_1(GpuCommandBufferMsg_WaitForTokenInRange,
int32 /* start */,
diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.cc b/content/renderer/pepper/ppb_graphics_3d_impl.cc
index 8a0859c..fa5d6c8 100644
--- a/content/renderer/pepper/ppb_graphics_3d_impl.cc
+++ b/content/renderer/pepper/ppb_graphics_3d_impl.cc
@@ -89,10 +89,6 @@ PP_Bool PPB_Graphics3D_Impl::SetGetBuffer(int32_t transfer_buffer_id) {
return PP_TRUE;
}
-gpu::CommandBuffer::State PPB_Graphics3D_Impl::GetState() {
- return GetCommandBuffer()->GetState();
-}
-
scoped_refptr<gpu::Buffer> PPB_Graphics3D_Impl::CreateTransferBuffer(
uint32_t size,
int32_t* id) {
diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.h b/content/renderer/pepper/ppb_graphics_3d_impl.h
index 6594dce..e721be6 100644
--- a/content/renderer/pepper/ppb_graphics_3d_impl.h
+++ b/content/renderer/pepper/ppb_graphics_3d_impl.h
@@ -23,7 +23,6 @@ class PPB_Graphics3D_Impl : public ppapi::PPB_Graphics3D_Shared {
// PPB_Graphics3D_API trusted implementation.
virtual PP_Bool SetGetBuffer(int32_t transfer_buffer_id) OVERRIDE;
- virtual gpu::CommandBuffer::State GetState() OVERRIDE;
virtual scoped_refptr<gpu::Buffer> CreateTransferBuffer(uint32_t size,
int32* id) OVERRIDE;
virtual PP_Bool DestroyTransferBuffer(int32_t id) OVERRIDE;
diff --git a/gpu/command_buffer/client/client_test_helper.cc b/gpu/command_buffer/client/client_test_helper.cc
index 46011ad..8c633ef 100644
--- a/gpu/command_buffer/client/client_test_helper.cc
+++ b/gpu/command_buffer/client/client_test_helper.cc
@@ -25,10 +25,6 @@ bool MockCommandBufferBase::Initialize() {
return true;
}
-CommandBuffer::State MockCommandBufferBase::GetState() {
- return state_;
-}
-
CommandBuffer::State MockCommandBufferBase::GetLastState() {
return state_;
}
diff --git a/gpu/command_buffer/client/client_test_helper.h b/gpu/command_buffer/client/client_test_helper.h
index 011d31f..22ffea6 100644
--- a/gpu/command_buffer/client/client_test_helper.h
+++ b/gpu/command_buffer/client/client_test_helper.h
@@ -29,7 +29,6 @@ class MockCommandBufferBase : public CommandBufferServiceBase {
virtual ~MockCommandBufferBase();
virtual bool Initialize() OVERRIDE;
- virtual State GetState() OVERRIDE;
virtual State GetLastState() OVERRIDE;
virtual int32 GetLastToken() OVERRIDE;
virtual void WaitForTokenInRange(int32 start, int32 end) OVERRIDE;
diff --git a/gpu/command_buffer/client/cmd_buffer_helper_test.cc b/gpu/command_buffer/client/cmd_buffer_helper_test.cc
index 1890477..42d8b4b 100644
--- a/gpu/command_buffer/client/cmd_buffer_helper_test.cc
+++ b/gpu/command_buffer/client/cmd_buffer_helper_test.cc
@@ -231,11 +231,11 @@ class CommandBufferHelperTest : public testing::Test {
}
int32 GetGetOffset() {
- return command_buffer_->GetState().get_offset;
+ return command_buffer_->GetLastState().get_offset;
}
int32 GetPutOffset() {
- return command_buffer_->GetState().put_offset;
+ return command_buffer_->GetLastState().put_offset;
}
int32 GetHelperGetOffset() { return helper_->get_offset(); }
@@ -245,7 +245,7 @@ class CommandBufferHelperTest : public testing::Test {
uint32 GetHelperFlushGeneration() { return helper_->flush_generation(); }
error::Error GetError() {
- return command_buffer_->GetState().error;
+ return command_buffer_->GetLastState().error;
}
CommandBufferOffset get_helper_put() { return helper_->put_; }
diff --git a/gpu/command_buffer/client/fenced_allocator_test.cc b/gpu/command_buffer/client/fenced_allocator_test.cc
index 2db1328..7ac35d4 100644
--- a/gpu/command_buffer/client/fenced_allocator_test.cc
+++ b/gpu/command_buffer/client/fenced_allocator_test.cc
@@ -71,7 +71,7 @@ class BaseFencedAllocatorTest : public testing::Test {
}
int32 GetToken() {
- return command_buffer_->GetState().token;
+ return command_buffer_->GetLastState().token;
}
#if defined(OS_MACOSX)
diff --git a/gpu/command_buffer/client/gles2_implementation_unittest.cc b/gpu/command_buffer/client/gles2_implementation_unittest.cc
index 9224424..5ab9f0e 100644
--- a/gpu/command_buffer/client/gles2_implementation_unittest.cc
+++ b/gpu/command_buffer/client/gles2_implementation_unittest.cc
@@ -466,7 +466,7 @@ class GLES2ImplementationTest : public testing::Test {
scoped_refptr<Buffer> ring_buffer = helper_->get_ring_buffer();
commands_ = static_cast<CommandBufferEntry*>(ring_buffer->memory()) +
- command_buffer()->GetState().put_offset;
+ command_buffer()->GetLastState().put_offset;
ClearCommands();
EXPECT_TRUE(transfer_buffer_->InSync());
diff --git a/gpu/command_buffer/client/mapped_memory_unittest.cc b/gpu/command_buffer/client/mapped_memory_unittest.cc
index 4ebe5ec..a7dcf9e 100644
--- a/gpu/command_buffer/client/mapped_memory_unittest.cc
+++ b/gpu/command_buffer/client/mapped_memory_unittest.cc
@@ -68,7 +68,7 @@ class MappedMemoryTestBase : public testing::Test {
}
int32 GetToken() {
- return command_buffer_->GetState().token;
+ return command_buffer_->GetLastState().token;
}
#if defined(OS_MACOSX)
diff --git a/gpu/command_buffer/client/ring_buffer_test.cc b/gpu/command_buffer/client/ring_buffer_test.cc
index 0501428..e46ec43c 100644
--- a/gpu/command_buffer/client/ring_buffer_test.cc
+++ b/gpu/command_buffer/client/ring_buffer_test.cc
@@ -92,7 +92,7 @@ class BaseRingBufferTest : public testing::Test {
}
int32 GetToken() {
- return command_buffer_->GetState().token;
+ return command_buffer_->GetLastState().token;
}
#if defined(OS_MACOSX)
@@ -295,7 +295,7 @@ TEST_F(RingBufferWrapperTest, TestFreePendingToken) {
EXPECT_LE(tokens[0], GetToken());
allocator_->FreePendingToken(pointer1, helper_->InsertToken());
- EXPECT_LE(command_buffer_->GetState().token, helper_->InsertToken());
+ EXPECT_LE(command_buffer_->GetLastState().token, helper_->InsertToken());
}
} // namespace gpu
diff --git a/gpu/command_buffer/common/command_buffer.h b/gpu/command_buffer/common/command_buffer.h
index 74cefe8..61b9142 100644
--- a/gpu/command_buffer/common/command_buffer.h
+++ b/gpu/command_buffer/common/command_buffer.h
@@ -82,9 +82,6 @@ class GPU_EXPORT CommandBuffer {
// Initialize the command buffer with the given size.
virtual bool Initialize() = 0;
- // Returns the current status.
- virtual State GetState() = 0;
-
// Returns the last state without synchronizing with the service.
virtual State GetLastState() = 0;
diff --git a/gpu/command_buffer/common/command_buffer_mock.h b/gpu/command_buffer/common/command_buffer_mock.h
index 7583b03..1877470 100644
--- a/gpu/command_buffer/common/command_buffer_mock.h
+++ b/gpu/command_buffer/common/command_buffer_mock.h
@@ -22,7 +22,6 @@ class MockCommandBuffer : public CommandBufferServiceBase {
virtual ~MockCommandBuffer();
MOCK_METHOD0(Initialize, bool());
- MOCK_METHOD0(GetState, State());
MOCK_METHOD0(GetLastState, State());
MOCK_METHOD0(GetLastToken, int32());
MOCK_METHOD1(Flush, void(int32 put_offset));
diff --git a/gpu/command_buffer/service/command_buffer_service.cc b/gpu/command_buffer/service/command_buffer_service.cc
index 30617c8..c9c0782 100644
--- a/gpu/command_buffer/service/command_buffer_service.cc
+++ b/gpu/command_buffer/service/command_buffer_service.cc
@@ -37,7 +37,7 @@ bool CommandBufferService::Initialize() {
return true;
}
-CommandBufferService::State CommandBufferService::GetState() {
+CommandBufferService::State CommandBufferService::GetLastState() {
State state;
state.num_entries = num_entries_;
state.get_offset = get_offset_;
@@ -50,17 +50,13 @@ CommandBufferService::State CommandBufferService::GetState() {
return state;
}
-CommandBufferService::State CommandBufferService::GetLastState() {
- return GetState();
-}
-
int32 CommandBufferService::GetLastToken() {
- return GetState().token;
+ return GetLastState().token;
}
void CommandBufferService::UpdateState() {
if (shared_state_) {
- CommandBufferService::State state = GetState();
+ CommandBufferService::State state = GetLastState();
shared_state_->Write(state);
}
}
diff --git a/gpu/command_buffer/service/command_buffer_service.h b/gpu/command_buffer/service/command_buffer_service.h
index 740e897..ac23301 100644
--- a/gpu/command_buffer/service/command_buffer_service.h
+++ b/gpu/command_buffer/service/command_buffer_service.h
@@ -46,7 +46,6 @@ class GPU_EXPORT CommandBufferService : public CommandBufferServiceBase {
// CommandBuffer implementation:
virtual bool Initialize() OVERRIDE;
- virtual State GetState() OVERRIDE;
virtual State GetLastState() OVERRIDE;
virtual int32 GetLastToken() OVERRIDE;
virtual void Flush(int32 put_offset) OVERRIDE;
diff --git a/gpu/command_buffer/service/command_buffer_service_unittest.cc b/gpu/command_buffer/service/command_buffer_service_unittest.cc
index bf4d619..229aafa 100644
--- a/gpu/command_buffer/service/command_buffer_service_unittest.cc
+++ b/gpu/command_buffer/service/command_buffer_service_unittest.cc
@@ -34,19 +34,19 @@ class CommandBufferServiceTest : public testing::Test {
}
int32 GetGetOffset() {
- return command_buffer_->GetState().get_offset;
+ return command_buffer_->GetLastState().get_offset;
}
int32 GetPutOffset() {
- return command_buffer_->GetState().put_offset;
+ return command_buffer_->GetLastState().put_offset;
}
int32 GetToken() {
- return command_buffer_->GetState().token;
+ return command_buffer_->GetLastState().token;
}
int32 GetError() {
- return command_buffer_->GetState().error;
+ return command_buffer_->GetLastState().error;
}
bool Initialize(size_t size) {
@@ -63,7 +63,7 @@ class CommandBufferServiceTest : public testing::Test {
TEST_F(CommandBufferServiceTest, InitializesCommandBuffer) {
EXPECT_TRUE(Initialize(1024));
- CommandBuffer::State state = command_buffer_->GetState();
+ CommandBuffer::State state = command_buffer_->GetLastState();
EXPECT_EQ(0, state.get_offset);
EXPECT_EQ(0, state.put_offset);
EXPECT_EQ(0, state.token);
diff --git a/gpu/command_buffer/service/gpu_scheduler.cc b/gpu/command_buffer/service/gpu_scheduler.cc
index 928371e..3d159b6 100644
--- a/gpu/command_buffer/service/gpu_scheduler.cc
+++ b/gpu/command_buffer/service/gpu_scheduler.cc
@@ -47,7 +47,7 @@ void GpuScheduler::PutChanged() {
"gpu", "GpuScheduler:PutChanged",
"decoder", decoder_ ? decoder_->GetLogger()->GetLogPrefix() : "None");
- CommandBuffer::State state = command_buffer_->GetState();
+ CommandBuffer::State state = command_buffer_->GetLastState();
// If there is no parser, exit.
if (!parser_.get()) {
diff --git a/gpu/command_buffer/service/gpu_scheduler_unittest.cc b/gpu/command_buffer/service/gpu_scheduler_unittest.cc
index 6859208..80e177a 100644
--- a/gpu/command_buffer/service/gpu_scheduler_unittest.cc
+++ b/gpu/command_buffer/service/gpu_scheduler_unittest.cc
@@ -44,7 +44,7 @@ class GpuSchedulerTest : public testing::Test {
CommandBuffer::State default_state;
default_state.num_entries = kRingBufferEntries;
- ON_CALL(*command_buffer_.get(), GetState())
+ ON_CALL(*command_buffer_.get(), GetLastState())
.WillByDefault(Return(default_state));
decoder_.reset(new gles2::MockGLES2Decoder());
@@ -64,7 +64,7 @@ class GpuSchedulerTest : public testing::Test {
}
error::Error GetError() {
- return command_buffer_->GetState().error;
+ return command_buffer_->GetLastState().error;
}
#if defined(OS_MACOSX)
@@ -82,7 +82,7 @@ TEST_F(GpuSchedulerTest, SchedulerDoesNothingIfRingBufferIsEmpty) {
CommandBuffer::State state;
state.put_offset = 0;
- EXPECT_CALL(*command_buffer_, GetState())
+ EXPECT_CALL(*command_buffer_, GetLastState())
.WillRepeatedly(Return(state));
EXPECT_CALL(*command_buffer_, SetParseError(_))
@@ -118,7 +118,7 @@ TEST_F(GpuSchedulerTest, ProcessesOneCommand) {
CommandBuffer::State state;
state.put_offset = 2;
- EXPECT_CALL(*command_buffer_, GetState())
+ EXPECT_CALL(*command_buffer_, GetLastState())
.WillRepeatedly(Return(state));
EXPECT_CALL(*command_buffer_, SetGetOffset(2));
@@ -142,7 +142,7 @@ TEST_F(GpuSchedulerTest, ProcessesTwoCommands) {
CommandBuffer::State state;
state.put_offset = 3;
- EXPECT_CALL(*command_buffer_, GetState())
+ EXPECT_CALL(*command_buffer_, GetLastState())
.WillRepeatedly(Return(state));
EXPECT_CALL(*decoder_, DoCommand(7, 1, &buffer_[0]))
@@ -164,7 +164,7 @@ TEST_F(GpuSchedulerTest, SetsErrorCodeOnCommandBuffer) {
CommandBuffer::State state;
state.put_offset = 1;
- EXPECT_CALL(*command_buffer_, GetState())
+ EXPECT_CALL(*command_buffer_, GetLastState())
.WillRepeatedly(Return(state));
EXPECT_CALL(*decoder_, DoCommand(7, 0, &buffer_[0]))
@@ -185,7 +185,7 @@ TEST_F(GpuSchedulerTest, ProcessCommandsDoesNothingAfterError) {
CommandBuffer::State state;
state.error = error::kGenericError;
- EXPECT_CALL(*command_buffer_, GetState())
+ EXPECT_CALL(*command_buffer_, GetLastState())
.WillRepeatedly(Return(state));
scheduler_->PutChanged();
diff --git a/gpu/command_buffer/service/in_process_command_buffer.cc b/gpu/command_buffer/service/in_process_command_buffer.cc
index 2fb59f9..f9b81db 100644
--- a/gpu/command_buffer/service/in_process_command_buffer.cc
+++ b/gpu/command_buffer/service/in_process_command_buffer.cc
@@ -483,11 +483,6 @@ CommandBuffer::State InProcessCommandBuffer::GetStateFast() {
return last_state_;
}
-CommandBuffer::State InProcessCommandBuffer::GetState() {
- CheckSequencedThread();
- return GetStateFast();
-}
-
CommandBuffer::State InProcessCommandBuffer::GetLastState() {
CheckSequencedThread();
return last_state_;
@@ -507,7 +502,7 @@ void InProcessCommandBuffer::FlushOnGpuThread(int32 put_offset) {
{
// Update state before signaling the flush event.
base::AutoLock lock(state_after_last_flush_lock_);
- state_after_last_flush_ = command_buffer_->GetState();
+ state_after_last_flush_ = command_buffer_->GetLastState();
}
DCHECK((!error::IsError(state_after_last_flush_.error) && !context_lost_) ||
(error::IsError(state_after_last_flush_.error) && context_lost_));
@@ -578,7 +573,7 @@ void InProcessCommandBuffer::SetGetBuffer(int32 shm_id) {
}
{
base::AutoLock lock(state_after_last_flush_lock_);
- state_after_last_flush_ = command_buffer_->GetState();
+ state_after_last_flush_ = command_buffer_->GetLastState();
}
}
diff --git a/gpu/command_buffer/service/in_process_command_buffer.h b/gpu/command_buffer/service/in_process_command_buffer.h
index 87cc26a..7045c9f 100644
--- a/gpu/command_buffer/service/in_process_command_buffer.h
+++ b/gpu/command_buffer/service/in_process_command_buffer.h
@@ -82,7 +82,6 @@ class GPU_EXPORT InProcessCommandBuffer : public CommandBuffer,
// CommandBuffer implementation:
virtual bool Initialize() OVERRIDE;
- virtual State GetState() OVERRIDE;
virtual State GetLastState() OVERRIDE;
virtual int32 GetLastToken() OVERRIDE;
virtual void Flush(int32 put_offset) OVERRIDE;
diff --git a/gpu/command_buffer/tests/gl_manager.cc b/gpu/command_buffer/tests/gl_manager.cc
index 3211a35..2471451 100644
--- a/gpu/command_buffer/tests/gl_manager.cc
+++ b/gpu/command_buffer/tests/gl_manager.cc
@@ -259,7 +259,7 @@ const gpu::gles2::FeatureInfo::Workarounds& GLManager::workarounds() const {
void GLManager::PumpCommands() {
decoder_->MakeCurrent();
gpu_scheduler_->PutChanged();
- ::gpu::CommandBuffer::State state = command_buffer_->GetState();
+ ::gpu::CommandBuffer::State state = command_buffer_->GetLastState();
if (!context_lost_allowed_) {
ASSERT_EQ(::gpu::error::kNoError, state.error);
}
diff --git a/mojo/examples/pepper_container_app/graphics_3d_resource.cc b/mojo/examples/pepper_container_app/graphics_3d_resource.cc
index b41776f..2ad7dcd 100644
--- a/mojo/examples/pepper_container_app/graphics_3d_resource.cc
+++ b/mojo/examples/pepper_container_app/graphics_3d_resource.cc
@@ -86,11 +86,6 @@ PP_Bool Graphics3DResource::SetGetBuffer(int32_t shm_id) {
return PP_FALSE;
}
-gpu::CommandBuffer::State Graphics3DResource::GetState() {
- NOTIMPLEMENTED();
- return GetErrorState();
-}
-
scoped_refptr<gpu::Buffer> Graphics3DResource::CreateTransferBuffer(
uint32_t size,
int32* id) {
diff --git a/mojo/examples/pepper_container_app/graphics_3d_resource.h b/mojo/examples/pepper_container_app/graphics_3d_resource.h
index 9c5f256..5dba92c 100644
--- a/mojo/examples/pepper_container_app/graphics_3d_resource.h
+++ b/mojo/examples/pepper_container_app/graphics_3d_resource.h
@@ -35,7 +35,6 @@ class Graphics3DResource : public ppapi::Resource,
scoped_refptr<ppapi::TrackedCallback> callback) OVERRIDE;
virtual int32_t GetAttribMaxValue(int32_t attribute, int32_t* value) OVERRIDE;
virtual PP_Bool SetGetBuffer(int32_t shm_id) OVERRIDE;
- virtual gpu::CommandBuffer::State GetState() OVERRIDE;
virtual scoped_refptr<gpu::Buffer> CreateTransferBuffer(uint32_t size,
int32* id) OVERRIDE;
virtual PP_Bool DestroyTransferBuffer(int32_t id) OVERRIDE;
diff --git a/mojo/gles2/command_buffer_client_impl.cc b/mojo/gles2/command_buffer_client_impl.cc
index a08f1b9..ca5f967 100644
--- a/mojo/gles2/command_buffer_client_impl.cc
+++ b/mojo/gles2/command_buffer_client_impl.cc
@@ -86,11 +86,6 @@ bool CommandBufferClientImpl::Initialize() {
return initialize_result_;
}
-gpu::CommandBuffer::State CommandBufferClientImpl::GetState() {
- MakeProgressAndUpdateState();
- return last_state_;
-}
-
gpu::CommandBuffer::State CommandBufferClientImpl::GetLastState() {
return last_state_;
}
diff --git a/mojo/gles2/command_buffer_client_impl.h b/mojo/gles2/command_buffer_client_impl.h
index 18d09b3..0b08714 100644
--- a/mojo/gles2/command_buffer_client_impl.h
+++ b/mojo/gles2/command_buffer_client_impl.h
@@ -48,7 +48,6 @@ class CommandBufferClientImpl : public CommandBufferClient,
// CommandBuffer implementation:
virtual bool Initialize() OVERRIDE;
- virtual State GetState() OVERRIDE;
virtual State GetLastState() OVERRIDE;
virtual int32 GetLastToken() OVERRIDE;
virtual void Flush(int32 put_offset) OVERRIDE;
diff --git a/mojo/services/gles2/command_buffer_impl.cc b/mojo/services/gles2/command_buffer_impl.cc
index 6867183..09a1877 100644
--- a/mojo/services/gles2/command_buffer_impl.cc
+++ b/mojo/services/gles2/command_buffer_impl.cc
@@ -148,7 +148,7 @@ void CommandBufferImpl::Flush(int32_t put_offset) {
void CommandBufferImpl::MakeProgress(int32_t last_get_offset) {
// TODO(piman): handle out-of-order.
AllocationScope scope;
- sync_client_->DidMakeProgress(command_buffer_->GetState());
+ sync_client_->DidMakeProgress(command_buffer_->GetLastState());
}
void CommandBufferImpl::RegisterTransferBuffer(
@@ -184,7 +184,7 @@ void CommandBufferImpl::RequestAnimationFrames() {
void CommandBufferImpl::CancelAnimationFrames() { timer_.Stop(); }
void CommandBufferImpl::OnParseError() {
- gpu::CommandBuffer::State state = command_buffer_->GetState();
+ gpu::CommandBuffer::State state = command_buffer_->GetLastState();
client_->LostContext(state.context_lost_reason);
}
diff --git a/ppapi/proxy/ppapi_command_buffer_proxy.cc b/ppapi/proxy/ppapi_command_buffer_proxy.cc
index d747019..e9a8a35 100644
--- a/ppapi/proxy/ppapi_command_buffer_proxy.cc
+++ b/ppapi/proxy/ppapi_command_buffer_proxy.cc
@@ -29,20 +29,6 @@ bool PpapiCommandBufferProxy::Initialize() {
return true;
}
-gpu::CommandBuffer::State PpapiCommandBufferProxy::GetState() {
- // Send will flag state with lost context if IPC fails.
- if (last_state_.error == gpu::error::kNoError) {
- gpu::CommandBuffer::State state;
- bool success = false;
- if (Send(new PpapiHostMsg_PPBGraphics3D_GetState(
- ppapi::API_ID_PPB_GRAPHICS_3D, resource_, &state, &success))) {
- UpdateState(state, success);
- }
- }
-
- return last_state_;
-}
-
gpu::CommandBuffer::State PpapiCommandBufferProxy::GetLastState() {
ppapi::ProxyLock::AssertAcquiredDebugOnly();
return last_state_;
diff --git a/ppapi/proxy/ppapi_command_buffer_proxy.h b/ppapi/proxy/ppapi_command_buffer_proxy.h
index 20a09a5..32cbfad 100644
--- a/ppapi/proxy/ppapi_command_buffer_proxy.h
+++ b/ppapi/proxy/ppapi_command_buffer_proxy.h
@@ -30,7 +30,6 @@ class PPAPI_PROXY_EXPORT PpapiCommandBufferProxy : public gpu::CommandBuffer,
// gpu::CommandBuffer implementation:
virtual bool Initialize() OVERRIDE;
- virtual State GetState() OVERRIDE;
virtual State GetLastState() OVERRIDE;
virtual int32 GetLastToken() OVERRIDE;
virtual void Flush(int32 put_offset) OVERRIDE;
diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h
index e099b36..10cde4e 100644
--- a/ppapi/proxy/ppapi_messages.h
+++ b/ppapi/proxy/ppapi_messages.h
@@ -788,10 +788,6 @@ IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBGraphics3D_Create,
IPC_SYNC_MESSAGE_ROUTED2_0(PpapiHostMsg_PPBGraphics3D_SetGetBuffer,
ppapi::HostResource /* context */,
int32 /* transfer_buffer_id */)
-IPC_SYNC_MESSAGE_ROUTED1_2(PpapiHostMsg_PPBGraphics3D_GetState,
- ppapi::HostResource /* context */,
- gpu::CommandBuffer::State /* state */,
- bool /* success */)
IPC_SYNC_MESSAGE_ROUTED3_2(PpapiHostMsg_PPBGraphics3D_WaitForTokenInRange,
ppapi::HostResource /* context */,
int32 /* start */,
diff --git a/ppapi/proxy/ppb_graphics_3d_proxy.cc b/ppapi/proxy/ppb_graphics_3d_proxy.cc
index 85692d4..ba0e505 100644
--- a/ppapi/proxy/ppb_graphics_3d_proxy.cc
+++ b/ppapi/proxy/ppb_graphics_3d_proxy.cc
@@ -68,10 +68,6 @@ PP_Bool Graphics3D::SetGetBuffer(int32_t /* transfer_buffer_id */) {
return PP_FALSE;
}
-gpu::CommandBuffer::State Graphics3D::GetState() {
- return GetErrorState();
-}
-
PP_Bool Graphics3D::Flush(int32_t put_offset) {
return PP_FALSE;
}
@@ -181,8 +177,6 @@ bool PPB_Graphics3D_Proxy::OnMessageReceived(const IPC::Message& msg) {
OnMsgCreate)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBGraphics3D_SetGetBuffer,
OnMsgSetGetBuffer)
- IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBGraphics3D_GetState,
- OnMsgGetState)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBGraphics3D_WaitForTokenInRange,
OnMsgWaitForTokenInRange)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBGraphics3D_WaitForGetOffsetInRange,
@@ -236,18 +230,6 @@ void PPB_Graphics3D_Proxy::OnMsgSetGetBuffer(
enter.object()->SetGetBuffer(transfer_buffer_id);
}
-void PPB_Graphics3D_Proxy::OnMsgGetState(const HostResource& context,
- gpu::CommandBuffer::State* state,
- bool* success) {
- EnterHostFromHostResource<PPB_Graphics3D_API> enter(context);
- if (enter.failed()) {
- *success = false;
- return;
- }
- *state = enter.object()->GetState();
- *success = true;
-}
-
void PPB_Graphics3D_Proxy::OnMsgWaitForTokenInRange(
const HostResource& context,
int32 start,
diff --git a/ppapi/proxy/ppb_graphics_3d_proxy.h b/ppapi/proxy/ppb_graphics_3d_proxy.h
index f86b16d..931b84f 100644
--- a/ppapi/proxy/ppb_graphics_3d_proxy.h
+++ b/ppapi/proxy/ppb_graphics_3d_proxy.h
@@ -35,7 +35,6 @@ class Graphics3D : public PPB_Graphics3D_Shared {
// Graphics3DTrusted API. These are not implemented in the proxy.
virtual PP_Bool SetGetBuffer(int32_t shm_id) OVERRIDE;
- virtual gpu::CommandBuffer::State GetState() OVERRIDE;
virtual PP_Bool Flush(int32_t put_offset) OVERRIDE;
virtual scoped_refptr<gpu::Buffer> CreateTransferBuffer(uint32_t size,
int32* id) OVERRIDE;
@@ -80,9 +79,6 @@ class PPB_Graphics3D_Proxy : public InterfaceProxy {
HostResource* result);
void OnMsgSetGetBuffer(const HostResource& context,
int32 id);
- void OnMsgGetState(const HostResource& context,
- gpu::CommandBuffer::State* state,
- bool* success);
void OnMsgWaitForTokenInRange(const HostResource& context,
int32 start,
int32 end,
diff --git a/ppapi/thunk/ppb_graphics_3d_api.h b/ppapi/thunk/ppb_graphics_3d_api.h
index 92e392e..ec0b187 100644
--- a/ppapi/thunk/ppb_graphics_3d_api.h
+++ b/ppapi/thunk/ppb_graphics_3d_api.h
@@ -31,7 +31,6 @@ class PPAPI_THUNK_EXPORT PPB_Graphics3D_API {
// Graphics3DTrusted API.
virtual PP_Bool SetGetBuffer(int32_t shm_id) = 0;
- virtual gpu::CommandBuffer::State GetState() = 0;
virtual scoped_refptr<gpu::Buffer> CreateTransferBuffer(uint32_t size,
int32_t* id) = 0;
virtual PP_Bool DestroyTransferBuffer(int32_t id) = 0;