| 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 33891606bbf1c5bb0d10d933fbb781e4be2dcc8c..04f7fa6d2da157ac537c210aa5d01e2b5441c68b 100644
|
| --- a/content/common/gpu/image_transport_surface_linux.cc
|
| +++ b/content/common/gpu/image_transport_surface_linux.cc
|
| @@ -56,6 +56,7 @@ class EGLImageTransportSurface : public ImageTransportSurface,
|
| uint64 surface_id, TransportDIB::Handle surface_handle) OVERRIDE;
|
| virtual void OnBuffersSwappedACK() OVERRIDE;
|
| virtual void OnResize(gfx::Size size) OVERRIDE;
|
| + virtual void OnSurfaceVisible(bool visible) OVERRIDE;
|
|
|
| private:
|
| virtual ~EGLImageTransportSurface() OVERRIDE;
|
| @@ -94,6 +95,7 @@ class GLXImageTransportSurface : public ImageTransportSurface,
|
| uint64 surface_id, TransportDIB::Handle surface_handle) OVERRIDE;
|
| virtual void OnBuffersSwappedACK() OVERRIDE;
|
| virtual void OnResize(gfx::Size size) OVERRIDE;
|
| + virtual void OnSurfaceVisible(bool visible) OVERRIDE;
|
|
|
| private:
|
| virtual ~GLXImageTransportSurface();
|
| @@ -140,6 +142,7 @@ class OSMesaImageTransportSurface : public ImageTransportSurface,
|
| uint64 surface_id, TransportDIB::Handle surface_handle) OVERRIDE;
|
| virtual void OnBuffersSwappedACK() OVERRIDE;
|
| virtual void OnResize(gfx::Size size) OVERRIDE;
|
| + virtual void OnSurfaceVisible(bool visible) OVERRIDE;
|
|
|
| private:
|
| virtual ~OSMesaImageTransportSurface();
|
| @@ -246,6 +249,15 @@ void EGLImageTransportSurface::OnResize(gfx::Size size) {
|
| helper_->SetScheduled(false);
|
| }
|
|
|
| +void EGLImageTransportSurface::OnSurfaceVisible(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());
|
| + }
|
| +}
|
| +
|
| bool EGLImageTransportSurface::SwapBuffers() {
|
| front_surface_.swap(back_surface_);
|
| DCHECK_NE(front_surface_.get(), static_cast<AcceleratedSurface*>(NULL));
|
| @@ -389,6 +401,9 @@ void GLXImageTransportSurface::OnResize(gfx::Size size) {
|
| helper_->SetScheduled(false);
|
| }
|
|
|
| +void GLXImageTransportSurface::OnSurfaceVisible(bool visible) {
|
| +}
|
| +
|
| bool GLXImageTransportSurface::SwapBuffers() {
|
| gfx::NativeViewGLSurfaceGLX::SwapBuffers();
|
| glFlush();
|
| @@ -493,6 +508,9 @@ void OSMesaImageTransportSurface::OnResize(gfx::Size size) {
|
| helper_->SetScheduled(false);
|
| }
|
|
|
| +void OSMesaImageTransportSurface::OnSurfaceVisible(bool visible) {
|
| +}
|
| +
|
| void OSMesaImageTransportSurface::OnNewSurfaceACK(
|
| uint64 surface_id, TransportDIB::Handle surface_handle) {
|
| shared_id_ = surface_id;
|
|
|