summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--cc/output/delegating_renderer.cc2
-rw-r--r--cc/output/gl_renderer.cc5
-rw-r--r--cc/output/gl_renderer_unittest.cc19
-rw-r--r--cc/test/test_context_provider.h2
-rw-r--r--cc/test/test_context_support.cc14
-rw-r--r--cc/test/test_context_support.h6
-rw-r--r--content/common/gpu/client/command_buffer_proxy_impl.cc14
-rw-r--r--content/common/gpu/client/command_buffer_proxy_impl.h4
-rw-r--r--content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc20
-rw-r--r--content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h1
-rw-r--r--gpu/command_buffer/client/client_test_helper.h1
-rw-r--r--gpu/command_buffer/client/context_support.h4
-rw-r--r--gpu/command_buffer/client/gl_in_process_context.cc6
-rw-r--r--gpu/command_buffer/client/gles2_implementation.cc17
-rw-r--r--gpu/command_buffer/client/gles2_implementation.h5
-rw-r--r--gpu/command_buffer/client/gles2_implementation_unittest.cc1
-rw-r--r--gpu/command_buffer/common/gpu_control.h2
-rw-r--r--gpu/command_buffer/service/gpu_control_service.cc4
-rw-r--r--gpu/command_buffer/service/gpu_control_service.h1
-rw-r--r--gpu/command_buffer/service/in_process_command_buffer.cc2
-rw-r--r--gpu/command_buffer/service/in_process_command_buffer.h1
-rw-r--r--gpu/command_buffer/tests/gl_manager.cc3
-rw-r--r--gpu/gles2_conform_support/egl/display.cc7
-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
26 files changed, 111 insertions, 41 deletions
diff --git a/cc/output/delegating_renderer.cc b/cc/output/delegating_renderer.cc
index 001b7fd..51cb946 100644
--- a/cc/output/delegating_renderer.cc
+++ b/cc/output/delegating_renderer.cc
@@ -165,7 +165,7 @@ void DelegatingRenderer::SetVisible(bool visible) {
// That will allow it to feed us with memory allocations that we can act
// upon.
DCHECK(context_provider);
- context_provider->Context3d()->setVisibilityCHROMIUM(visible);
+ context_provider->ContextSupport()->SetSurfaceVisible(visible);
}
void DelegatingRenderer::SendManagedMemoryStats(size_t bytes_visible,
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index b82228a..89b8c04 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -259,10 +259,7 @@ void GLRenderer::SetVisible(bool visible) {
EnforceMemoryPolicy();
- // TODO(jamesr): Replace setVisibilityCHROMIUM() with an extension to
- // explicitly manage front/backbuffers
- // crbug.com/116049
- context_->setVisibilityCHROMIUM(visible);
+ context_support_->SetSurfaceVisible(visible);
}
void GLRenderer::SendManagedMemoryStats(size_t bytes_visible,
diff --git a/cc/output/gl_renderer_unittest.cc b/cc/output/gl_renderer_unittest.cc
index 773768e..eb05784 100644
--- a/cc/output/gl_renderer_unittest.cc
+++ b/cc/output/gl_renderer_unittest.cc
@@ -738,10 +738,6 @@ class VisibilityChangeIsLastCallTrackingContext
: last_call_was_set_visibility_(false) {}
// WebGraphicsContext3D methods.
- virtual void setVisibilityCHROMIUM(bool visible) {
- DCHECK(last_call_was_set_visibility_ == false);
- last_call_was_set_visibility_ = true;
- }
virtual void flush() {
last_call_was_set_visibility_ = false;
}
@@ -765,6 +761,10 @@ class VisibilityChangeIsLastCallTrackingContext
}
// Methods added for test.
+ void set_last_call_was_visibility(bool visible) {
+ DCHECK(last_call_was_set_visibility_ == false);
+ last_call_was_set_visibility_ = true;
+ }
bool last_call_was_set_visibility() const {
return last_call_was_set_visibility_;
}
@@ -778,9 +778,16 @@ TEST(GLRendererTest2, VisibilityChangeIsLastCall) {
new VisibilityChangeIsLastCallTrackingContext);
VisibilityChangeIsLastCallTrackingContext* context = context_owned.get();
+ scoped_refptr<TestContextProvider> provider = TestContextProvider::Create(
+ context_owned.PassAs<TestWebGraphicsContext3D>());
+
+ provider->support()->SetSurfaceVisibleCallback(base::Bind(
+ &VisibilityChangeIsLastCallTrackingContext::set_last_call_was_visibility,
+ base::Unretained(context)));
+
FakeOutputSurfaceClient output_surface_client;
scoped_ptr<OutputSurface> output_surface(FakeOutputSurface::Create3d(
- context_owned.PassAs<TestWebGraphicsContext3D>()));
+ provider));
CHECK(output_surface->BindToClient(&output_surface_client));
scoped_ptr<ResourceProvider> resource_provider(
@@ -795,7 +802,7 @@ TEST(GLRendererTest2, VisibilityChangeIsLastCall) {
EXPECT_TRUE(renderer.Initialize());
- // Ensure that the call to setVisibilityCHROMIUM is the last call issue to the
+ // Ensure that the call to SetSurfaceVisible is the last call issue to the
// GPU process, after glFlush is called, and after the RendererClient's
// SetManagedMemoryPolicy is called. Plumb this tracking between both the
// RenderClient and the Context by giving them both a pointer to a variable on
diff --git a/cc/test/test_context_provider.h b/cc/test/test_context_provider.h
index 81167c6..6997f85 100644
--- a/cc/test/test_context_provider.h
+++ b/cc/test/test_context_provider.h
@@ -50,6 +50,8 @@ class TestContextProvider : public cc::ContextProvider {
// makeContextCurrent on the context returned from this method.
TestWebGraphicsContext3D* UnboundTestContext3d();
+ TestContextSupport* support() { return &support_; }
+
void SetMemoryAllocation(const ManagedMemoryPolicy& policy);
void SetMaxTransferBufferUsageBytes(size_t max_transfer_buffer_usage_bytes);
diff --git a/cc/test/test_context_support.cc b/cc/test/test_context_support.cc
index d71f74d..be0d363 100644
--- a/cc/test/test_context_support.cc
+++ b/cc/test/test_context_support.cc
@@ -21,10 +21,15 @@ void TestContextSupport::SignalQuery(uint32 query,
sync_point_callbacks_.push_back(callback);
}
-void TestContextSupport::SendManagedMemoryStats(
- const gpu::ManagedMemoryStats& stats) {
+void TestContextSupport::SetSurfaceVisible(bool visible) {
+ if (!set_visible_callback_.is_null()) {
+ set_visible_callback_.Run(visible);
+ }
}
+void TestContextSupport::SendManagedMemoryStats(
+ const gpu::ManagedMemoryStats& stats) {}
+
void TestContextSupport::CallAllSyncPointCallbacks() {
for (size_t i = 0; i < sync_point_callbacks_.size(); ++i) {
base::MessageLoop::current()->PostTask(
@@ -33,4 +38,9 @@ void TestContextSupport::CallAllSyncPointCallbacks() {
sync_point_callbacks_.clear();
}
+void TestContextSupport::SetSurfaceVisibleCallback(
+ const SurfaceVisibleCallback& set_visible_callback) {
+ set_visible_callback_ = set_visible_callback;
+}
+
} // namespace cc
diff --git a/cc/test/test_context_support.h b/cc/test/test_context_support.h
index 6c2258e..9455e15 100644
--- a/cc/test/test_context_support.h
+++ b/cc/test/test_context_support.h
@@ -21,13 +21,19 @@ class TestContextSupport : public gpu::ContextSupport {
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;
void CallAllSyncPointCallbacks();
+ typedef base::Callback<void(bool visible)> SurfaceVisibleCallback;
+ void SetSurfaceVisibleCallback(
+ const SurfaceVisibleCallback& set_visible_callback);
+
private:
std::vector<base::Closure> sync_point_callbacks_;
+ SurfaceVisibleCallback set_visible_callback_;
DISALLOW_COPY_AND_ASSIGN(TestContextSupport);
};
diff --git a/content/common/gpu/client/command_buffer_proxy_impl.cc b/content/common/gpu/client/command_buffer_proxy_impl.cc
index 23a0848c..3cc39a6 100644
--- a/content/common/gpu/client/command_buffer_proxy_impl.cc
+++ b/content/common/gpu/client/command_buffer_proxy_impl.cc
@@ -450,13 +450,6 @@ bool CommandBufferProxyImpl::Echo(const base::Closure& callback) {
return true;
}
-bool CommandBufferProxyImpl::SetSurfaceVisible(bool visible) {
- if (last_state_.error != gpu::error::kNoError)
- return false;
-
- return Send(new GpuCommandBufferMsg_SetSurfaceVisible(route_id_, visible));
-}
-
bool CommandBufferProxyImpl::DiscardBackbuffer() {
if (last_state_.error != gpu::error::kNoError)
return false;
@@ -518,6 +511,13 @@ void CommandBufferProxyImpl::SignalQuery(uint32 query,
signal_tasks_.insert(std::make_pair(signal_id, callback));
}
+void CommandBufferProxyImpl::SetSurfaceVisible(bool visible) {
+ if (last_state_.error != gpu::error::kNoError)
+ return;
+
+ Send(new GpuCommandBufferMsg_SetSurfaceVisible(route_id_, visible));
+}
+
void CommandBufferProxyImpl::SendManagedMemoryStats(
const gpu::ManagedMemoryStats& stats) {
if (last_state_.error != gpu::error::kNoError)
diff --git a/content/common/gpu/client/command_buffer_proxy_impl.h b/content/common/gpu/client/command_buffer_proxy_impl.h
index ee85fd7..fab196f 100644
--- a/content/common/gpu/client/command_buffer_proxy_impl.h
+++ b/content/common/gpu/client/command_buffer_proxy_impl.h
@@ -110,6 +110,7 @@ class CommandBufferProxyImpl
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;
@@ -128,9 +129,6 @@ class CommandBufferProxyImpl
bool DiscardBackbuffer();
bool EnsureBackbuffer();
- // Sends an IPC message with the new state of surface visibility.
- bool SetSurfaceVisible(bool visible);
-
void SetOnConsoleMessageCallback(
const GpuConsoleMessageCallback& callback);
diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
index b4d4a24..b3a356e 100644
--- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
+++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
@@ -212,7 +212,6 @@ WebGraphicsContext3DCommandBufferImpl::WebGraphicsContext3DCommandBufferImpl(
const SharedMemoryLimits& limits)
: initialize_failed_(false),
visible_(false),
- free_command_buffer_when_invisible_(false),
host_(host),
surface_id_(surface_id),
active_url_(active_url),
@@ -274,10 +273,6 @@ bool WebGraphicsContext3DCommandBufferImpl::MaybeInitializeGL() {
new WebGraphicsContext3DErrorMessageCallback(this));
real_gl_->SetErrorMessageCallback(client_error_message_callback_.get());
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- free_command_buffer_when_invisible_ =
- command_line.HasSwitch(switches::kEnablePruneGpuCommandBuffers);
-
// Set attributes_ from created offscreen context.
{
static const int pcount = 4;
@@ -395,12 +390,17 @@ bool WebGraphicsContext3DCommandBufferImpl::CreateContext(
}
}
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ bool free_command_buffer_when_invisible =
+ command_line.HasSwitch(switches::kEnablePruneGpuCommandBuffers);
+
// Create the object exposing the OpenGL API.
real_gl_.reset(new gpu::gles2::GLES2Implementation(
gles2_helper_.get(),
share_group,
transfer_buffer_.get(),
bind_generates_resources_,
+ free_command_buffer_when_invisible,
command_buffer_.get()));
gl_ = real_gl_.get();
@@ -559,11 +559,7 @@ DELEGATE_TO_GL_1(unmapTexSubImage2DCHROMIUM, UnmapTexSubImage2DCHROMIUM,
void WebGraphicsContext3DCommandBufferImpl::setVisibilityCHROMIUM(
bool visible) {
- gl_->Flush();
- visible_ = visible;
- command_buffer_->SetSurfaceVisible(visible);
- if (!visible)
- real_gl_->FreeEverything();
+ NOTREACHED();
}
DELEGATE_TO_GL_3(discardFramebufferEXT, DiscardFramebufferEXT, WGC3Denum,
@@ -717,15 +713,11 @@ DELEGATE_TO_GL_1(enableVertexAttribArray, EnableVertexAttribArray,
void WebGraphicsContext3DCommandBufferImpl::finish() {
flush_id_ = GenFlushID();
gl_->Finish();
- if (!visible_ && free_command_buffer_when_invisible_)
- real_gl_->FreeEverything();
}
void WebGraphicsContext3DCommandBufferImpl::flush() {
flush_id_ = GenFlushID();
gl_->Flush();
- if (!visible_ && free_command_buffer_when_invisible_)
- real_gl_->FreeEverything();
}
DELEGATE_TO_GL_4(framebufferRenderbuffer, FramebufferRenderbuffer,
diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h
index 1604fa6..d38dacc 100644
--- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h
+++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h
@@ -696,7 +696,6 @@ class WebGraphicsContext3DCommandBufferImpl
bool initialize_failed_;
bool visible_;
- bool free_command_buffer_when_invisible_;
// State needed by MaybeInitializeGL.
scoped_refptr<GpuChannelHost> host_;
diff --git a/gpu/command_buffer/client/client_test_helper.h b/gpu/command_buffer/client/client_test_helper.h
index 4842cc0..6f0bc6d 100644
--- a/gpu/command_buffer/client/client_test_helper.h
+++ b/gpu/command_buffer/client/client_test_helper.h
@@ -101,6 +101,7 @@ class MockClientGpuControl : public GpuControl {
const base::Closure& callback));
MOCK_METHOD2(SignalQuery, void(uint32 query, const base::Closure& callback));
+ MOCK_METHOD1(SetSurfaceVisible, void(bool visible));
MOCK_METHOD1(SendManagedMemoryStats,
void(const ManagedMemoryStats& stats));
diff --git a/gpu/command_buffer/client/context_support.h b/gpu/command_buffer/client/context_support.h
index a620cd3..dcb0842 100644
--- a/gpu/command_buffer/client/context_support.h
+++ b/gpu/command_buffer/client/context_support.h
@@ -20,6 +20,10 @@ class ContextSupport {
// passed the glEndQueryEXT() point.
virtual void SignalQuery(uint32 query, const base::Closure& callback) = 0;
+ // For onscreen contexts, indicates that the surface visibility has changed.
+ // Clients aren't expected to draw to an invisible surface.
+ virtual void SetSurfaceVisible(bool visible) = 0;
+
virtual void SendManagedMemoryStats(const ManagedMemoryStats& stats) = 0;
protected:
diff --git a/gpu/command_buffer/client/gl_in_process_context.cc b/gpu/command_buffer/client/gl_in_process_context.cc
index ab5cede..1bd4c62 100644
--- a/gpu/command_buffer/client/gl_in_process_context.cc
+++ b/gpu/command_buffer/client/gl_in_process_context.cc
@@ -232,12 +232,16 @@ bool GLInProcessContextImpl::Initialize(
// Create a transfer buffer.
transfer_buffer_.reset(new TransferBuffer(gles2_helper_.get()));
+ bool bind_generates_resources = false;
+ bool free_everything_when_invisible = false;
+
// Create the object exposing the OpenGL API.
gles2_implementation_.reset(new gles2::GLES2Implementation(
gles2_helper_.get(),
share_group,
transfer_buffer_.get(),
- false,
+ bind_generates_resources,
+ free_everything_when_invisible,
command_buffer_.get()));
if (share_resources) {
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 6f6798f..62fc6d2 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -86,6 +86,7 @@ GLES2Implementation::GLES2Implementation(
ShareGroup* share_group,
TransferBufferInterface* transfer_buffer,
bool bind_generates_resource,
+ bool free_everything_when_invisible,
GpuControl* gpu_control)
: helper_(helper),
transfer_buffer_(transfer_buffer),
@@ -112,6 +113,8 @@ GLES2Implementation::GLES2Implementation(
current_query_(NULL),
error_message_callback_(NULL),
gpu_control_(gpu_control),
+ surface_visible_(true),
+ free_everything_when_invisible_(free_everything_when_invisible),
capabilities_(gpu_control->GetCapabilities()),
weak_ptr_factory_(this) {
DCHECK(helper);
@@ -337,6 +340,15 @@ void GLES2Implementation::SignalQuery(uint32 query,
callback));
}
+void GLES2Implementation::SetSurfaceVisible(bool visible) {
+ // TODO(piman): This probably should be ShallowFlushCHROMIUM().
+ Flush();
+ surface_visible_ = visible;
+ gpu_control_->SetSurfaceVisible(visible);
+ if (!visible)
+ FreeEverything();
+}
+
void GLES2Implementation::SendManagedMemoryStats(
const ManagedMemoryStats& stats) {
gpu_control_->SendManagedMemoryStats(stats);
@@ -835,6 +847,8 @@ void GLES2Implementation::Flush() {
// Flush our command buffer
// (tell the service to execute up to the flush cmd.)
helper_->CommandBufferHelper::Flush();
+ if (!surface_visible_ && free_everything_when_invisible_)
+ FreeEverything();
}
void GLES2Implementation::ShallowFlushCHROMIUM() {
@@ -843,11 +857,14 @@ void GLES2Implementation::ShallowFlushCHROMIUM() {
// Flush our command buffer
// (tell the service to execute up to the flush cmd.)
helper_->CommandBufferHelper::Flush();
+ // TODO(piman): Add the FreeEverything() logic here.
}
void GLES2Implementation::Finish() {
GPU_CLIENT_SINGLE_THREAD_CHECK();
FinishHelper();
+ if (!surface_visible_ && free_everything_when_invisible_)
+ FreeEverything();
}
void GLES2Implementation::ShallowFinishCHROMIUM() {
diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h
index c32f407..66b33d9 100644
--- a/gpu/command_buffer/client/gles2_implementation.h
+++ b/gpu/command_buffer/client/gles2_implementation.h
@@ -185,6 +185,7 @@ class GLES2_IMPL_EXPORT GLES2Implementation
ShareGroup* share_group,
TransferBufferInterface* transfer_buffer,
bool bind_generates_resource,
+ bool free_everything_when_invisible,
GpuControl* gpu_control);
virtual ~GLES2Implementation();
@@ -232,6 +233,7 @@ class GLES2_IMPL_EXPORT GLES2Implementation
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 ManagedMemoryStats& stats)
OVERRIDE;
@@ -695,6 +697,9 @@ class GLES2_IMPL_EXPORT GLES2Implementation
GpuControl* gpu_control_;
+ bool surface_visible_;
+ bool free_everything_when_invisible_;
+
Capabilities capabilities_;
base::WeakPtrFactory<GLES2Implementation> weak_ptr_factory_;
diff --git a/gpu/command_buffer/client/gles2_implementation_unittest.cc b/gpu/command_buffer/client/gles2_implementation_unittest.cc
index 5bc0c71..e6e0861 100644
--- a/gpu/command_buffer/client/gles2_implementation_unittest.cc
+++ b/gpu/command_buffer/client/gles2_implementation_unittest.cc
@@ -405,6 +405,7 @@ class GLES2ImplementationTest : public testing::Test {
NULL,
transfer_buffer_.get(),
bind_generates_resource,
+ false /* free_everything_when_invisible */,
gpu_control_.get()));
ASSERT_TRUE(gl_->Initialize(
kTransferBufferSize,
diff --git a/gpu/command_buffer/common/gpu_control.h b/gpu/command_buffer/common/gpu_control.h
index eb17153..1331a25 100644
--- a/gpu/command_buffer/common/gpu_control.h
+++ b/gpu/command_buffer/common/gpu_control.h
@@ -56,6 +56,8 @@ class GPU_EXPORT GpuControl {
// passed the glEndQueryEXT() point.
virtual void SignalQuery(uint32 query, const base::Closure& callback) = 0;
+ virtual void SetSurfaceVisible(bool visible) = 0;
+
virtual void SendManagedMemoryStats(const ManagedMemoryStats& stats) = 0;
private:
diff --git a/gpu/command_buffer/service/gpu_control_service.cc b/gpu/command_buffer/service/gpu_control_service.cc
index 1cb15bf..abb8e91 100644
--- a/gpu/command_buffer/service/gpu_control_service.cc
+++ b/gpu/command_buffer/service/gpu_control_service.cc
@@ -92,6 +92,10 @@ void GpuControlService::SignalQuery(uint32 query_id,
query->AddCallback(callback);
}
+void GpuControlService::SetSurfaceVisible(bool visible) {
+ NOTREACHED();
+}
+
void GpuControlService::SendManagedMemoryStats(
const ManagedMemoryStats& stats) {
NOTREACHED();
diff --git a/gpu/command_buffer/service/gpu_control_service.h b/gpu/command_buffer/service/gpu_control_service.h
index df77850..13bb3c0 100644
--- a/gpu/command_buffer/service/gpu_control_service.h
+++ b/gpu/command_buffer/service/gpu_control_service.h
@@ -46,6 +46,7 @@ class GPU_EXPORT GpuControlService : public GpuControl {
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 ManagedMemoryStats& stats)
OVERRIDE;
diff --git a/gpu/command_buffer/service/in_process_command_buffer.cc b/gpu/command_buffer/service/in_process_command_buffer.cc
index f8cc141..4de4531 100644
--- a/gpu/command_buffer/service/in_process_command_buffer.cc
+++ b/gpu/command_buffer/service/in_process_command_buffer.cc
@@ -729,6 +729,8 @@ void InProcessCommandBuffer::SignalQuery(unsigned query,
WrapCallback(callback)));
}
+void InProcessCommandBuffer::SetSurfaceVisible(bool visible) {}
+
void InProcessCommandBuffer::SendManagedMemoryStats(
const gpu::ManagedMemoryStats& stats) {
}
diff --git a/gpu/command_buffer/service/in_process_command_buffer.h b/gpu/command_buffer/service/in_process_command_buffer.h
index 404ac9d..6665b9f 100644
--- a/gpu/command_buffer/service/in_process_command_buffer.h
+++ b/gpu/command_buffer/service/in_process_command_buffer.h
@@ -122,6 +122,7 @@ class GPU_EXPORT InProcessCommandBuffer : public CommandBuffer,
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/gpu/command_buffer/tests/gl_manager.cc b/gpu/command_buffer/tests/gl_manager.cc
index 1da8d67..ff2de9c 100644
--- a/gpu/command_buffer/tests/gl_manager.cc
+++ b/gpu/command_buffer/tests/gl_manager.cc
@@ -189,12 +189,15 @@ void GLManager::Initialize(const GLManager::Options& options) {
// Create a transfer buffer.
transfer_buffer_.reset(new TransferBuffer(gles2_helper_.get()));
+ bool free_everything_when_invisible = false;
+
// Create the object exposing the OpenGL API.
gles2_implementation_.reset(new gles2::GLES2Implementation(
gles2_helper_.get(),
client_share_group,
transfer_buffer_.get(),
options.bind_generates_resource,
+ free_everything_when_invisible ,
gpu_control_.get()));
ASSERT_TRUE(gles2_implementation_->Initialize(
diff --git a/gpu/gles2_conform_support/egl/display.cc b/gpu/gles2_conform_support/egl/display.cc
index 118ef72..92d8f71 100644
--- a/gpu/gles2_conform_support/egl/display.cc
+++ b/gpu/gles2_conform_support/egl/display.cc
@@ -227,11 +227,16 @@ EGLContext Display::CreateContext(EGLConfig config,
DCHECK(command_buffer_ != NULL);
DCHECK(transfer_buffer_.get());
+
+ bool bind_generates_resources = true;
+ bool free_everything_when_invisible = false;
+
context_.reset(new gpu::gles2::GLES2Implementation(
gles2_cmd_helper_.get(),
NULL,
transfer_buffer_.get(),
- true,
+ bind_generates_resources,
+ free_everything_when_invisible,
gpu_control_.get()));
if (!context_->Initialize(
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(