From 5dfc457b046705366bc8e58f5006b4e27c58f5c6 Mon Sep 17 00:00:00 2001
From: "jamesr@chromium.org"
 <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Fri, 13 Dec 2013 11:13:07 +0000
Subject: Add GL entry points for DiscardBackbufferCHROMIUM

This adds and uses a GL command buffer command for DiscardBackbufferCHROMIUM
instead of having a WebGraphicsContext3D entry point + common/ IPC message.
This is used to deallocate, if possible, the backbuffer when no longer in use.

BUG=181120

Review URL: https://codereview.chromium.org/104823005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240583 0039d316-1c4b-4281-b951-d872f2087c98
---
 content/common/gpu/gpu_command_buffer_stub.cc | 15 ---------------
 1 file changed, 15 deletions(-)

(limited to '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 cc75813..4a1cbfd 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -213,8 +213,6 @@ bool GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) {
                                     OnCreateVideoDecoder)
     IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SetSurfaceVisible,
                         OnSetSurfaceVisible)
-    IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DiscardBackbuffer,
-                        OnDiscardBackbuffer)
     IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_EnsureBackbuffer,
                         OnEnsureBackbuffer)
     IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_RetireSyncPoint,
@@ -760,19 +758,6 @@ void GpuCommandBufferStub::OnSetSurfaceVisible(bool visible) {
     memory_manager_client_state_->SetVisible(visible);
 }
 
-void GpuCommandBufferStub::OnDiscardBackbuffer() {
-  TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnDiscardBackbuffer");
-  if (!surface_.get())
-    return;
-  if (surface_->DeferDraws()) {
-    DCHECK(!IsScheduled());
-    channel_->RequeueMessage();
-  } else {
-    if (!surface_->SetBackbufferAllocation(false))
-      channel_->DestroySoon();
-  }
-}
-
 void GpuCommandBufferStub::OnEnsureBackbuffer() {
   TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnEnsureBackbuffer");
   if (!surface_.get())
-- 
cgit v1.1