Commit d4b8353a authored by backer@chromium.org's avatar backer@chromium.org

Drop the backbuffer on hidden tabs on GLX image transport.

This saves VRAM usage when multiple accelerated tabs are open by dropping the backbuffer. We do this by resizing the the window. This orphans the GLXPixmap (and texture) that the browser uses to display the front buffer.

BUG=None
TEST=None


Review URL: http://codereview.chromium.org/8585030

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110540 0039d316-1c4b-4281-b951-d872f2087c98
parent 2bf834fb
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment