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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 extensions += extensions.empty() ? "" : " "; | 261 extensions += extensions.empty() ? "" : " "; |
262 extensions += "GL_CHROMIUM_front_buffer_cached "; | 262 extensions += "GL_CHROMIUM_front_buffer_cached "; |
263 extensions += "GL_CHROMIUM_post_sub_buffer"; | 263 extensions += "GL_CHROMIUM_post_sub_buffer"; |
264 return extensions; | 264 return extensions; |
265 } | 265 } |
266 | 266 |
267 gfx::Size IOSurfaceImageTransportSurface::GetSize() { | 267 gfx::Size IOSurfaceImageTransportSurface::GetSize() { |
268 return size_; | 268 return size_; |
269 } | 269 } |
270 | 270 |
271 void IOSurfaceImageTransportSurface::OnBufferPresented(bool presented, | 271 void IOSurfaceImageTransportSurface::OnBufferPresented(uint64 surface_handle, |
272 uint32 sync_point) { | 272 uint32 sync_point) { |
273 DCHECK(is_swap_buffers_pending_); | 273 DCHECK(is_swap_buffers_pending_); |
274 is_swap_buffers_pending_ = false; | 274 is_swap_buffers_pending_ = false; |
275 if (did_unschedule_) { | 275 if (did_unschedule_) { |
276 did_unschedule_ = false; | 276 did_unschedule_ = false; |
277 helper_->SetScheduled(true); | 277 helper_->SetScheduled(true); |
278 } | 278 } |
279 } | 279 } |
280 | 280 |
281 void IOSurfaceImageTransportSurface::OnResizeViewACK() { | 281 void IOSurfaceImageTransportSurface::OnResizeViewACK() { |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 } | 437 } |
438 if (surface->Initialize()) | 438 if (surface->Initialize()) |
439 return surface; | 439 return surface; |
440 else | 440 else |
441 return NULL; | 441 return NULL; |
442 } | 442 } |
443 | 443 |
444 } // namespace content | 444 } // namespace content |
445 | 445 |
446 #endif // defined(USE_GPU) | 446 #endif // defined(USE_GPU) |
OLD | NEW |