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

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

Issue 10052018: Drop frontbuffers with ui-use-gpu-process, synchronized with browser, decoupled from backbuffer dro… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Renaming messages. Updated the other platforms. 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 side-by-side diff with in-line comments
Download patch
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 41fa5e5a2ffd6158f1b6e13370cc69f961b1f879..1085040a1cf1e09017ffda29a7aba7229caa899e 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -59,9 +59,6 @@ GpuCommandBufferStub::GpuCommandBufferStub(
route_id_(route_id),
software_(software),
last_flush_count_(0),
- allocation_(GpuMemoryAllocation::INVALID_RESOURCE_SIZE,
- GpuMemoryAllocation::kHasFrontbuffer |
- GpuMemoryAllocation::kHasBackbuffer),
parent_stub_for_initialization_(),
parent_texture_for_initialization_(0),
watchdog_(watchdog) {
@@ -578,20 +575,13 @@ void GpuCommandBufferStub::OnSetSurfaceVisible(bool visible) {
void GpuCommandBufferStub::OnDiscardBackbuffer() {
if (!surface_)
return;
- if (allocation_.suggest_have_frontbuffer)
- surface_->SetBufferAllocation(
- gfx::GLSurface::BUFFER_ALLOCATION_FRONT_ONLY);
- else
- surface_->SetBufferAllocation(
- gfx::GLSurface::BUFFER_ALLOCATION_NONE);
+ surface_->SetBackbufferAllocation(false);
}
void GpuCommandBufferStub::OnEnsureBackbuffer() {
if (!surface_)
return;
- // TODO(mmocny): Support backbuffer without frontbuffer.
- surface_->SetBufferAllocation(
- gfx::GLSurface::BUFFER_ALLOCATION_FRONT_AND_BACK);
+ surface_->SetBackbufferAllocation(true);
}
void GpuCommandBufferStub::OnSetClientHasMemoryAllocationChangedCallback(
@@ -643,16 +633,12 @@ const GpuCommandBufferStubBase::SurfaceState&
return *surface_state_.get();
}
-void GpuCommandBufferStub::SendMemoryAllocationToProxy(
- const GpuMemoryAllocation& allocation) {
- Send(new GpuCommandBufferMsg_SetMemoryAllocation(route_id_, allocation));
-}
-
void GpuCommandBufferStub::SetMemoryAllocation(
const GpuMemoryAllocation& allocation) {
- allocation_ = allocation;
-
- SendMemoryAllocationToProxy(allocation);
+ Send(new GpuCommandBufferMsg_SetMemoryAllocation(route_id_, allocation));
+ if (!surface_)
+ return;
+ surface_->SetFrontbufferAllocation(allocation.suggest_have_frontbuffer);
}
#endif // defined(ENABLE_GPU)

Powered by Google App Engine
This is Rietveld 408576698