| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 virtual std::string GetExtensions() OVERRIDE; | 42 virtual std::string GetExtensions() OVERRIDE; |
| 43 virtual void SetBufferAllocation(BufferAllocationState state) OVERRIDE; | 43 virtual void SetBufferAllocation(BufferAllocationState state) OVERRIDE; |
| 44 | 44 |
| 45 protected: | 45 protected: |
| 46 // ImageTransportSurface implementation | 46 // ImageTransportSurface implementation |
| 47 virtual void OnNewSurfaceACK(uint64 surface_handle, | 47 virtual void OnNewSurfaceACK(uint64 surface_handle, |
| 48 TransportDIB::Handle shm_handle) OVERRIDE; | 48 TransportDIB::Handle shm_handle) OVERRIDE; |
| 49 virtual void OnBuffersSwappedACK() OVERRIDE; | 49 virtual void OnBuffersSwappedACK() OVERRIDE; |
| 50 virtual void OnPostSubBufferACK() OVERRIDE; | 50 virtual void OnPostSubBufferACK() OVERRIDE; |
| 51 virtual void OnResizeViewACK() OVERRIDE; | 51 virtual void OnResizeViewACK() OVERRIDE; |
| 52 virtual void OnDiscardSurface(uint64 surface_id) OVERRIDE; |
| 52 virtual void OnResize(gfx::Size size) OVERRIDE; | 53 virtual void OnResize(gfx::Size size) OVERRIDE; |
| 53 | 54 |
| 54 private: | 55 private: |
| 55 virtual ~PbufferImageTransportSurface(); | 56 virtual ~PbufferImageTransportSurface(); |
| 56 void SendBuffersSwapped(); | 57 void SendBuffersSwapped(); |
| 57 void DestroySurface(); | 58 void DestroySurface(); |
| 58 | 59 |
| 59 // Tracks the current buffer allocation state. | 60 // Tracks the current buffer allocation state. |
| 60 BufferAllocationState buffer_allocation_state_; | 61 BufferAllocationState buffer_allocation_state_; |
| 61 | 62 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 void PbufferImageTransportSurface::OnNewSurfaceACK( | 181 void PbufferImageTransportSurface::OnNewSurfaceACK( |
| 181 uint64 surface_handle, | 182 uint64 surface_handle, |
| 182 TransportDIB::Handle shm_handle) { | 183 TransportDIB::Handle shm_handle) { |
| 183 NOTREACHED(); | 184 NOTREACHED(); |
| 184 } | 185 } |
| 185 | 186 |
| 186 void PbufferImageTransportSurface::OnResizeViewACK() { | 187 void PbufferImageTransportSurface::OnResizeViewACK() { |
| 187 NOTREACHED(); | 188 NOTREACHED(); |
| 188 } | 189 } |
| 189 | 190 |
| 191 void PbufferImageTransportSurface::OnDiscardSurface(uint64 surface_id) { |
| 192 } |
| 193 |
| 190 void PbufferImageTransportSurface::OnResize(gfx::Size size) { | 194 void PbufferImageTransportSurface::OnResize(gfx::Size size) { |
| 191 if (buffer_allocation_state_ == BUFFER_ALLOCATION_FRONT_AND_BACK) | 195 if (buffer_allocation_state_ == BUFFER_ALLOCATION_FRONT_AND_BACK) |
| 192 Resize(size); | 196 Resize(size); |
| 193 | 197 |
| 194 DestroySurface(); | 198 DestroySurface(); |
| 195 | 199 |
| 196 visible_size_ = size; | 200 visible_size_ = size; |
| 197 } | 201 } |
| 198 | 202 |
| 199 } // namespace anonymous | 203 } // namespace anonymous |
| (...skipping 28 matching lines...) Expand all Loading... |
| 228 handle.transport); | 232 handle.transport); |
| 229 } | 233 } |
| 230 | 234 |
| 231 if (surface->Initialize()) | 235 if (surface->Initialize()) |
| 232 return surface; | 236 return surface; |
| 233 else | 237 else |
| 234 return NULL; | 238 return NULL; |
| 235 } | 239 } |
| 236 | 240 |
| 237 #endif // ENABLE_GPU | 241 #endif // ENABLE_GPU |
| OLD | NEW |