Chromium Code Reviews| 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..034ff7fe8ee5a69d0d89e4b6c8125a93d63fbaa6 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,10 @@ void GLXImageTransportSurface::OnResize(gfx::Size size) { |
| helper_->SetScheduled(false); |
| } |
| +void GLXImageTransportSurface::OnSurfaceVisible(bool visible) { |
| + NOTREACHED(); |
|
jonathan.backer
2011/10/07 15:48:37
Probably will be reached?
You'll need to add this
|
| +} |
| + |
| bool GLXImageTransportSurface::SwapBuffers() { |
| gfx::NativeViewGLSurfaceGLX::SwapBuffers(); |
| glFlush(); |
| @@ -493,6 +509,10 @@ void OSMesaImageTransportSurface::OnResize(gfx::Size size) { |
| helper_->SetScheduled(false); |
| } |
| +void OSMesaImageTransportSurface::OnSurfaceVisible(bool visible) { |
| + NOTREACHED(); |
| +} |
| + |
| void OSMesaImageTransportSurface::OnNewSurfaceACK( |
| uint64 surface_id, TransportDIB::Handle surface_handle) { |
| shared_id_ = surface_id; |