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

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

Issue 10388010: Decoupling backbuffer allocation suggestion from frontbuffer allocation suggestion. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reset previous damage at time of swap. Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.h ('k') | content/common/gpu/image_transport_surface_linux.cc » ('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 d2f2849b56865d668f65b5b60a4715c1a9b64941..cd6242cfc4fe6aa8af6b03e05240447508e85e52 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -60,9 +60,6 @@ GpuCommandBufferStub::GpuCommandBufferStub(
software_(software),
client_has_memory_allocation_changed_callback_(false),
last_flush_count_(0),
- allocation_(GpuMemoryAllocation::INVALID_RESOURCE_SIZE,
- GpuMemoryAllocation::kHasFrontbuffer |
- GpuMemoryAllocation::kHasBackbuffer),
parent_stub_for_initialization_(),
parent_texture_for_initialization_(0),
watchdog_(watchdog) {
@@ -579,20 +576,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(
@@ -650,16 +640,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)
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.h ('k') | content/common/gpu/image_transport_surface_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698