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

Side by Side Diff: content/common/gpu/client/command_buffer_proxy_impl.cc

Issue 9910004: Implement Discard and EnsureBackbufferCHROMIUM using command buffer instead of IPC. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 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/process_util.h" 10 #include "base/process_util.h"
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 return true; 369 return true;
370 } 370 }
371 371
372 bool CommandBufferProxyImpl::SetSurfaceVisible(bool visible) { 372 bool CommandBufferProxyImpl::SetSurfaceVisible(bool visible) {
373 if (last_state_.error != gpu::error::kNoError) 373 if (last_state_.error != gpu::error::kNoError)
374 return false; 374 return false;
375 375
376 return Send(new GpuCommandBufferMsg_SetSurfaceVisible(route_id_, visible)); 376 return Send(new GpuCommandBufferMsg_SetSurfaceVisible(route_id_, visible));
377 } 377 }
378 378
379 bool CommandBufferProxyImpl::DiscardBackbuffer() {
380 if (last_state_.error != gpu::error::kNoError)
381 return false;
382
383 return Send(new GpuCommandBufferMsg_DiscardBackbuffer(route_id_));
384 }
385
386 bool CommandBufferProxyImpl::EnsureBackbuffer() {
387 if (last_state_.error != gpu::error::kNoError)
388 return false;
389
390 return Send(new GpuCommandBufferMsg_EnsureBackbuffer(route_id_));
391 }
392
393 bool CommandBufferProxyImpl::SetParent( 379 bool CommandBufferProxyImpl::SetParent(
394 CommandBufferProxy* parent_command_buffer, 380 CommandBufferProxy* parent_command_buffer,
395 uint32 parent_texture_id) { 381 uint32 parent_texture_id) {
396 if (last_state_.error != gpu::error::kNoError) 382 if (last_state_.error != gpu::error::kNoError)
397 return false; 383 return false;
398 384
399 bool result; 385 bool result;
400 if (parent_command_buffer) { 386 if (parent_command_buffer) {
401 if (!Send(new GpuCommandBufferMsg_SetParent( 387 if (!Send(new GpuCommandBufferMsg_SetParent(
402 route_id_, 388 route_id_,
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 466
481 void CommandBufferProxyImpl::SetOnConsoleMessageCallback( 467 void CommandBufferProxyImpl::SetOnConsoleMessageCallback(
482 const GpuConsoleMessageCallback& callback) { 468 const GpuConsoleMessageCallback& callback) {
483 console_message_callback_ = callback; 469 console_message_callback_ = callback;
484 } 470 }
485 471
486 void CommandBufferProxyImpl::TryUpdateState() { 472 void CommandBufferProxyImpl::TryUpdateState() {
487 if (last_state_.error == gpu::error::kNoError) 473 if (last_state_.error == gpu::error::kNoError)
488 shared_state_->Read(&last_state_); 474 shared_state_->Read(&last_state_);
489 } 475 }
OLDNEW
« no previous file with comments | « content/common/gpu/client/command_buffer_proxy_impl.h ('k') | content/common/gpu/client/content_gl_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698