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

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

Issue 8585030: Drop the backbuffer on hidden tabs on GLX image transport. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address reviewer comment Created 9 years, 1 month 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 | « no previous file | no next file » | 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 a394c9b6a7b8fe6449ee3c35f5e96500bd2e8fff..5cc75badd1c9ad9060a167ee30257e2448479014 100644
--- a/content/common/gpu/image_transport_surface_linux.cc
+++ b/content/common/gpu/image_transport_surface_linux.cc
@@ -112,6 +112,7 @@ class GLXImageTransportSurface : public ImageTransportSurface,
virtual bool SwapBuffers() OVERRIDE;
virtual gfx::Size GetSize() OVERRIDE;
virtual bool OnMakeCurrent(gfx::GLContext* context) OVERRIDE;
+ virtual void SetVisible(bool visible) OVERRIDE;
protected:
// ImageTransportSurface implementation:
@@ -461,6 +462,17 @@ void GLXImageTransportSurface::ReleaseSurface() {
bound_ = false;
}
+void GLXImageTransportSurface::SetVisible(bool visible) {
+ Display* dpy = static_cast<Display*>(GetDisplay());
+ if (!visible) {
+ XResizeWindow(dpy, window_, 1, 1);
+ } else {
+ XResizeWindow(dpy, window_, size_.width(), size_.height());
+ needs_resize_ = true;
+ }
+ glXWaitX();
+}
+
void GLXImageTransportSurface::OnResize(gfx::Size size) {
TRACE_EVENT0("gpu", "GLXImageTransportSurface::OnResize");
size_ = size;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698