| 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 // Out of order because it has conflicts with other includes on Windows. | 9 // Out of order because it has conflicts with other includes on Windows. |
| 10 #include "third_party/angle/include/EGL/egl.h" | 10 #include "third_party/angle/include/EGL/egl.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 virtual std::string GetExtensions() OVERRIDE; | 47 virtual std::string GetExtensions() OVERRIDE; |
| 48 virtual void SetBackbufferAllocation(bool allocated) OVERRIDE; | 48 virtual void SetBackbufferAllocation(bool allocated) OVERRIDE; |
| 49 virtual void SetFrontbufferAllocation(bool allocated) OVERRIDE; | 49 virtual void SetFrontbufferAllocation(bool allocated) OVERRIDE; |
| 50 | 50 |
| 51 protected: | 51 protected: |
| 52 // ImageTransportSurface implementation | 52 // ImageTransportSurface implementation |
| 53 virtual void OnBufferPresented( | 53 virtual void OnBufferPresented( |
| 54 const AcceleratedSurfaceMsg_BufferPresented_Params& params) OVERRIDE; | 54 const AcceleratedSurfaceMsg_BufferPresented_Params& params) OVERRIDE; |
| 55 virtual void OnResizeViewACK() OVERRIDE; | 55 virtual void OnResizeViewACK() OVERRIDE; |
| 56 virtual void OnResize(gfx::Size size) OVERRIDE; | 56 virtual void OnResize(gfx::Size size) OVERRIDE; |
| 57 virtual void SetLatencyInfo(const cc::LatencyInfo&) OVERRIDE; |
| 57 virtual gfx::Size GetSize() OVERRIDE; | 58 virtual gfx::Size GetSize() OVERRIDE; |
| 58 | 59 |
| 59 private: | 60 private: |
| 60 virtual ~PbufferImageTransportSurface(); | 61 virtual ~PbufferImageTransportSurface(); |
| 61 void SendBuffersSwapped(); | 62 void SendBuffersSwapped(); |
| 62 void DestroySurface(); | 63 void DestroySurface(); |
| 63 | 64 |
| 64 // Tracks the current buffer allocation state. | 65 // Tracks the current buffer allocation state. |
| 65 bool backbuffer_suggested_allocation_; | 66 bool backbuffer_suggested_allocation_; |
| 66 bool frontbuffer_suggested_allocation_; | 67 bool frontbuffer_suggested_allocation_; |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 void PbufferImageTransportSurface::OnResize(gfx::Size size) { | 224 void PbufferImageTransportSurface::OnResize(gfx::Size size) { |
| 224 DCHECK(backbuffer_suggested_allocation_); | 225 DCHECK(backbuffer_suggested_allocation_); |
| 225 DCHECK(frontbuffer_suggested_allocation_); | 226 DCHECK(frontbuffer_suggested_allocation_); |
| 226 Resize(size); | 227 Resize(size); |
| 227 | 228 |
| 228 DestroySurface(); | 229 DestroySurface(); |
| 229 | 230 |
| 230 visible_size_ = size; | 231 visible_size_ = size; |
| 231 } | 232 } |
| 232 | 233 |
| 234 void PbufferImageTransportSurface::SetLatencyInfo( |
| 235 const cc::LatencyInfo&) { |
| 236 // TODO: implement |
| 237 } |
| 238 |
| 233 gfx::Size PbufferImageTransportSurface::GetSize() { | 239 gfx::Size PbufferImageTransportSurface::GetSize() { |
| 234 return GLSurfaceAdapter::GetSize(); | 240 return GLSurfaceAdapter::GetSize(); |
| 235 } | 241 } |
| 236 | 242 |
| 237 } // namespace anonymous | 243 } // namespace anonymous |
| 238 | 244 |
| 239 // static | 245 // static |
| 240 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface( | 246 scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface( |
| 241 GpuChannelManager* manager, | 247 GpuChannelManager* manager, |
| 242 GpuCommandBufferStub* stub, | 248 GpuCommandBufferStub* stub, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 | 290 |
| 285 if (surface->Initialize()) | 291 if (surface->Initialize()) |
| 286 return surface; | 292 return surface; |
| 287 else | 293 else |
| 288 return NULL; | 294 return NULL; |
| 289 } | 295 } |
| 290 | 296 |
| 291 } // namespace content | 297 } // namespace content |
| 292 | 298 |
| 293 #endif // ENABLE_GPU | 299 #endif // ENABLE_GPU |
| OLD | NEW |