| 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 28 matching lines...) Expand all Loading... |
| 39 virtual bool DeferDraws() OVERRIDE; | 39 virtual bool DeferDraws() OVERRIDE; |
| 40 virtual bool IsOffscreen() OVERRIDE; | 40 virtual bool IsOffscreen() OVERRIDE; |
| 41 virtual bool SwapBuffers() OVERRIDE; | 41 virtual bool SwapBuffers() OVERRIDE; |
| 42 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; | 42 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; |
| 43 virtual std::string GetExtensions() OVERRIDE; | 43 virtual std::string GetExtensions() OVERRIDE; |
| 44 virtual void SetBackbufferAllocation(bool allocated) OVERRIDE; | 44 virtual void SetBackbufferAllocation(bool allocated) OVERRIDE; |
| 45 virtual void SetFrontbufferAllocation(bool allocated) OVERRIDE; | 45 virtual void SetFrontbufferAllocation(bool allocated) OVERRIDE; |
| 46 | 46 |
| 47 protected: | 47 protected: |
| 48 // ImageTransportSurface implementation | 48 // ImageTransportSurface implementation |
| 49 virtual void OnNewSurfaceACK(uint64 surface_handle, | |
| 50 TransportDIB::Handle shm_handle) OVERRIDE; | |
| 51 virtual void OnBufferPresented(uint32 sync_point) OVERRIDE; | 49 virtual void OnBufferPresented(uint32 sync_point) OVERRIDE; |
| 52 virtual void OnResizeViewACK() OVERRIDE; | 50 virtual void OnResizeViewACK() OVERRIDE; |
| 53 virtual void OnResize(gfx::Size size) OVERRIDE; | 51 virtual void OnResize(gfx::Size size) OVERRIDE; |
| 54 virtual gfx::Size GetSize() OVERRIDE; | 52 virtual gfx::Size GetSize() OVERRIDE; |
| 55 | 53 |
| 56 private: | 54 private: |
| 57 virtual ~PbufferImageTransportSurface(); | 55 virtual ~PbufferImageTransportSurface(); |
| 58 void SendBuffersSwapped(); | 56 void SendBuffersSwapped(); |
| 59 void DestroySurface(); | 57 void DestroySurface(); |
| 60 | 58 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 } | 202 } |
| 205 | 203 |
| 206 void PbufferImageTransportSurface::OnBufferPresented(uint32 sync_point) { | 204 void PbufferImageTransportSurface::OnBufferPresented(uint32 sync_point) { |
| 207 is_swap_buffers_pending_ = false; | 205 is_swap_buffers_pending_ = false; |
| 208 if (did_unschedule_) { | 206 if (did_unschedule_) { |
| 209 did_unschedule_ = false; | 207 did_unschedule_ = false; |
| 210 helper_->SetScheduled(true); | 208 helper_->SetScheduled(true); |
| 211 } | 209 } |
| 212 } | 210 } |
| 213 | 211 |
| 214 void PbufferImageTransportSurface::OnNewSurfaceACK( | |
| 215 uint64 surface_handle, | |
| 216 TransportDIB::Handle shm_handle) { | |
| 217 NOTREACHED(); | |
| 218 } | |
| 219 | |
| 220 void PbufferImageTransportSurface::OnResizeViewACK() { | 212 void PbufferImageTransportSurface::OnResizeViewACK() { |
| 221 NOTREACHED(); | 213 NOTREACHED(); |
| 222 } | 214 } |
| 223 | 215 |
| 224 void PbufferImageTransportSurface::OnResize(gfx::Size size) { | 216 void PbufferImageTransportSurface::OnResize(gfx::Size size) { |
| 225 DCHECK(backbuffer_suggested_allocation_); | 217 DCHECK(backbuffer_suggested_allocation_); |
| 226 DCHECK(frontbuffer_suggested_allocation_); | 218 DCHECK(frontbuffer_suggested_allocation_); |
| 227 Resize(size); | 219 Resize(size); |
| 228 | 220 |
| 229 DestroySurface(); | 221 DestroySurface(); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 handle.transport); | 259 handle.transport); |
| 268 } | 260 } |
| 269 | 261 |
| 270 if (surface->Initialize()) | 262 if (surface->Initialize()) |
| 271 return surface; | 263 return surface; |
| 272 else | 264 else |
| 273 return NULL; | 265 return NULL; |
| 274 } | 266 } |
| 275 | 267 |
| 276 #endif // ENABLE_GPU | 268 #endif // ENABLE_GPU |
| OLD | NEW |