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

Side by Side Diff: content/common/gpu/client/command_buffer_proxy_impl.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, 7 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 | Annotate | Revision Log
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 "content/common/gpu/client/command_buffer_proxy_impl.h" 5 #include "content/common/gpu/client/command_buffer_proxy_impl.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 if (!result) { 156 if (!result) {
157 LOG(ERROR) << "Failed to initialize command buffer service."; 157 LOG(ERROR) << "Failed to initialize command buffer service.";
158 return false; 158 return false;
159 } 159 }
160 160
161 capabilities_.map_image = true; 161 capabilities_.map_image = true;
162 162
163 return true; 163 return true;
164 } 164 }
165 165
166 gpu::CommandBuffer::State CommandBufferProxyImpl::GetState() {
167 // Send will flag state with lost context if IPC fails.
168 if (last_state_.error == gpu::error::kNoError) {
169 gpu::CommandBuffer::State state;
170 if (Send(new GpuCommandBufferMsg_GetState(route_id_, &state)))
171 OnUpdateState(state);
172 }
173
174 TryUpdateState();
175 return last_state_;
176 }
177
178 gpu::CommandBuffer::State CommandBufferProxyImpl::GetLastState() { 166 gpu::CommandBuffer::State CommandBufferProxyImpl::GetLastState() {
179 return last_state_; 167 return last_state_;
180 } 168 }
181 169
182 int32 CommandBufferProxyImpl::GetLastToken() { 170 int32 CommandBufferProxyImpl::GetLastToken() {
183 TryUpdateState(); 171 TryUpdateState();
184 return last_state_.token; 172 return last_state_.token;
185 } 173 }
186 174
187 void CommandBufferProxyImpl::Flush(int32 put_offset) { 175 void CommandBufferProxyImpl::Flush(int32 put_offset) {
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 if (last_state_.error == gpu::error::kNoError) 512 if (last_state_.error == gpu::error::kNoError)
525 shared_state()->Read(&last_state_); 513 shared_state()->Read(&last_state_);
526 } 514 }
527 515
528 gpu::CommandBufferSharedState* CommandBufferProxyImpl::shared_state() const { 516 gpu::CommandBufferSharedState* CommandBufferProxyImpl::shared_state() const {
529 return reinterpret_cast<gpu::CommandBufferSharedState*>( 517 return reinterpret_cast<gpu::CommandBufferSharedState*>(
530 shared_state_shm_->memory()); 518 shared_state_shm_->memory());
531 } 519 }
532 520
533 } // namespace content 521 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/client/command_buffer_proxy_impl.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