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

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

Issue 7890046: Command to mark surface inactive, so gpu process can release resources. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: final rebase and added comments Created 9 years, 2 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_messages.h ('k') | content/renderer/gpu/command_buffer_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/image_transport_surface_linux.cc
diff --git a/content/common/gpu/image_transport_surface_linux.cc b/content/common/gpu/image_transport_surface_linux.cc
index 079294f2bcdcc833edb527e8a9d3e92dd1985673..f003b5efa6cc4bff3b0896acfe86c292d034da10 100644
--- a/content/common/gpu/image_transport_surface_linux.cc
+++ b/content/common/gpu/image_transport_surface_linux.cc
@@ -69,6 +69,7 @@ class EGLImageTransportSurface : public ImageTransportSurface,
virtual gfx::Size GetSize() OVERRIDE;
virtual void OnMakeCurrent(gfx::GLContext* context) OVERRIDE;
virtual unsigned int GetBackingFrameBufferObject() OVERRIDE;
+ virtual void SetVisible(bool visible) OVERRIDE;
protected:
// ImageTransportSurface implementation
@@ -270,6 +271,15 @@ unsigned int EGLImageTransportSurface::GetBackingFrameBufferObject() {
return fbo_id_;
}
+void EGLImageTransportSurface::SetVisible(bool visible) {
+ if (!visible && back_surface_.get() && front_surface_.get()) {
+ ReleaseSurface(&back_surface_);
+ } else if (visible && !back_surface_.get() && front_surface_.get()) {
+ // Leverage the OnResize hook because it does exactly what we want
+ OnResize(front_surface_->size());
+ }
+}
+
void EGLImageTransportSurface::ReleaseSurface(
scoped_refptr<EGLAcceleratedSurface>* surface) {
if (surface->get()) {
« no previous file with comments | « content/common/gpu/gpu_messages.h ('k') | content/renderer/gpu/command_buffer_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698