| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if defined(ENABLE_GPU) | 5 #if defined(ENABLE_GPU) |
| 6 | 6 |
| 7 #include "content/common/gpu/image_transport_surface.h" | 7 #include "content/common/gpu/image_transport_surface.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 virtual bool Initialize(); | 36 virtual bool Initialize(); |
| 37 virtual void Destroy(); | 37 virtual void Destroy(); |
| 38 virtual bool IsOffscreen(); | 38 virtual bool IsOffscreen(); |
| 39 virtual bool SwapBuffers(); | 39 virtual bool SwapBuffers(); |
| 40 | 40 |
| 41 protected: | 41 protected: |
| 42 // ImageTransportSurface implementation | 42 // ImageTransportSurface implementation |
| 43 virtual void OnNewSurfaceACK(uint64 surface_id, | 43 virtual void OnNewSurfaceACK(uint64 surface_id, |
| 44 TransportDIB::Handle shm_handle) OVERRIDE; | 44 TransportDIB::Handle shm_handle) OVERRIDE; |
| 45 virtual void OnBuffersSwappedACK() OVERRIDE; | 45 virtual void OnBuffersSwappedACK() OVERRIDE; |
| 46 virtual void OnPostSubBufferACK() OVERRIDE; |
| 46 virtual void OnResizeViewACK() OVERRIDE; | 47 virtual void OnResizeViewACK() OVERRIDE; |
| 47 virtual void OnResize(gfx::Size size) OVERRIDE; | 48 virtual void OnResize(gfx::Size size) OVERRIDE; |
| 48 | 49 |
| 49 private: | 50 private: |
| 50 virtual ~PbufferImageTransportSurface(); | 51 virtual ~PbufferImageTransportSurface(); |
| 51 void SendBuffersSwapped(); | 52 void SendBuffersSwapped(); |
| 52 | 53 |
| 53 scoped_ptr<ImageTransportHelper> helper_; | 54 scoped_ptr<ImageTransportHelper> helper_; |
| 54 | 55 |
| 55 DISALLOW_COPY_AND_ASSIGN(PbufferImageTransportSurface); | 56 DISALLOW_COPY_AND_ASSIGN(PbufferImageTransportSurface); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 params.size = GetSize(); | 115 params.size = GetSize(); |
| 115 helper_->SendAcceleratedSurfaceBuffersSwapped(params); | 116 helper_->SendAcceleratedSurfaceBuffersSwapped(params); |
| 116 | 117 |
| 117 helper_->SetScheduled(false); | 118 helper_->SetScheduled(false); |
| 118 } | 119 } |
| 119 | 120 |
| 120 void PbufferImageTransportSurface::OnBuffersSwappedACK() { | 121 void PbufferImageTransportSurface::OnBuffersSwappedACK() { |
| 121 helper_->SetScheduled(true); | 122 helper_->SetScheduled(true); |
| 122 } | 123 } |
| 123 | 124 |
| 125 void PbufferImageTransportSurface::OnPostSubBufferACK() { |
| 126 NOTREACHED(); |
| 127 } |
| 128 |
| 124 void PbufferImageTransportSurface::OnNewSurfaceACK( | 129 void PbufferImageTransportSurface::OnNewSurfaceACK( |
| 125 uint64 surface_id, | 130 uint64 surface_id, |
| 126 TransportDIB::Handle shm_handle) { | 131 TransportDIB::Handle shm_handle) { |
| 127 NOTIMPLEMENTED(); | 132 NOTREACHED(); |
| 128 } | 133 } |
| 129 | 134 |
| 130 void PbufferImageTransportSurface::OnResizeViewACK() { | 135 void PbufferImageTransportSurface::OnResizeViewACK() { |
| 131 NOTIMPLEMENTED(); | 136 NOTREACHED(); |
| 132 } | 137 } |
| 133 | 138 |
| 134 void PbufferImageTransportSurface::OnResize(gfx::Size size) { | 139 void PbufferImageTransportSurface::OnResize(gfx::Size size) { |
| 135 Resize(size); | 140 Resize(size); |
| 136 } | 141 } |
| 137 | 142 |
| 138 } // namespace anonymous | 143 } // namespace anonymous |
| 139 | 144 |
| 140 // static | 145 // static |
| 141 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface( | 146 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface( |
| (...skipping 25 matching lines...) Expand all Loading... |
| 167 surface.get()); | 172 surface.get()); |
| 168 } | 173 } |
| 169 | 174 |
| 170 if (surface->Initialize()) | 175 if (surface->Initialize()) |
| 171 return surface; | 176 return surface; |
| 172 else | 177 else |
| 173 return NULL; | 178 return NULL; |
| 174 } | 179 } |
| 175 | 180 |
| 176 #endif // ENABLE_GPU | 181 #endif // ENABLE_GPU |
| OLD | NEW |