summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-08 07:20:43 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-08 07:20:43 +0000
commitebac3e5419fd6abecc9a4225a8a9e6d44bfbd0b5 (patch)
tree10a9aee75d3d80532ed4649d1b547fd706687898 /ppapi
parentc548d906788658674fa75e041f0b40091083cfb1 (diff)
downloadchromium_src-ebac3e5419fd6abecc9a4225a8a9e6d44bfbd0b5.zip
chromium_src-ebac3e5419fd6abecc9a4225a8a9e6d44bfbd0b5.tar.gz
chromium_src-ebac3e5419fd6abecc9a4225a8a9e6d44bfbd0b5.tar.bz2
Route surface visibility notifications through ContextSupport/GpuControl
This obsoletes the WebGraphicsContext3D::setVisibilityCHROMIUM call and instead routes surface visibility notifications from the compositor to the gpu stack through gpu::ContextSupport and from the gpu stack to the command buffer embedder through gpu::GpuControl. The implementation of gpu::ContextSupport (GLES2Implementation) frees up command buffers/etc that it owns and the implementation of gpu::GpuControl (CommandBufferProxyImpl) sends the content IPC that drives the memory manager. This means migrating some logic from content::WebGraphicsContext3DCommandBufferImpl down to gpu::GLES2Implementation, such as the free everything when invisible. BUG=181120 R=piman Review URL: https://codereview.chromium.org/107663002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239390 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/proxy/ppapi_command_buffer_proxy.cc4
-rw-r--r--ppapi/proxy/ppapi_command_buffer_proxy.h1
-rw-r--r--ppapi/shared_impl/ppb_graphics_3d_shared.cc6
3 files changed, 10 insertions, 1 deletions
diff --git a/ppapi/proxy/ppapi_command_buffer_proxy.cc b/ppapi/proxy/ppapi_command_buffer_proxy.cc
index 5c2642d..8af9e89 100644
--- a/ppapi/proxy/ppapi_command_buffer_proxy.cc
+++ b/ppapi/proxy/ppapi_command_buffer_proxy.cc
@@ -213,6 +213,10 @@ void PpapiCommandBufferProxy::SignalQuery(uint32 query,
NOTREACHED();
}
+void PpapiCommandBufferProxy::SetSurfaceVisible(bool visible) {
+ NOTREACHED();
+}
+
void PpapiCommandBufferProxy::SendManagedMemoryStats(
const gpu::ManagedMemoryStats& stats) {
NOTREACHED();
diff --git a/ppapi/proxy/ppapi_command_buffer_proxy.h b/ppapi/proxy/ppapi_command_buffer_proxy.h
index 94e2582..05085f5 100644
--- a/ppapi/proxy/ppapi_command_buffer_proxy.h
+++ b/ppapi/proxy/ppapi_command_buffer_proxy.h
@@ -61,6 +61,7 @@ class PPAPI_PROXY_EXPORT PpapiCommandBufferProxy
const base::Closure& callback) OVERRIDE;
virtual void SignalQuery(uint32 query,
const base::Closure& callback) OVERRIDE;
+ virtual void SetSurfaceVisible(bool visible) OVERRIDE;
virtual void SendManagedMemoryStats(const gpu::ManagedMemoryStats& stats)
OVERRIDE;
diff --git a/ppapi/shared_impl/ppb_graphics_3d_shared.cc b/ppapi/shared_impl/ppb_graphics_3d_shared.cc
index 0f39663..d134b51 100644
--- a/ppapi/shared_impl/ppb_graphics_3d_shared.cc
+++ b/ppapi/shared_impl/ppb_graphics_3d_shared.cc
@@ -118,12 +118,16 @@ bool PPB_Graphics3D_Shared::CreateGLES2Impl(
const int32 kMaxTransferBufferSize = 16 * 1024 * 1024;
transfer_buffer_.reset(new gpu::TransferBuffer(gles2_helper_.get()));
+ bool bind_creates_resources = true;
+ bool free_everything_when_invisible = false;
+
// Create the object exposing the OpenGL API.
gles2_impl_.reset(new gpu::gles2::GLES2Implementation(
gles2_helper_.get(),
share_gles2 ? share_gles2->share_group() : NULL,
transfer_buffer_.get(),
- true,
+ bind_creates_resources,
+ free_everything_when_invisible,
GetGpuControl()));
if (!gles2_impl_->Initialize(