| 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/mac/scoped_cftyperef.h" | 9 #include "base/mac/scoped_cftyperef.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; | 50 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; |
| 51 virtual std::string GetExtensions() OVERRIDE; | 51 virtual std::string GetExtensions() OVERRIDE; |
| 52 virtual gfx::Size GetSize() OVERRIDE; | 52 virtual gfx::Size GetSize() OVERRIDE; |
| 53 virtual bool OnMakeCurrent(gfx::GLContext* context) OVERRIDE; | 53 virtual bool OnMakeCurrent(gfx::GLContext* context) OVERRIDE; |
| 54 virtual unsigned int GetBackingFrameBufferObject() OVERRIDE; | 54 virtual unsigned int GetBackingFrameBufferObject() OVERRIDE; |
| 55 virtual void SetBackbufferAllocation(bool allocated) OVERRIDE; | 55 virtual void SetBackbufferAllocation(bool allocated) OVERRIDE; |
| 56 virtual void SetFrontbufferAllocation(bool allocated) OVERRIDE; | 56 virtual void SetFrontbufferAllocation(bool allocated) OVERRIDE; |
| 57 | 57 |
| 58 protected: | 58 protected: |
| 59 // ImageTransportSurface implementation | 59 // ImageTransportSurface implementation |
| 60 virtual void OnBufferPresented(bool presented, | 60 virtual void OnBufferPresented(uint64 surface_handle, |
| 61 uint32 sync_point) OVERRIDE; | 61 uint32 sync_point) OVERRIDE; |
| 62 virtual void OnResizeViewACK() OVERRIDE; | 62 virtual void OnResizeViewACK() OVERRIDE; |
| 63 virtual void OnResize(gfx::Size size) OVERRIDE; | 63 virtual void OnResize(gfx::Size size) OVERRIDE; |
| 64 | 64 |
| 65 private: | 65 private: |
| 66 virtual ~IOSurfaceImageTransportSurface() OVERRIDE; | 66 virtual ~IOSurfaceImageTransportSurface() OVERRIDE; |
| 67 | 67 |
| 68 void AdjustBufferAllocation(); | 68 void AdjustBufferAllocation(); |
| 69 void UnrefIOSurface(); | 69 void UnrefIOSurface(); |
| 70 void CreateIOSurface(); | 70 void CreateIOSurface(); |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 extensions += extensions.empty() ? "" : " "; | 269 extensions += extensions.empty() ? "" : " "; |
| 270 extensions += "GL_CHROMIUM_front_buffer_cached "; | 270 extensions += "GL_CHROMIUM_front_buffer_cached "; |
| 271 extensions += "GL_CHROMIUM_post_sub_buffer"; | 271 extensions += "GL_CHROMIUM_post_sub_buffer"; |
| 272 return extensions; | 272 return extensions; |
| 273 } | 273 } |
| 274 | 274 |
| 275 gfx::Size IOSurfaceImageTransportSurface::GetSize() { | 275 gfx::Size IOSurfaceImageTransportSurface::GetSize() { |
| 276 return size_; | 276 return size_; |
| 277 } | 277 } |
| 278 | 278 |
| 279 void IOSurfaceImageTransportSurface::OnBufferPresented(bool presented, | 279 void IOSurfaceImageTransportSurface::OnBufferPresented(uint64 surface_handle, |
| 280 uint32 sync_point) { | 280 uint32 sync_point) { |
| 281 DCHECK(is_swap_buffers_pending_); | 281 DCHECK(is_swap_buffers_pending_); |
| 282 is_swap_buffers_pending_ = false; | 282 is_swap_buffers_pending_ = false; |
| 283 if (did_unschedule_) { | 283 if (did_unschedule_) { |
| 284 did_unschedule_ = false; | 284 did_unschedule_ = false; |
| 285 helper_->SetScheduled(true); | 285 helper_->SetScheduled(true); |
| 286 } | 286 } |
| 287 } | 287 } |
| 288 | 288 |
| 289 void IOSurfaceImageTransportSurface::OnResizeViewACK() { | 289 void IOSurfaceImageTransportSurface::OnResizeViewACK() { |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 } | 439 } |
| 440 if (surface->Initialize()) | 440 if (surface->Initialize()) |
| 441 return surface; | 441 return surface; |
| 442 else | 442 else |
| 443 return NULL; | 443 return NULL; |
| 444 } | 444 } |
| 445 | 445 |
| 446 } // namespace content | 446 } // namespace content |
| 447 | 447 |
| 448 #endif // defined(USE_GPU) | 448 #endif // defined(USE_GPU) |
| OLD | NEW |