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(uint32 sync_point) OVERRIDE; | 60 virtual void OnBufferPresented(bool presented, |
| 61 uint32 sync_point) OVERRIDE; |
61 virtual void OnResizeViewACK() OVERRIDE; | 62 virtual void OnResizeViewACK() OVERRIDE; |
62 virtual void OnResize(gfx::Size size) OVERRIDE; | 63 virtual void OnResize(gfx::Size size) OVERRIDE; |
63 | 64 |
64 private: | 65 private: |
65 virtual ~IOSurfaceImageTransportSurface() OVERRIDE; | 66 virtual ~IOSurfaceImageTransportSurface() OVERRIDE; |
66 | 67 |
67 void AdjustBufferAllocation(); | 68 void AdjustBufferAllocation(); |
68 void UnrefIOSurface(); | 69 void UnrefIOSurface(); |
69 void CreateIOSurface(); | 70 void CreateIOSurface(); |
70 | 71 |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 extensions += extensions.empty() ? "" : " "; | 267 extensions += extensions.empty() ? "" : " "; |
267 extensions += "GL_CHROMIUM_front_buffer_cached "; | 268 extensions += "GL_CHROMIUM_front_buffer_cached "; |
268 extensions += "GL_CHROMIUM_post_sub_buffer"; | 269 extensions += "GL_CHROMIUM_post_sub_buffer"; |
269 return extensions; | 270 return extensions; |
270 } | 271 } |
271 | 272 |
272 gfx::Size IOSurfaceImageTransportSurface::GetSize() { | 273 gfx::Size IOSurfaceImageTransportSurface::GetSize() { |
273 return size_; | 274 return size_; |
274 } | 275 } |
275 | 276 |
276 void IOSurfaceImageTransportSurface::OnBufferPresented(uint32 sync_point) { | 277 void IOSurfaceImageTransportSurface::OnBufferPresented(bool presented, |
| 278 uint32 sync_point) { |
277 DCHECK(is_swap_buffers_pending_); | 279 DCHECK(is_swap_buffers_pending_); |
278 is_swap_buffers_pending_ = false; | 280 is_swap_buffers_pending_ = false; |
279 if (did_unschedule_) { | 281 if (did_unschedule_) { |
280 did_unschedule_ = false; | 282 did_unschedule_ = false; |
281 helper_->SetScheduled(true); | 283 helper_->SetScheduled(true); |
282 } | 284 } |
283 } | 285 } |
284 | 286 |
285 void IOSurfaceImageTransportSurface::OnResizeViewACK() { | 287 void IOSurfaceImageTransportSurface::OnResizeViewACK() { |
286 NOTREACHED(); | 288 NOTREACHED(); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 } | 437 } |
436 if (surface->Initialize()) | 438 if (surface->Initialize()) |
437 return surface; | 439 return surface; |
438 else | 440 else |
439 return NULL; | 441 return NULL; |
440 } | 442 } |
441 | 443 |
442 } // namespace content | 444 } // namespace content |
443 | 445 |
444 #endif // defined(USE_GPU) | 446 #endif // defined(USE_GPU) |
OLD | NEW |