| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "content/common/gpu/image_transport_surface_iosurface_mac.h" | 5 #include "content/common/gpu/image_transport_surface_iosurface_mac.h" |
| 6 | 6 |
| 7 #include "content/common/gpu/gpu_messages.h" | 7 #include "content/common/gpu/gpu_messages.h" |
| 8 #include "content/common/gpu/surface_handle_types_mac.h" | 8 #include "content/common/gpu/surface_handle_types_mac.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 glFlush(); | 99 glFlush(); |
| 100 return true; | 100 return true; |
| 101 } | 101 } |
| 102 | 102 |
| 103 void IOSurfaceStorageProvider::FreeColorBufferStorage() { | 103 void IOSurfaceStorageProvider::FreeColorBufferStorage() { |
| 104 io_surface_.reset(); | 104 io_surface_.reset(); |
| 105 io_surface_id_ = 0; | 105 io_surface_id_ = 0; |
| 106 } | 106 } |
| 107 | 107 |
| 108 uint64 IOSurfaceStorageProvider::GetSurfaceHandle() const { | 108 void IOSurfaceStorageProvider::SwapBuffers( |
| 109 return SurfaceHandleFromIOSurfaceID(io_surface_id_); | 109 const gfx::Size& size, float scale_factor) { |
| 110 } | |
| 111 | |
| 112 void IOSurfaceStorageProvider::WillSwapBuffers() { | |
| 113 // The browser compositor will throttle itself, so we are free to unblock the | 110 // The browser compositor will throttle itself, so we are free to unblock the |
| 114 // context immediately. Make sure that the browser is doing its throttling | 111 // context immediately. Make sure that the browser is doing its throttling |
| 115 // appropriately by ensuring that the previous swap was acknowledged before | 112 // appropriately by ensuring that the previous swap was acknowledged before |
| 116 // we get another swap. | 113 // we get another swap. |
| 117 DCHECK(pending_swapped_surfaces_.empty()); | 114 DCHECK(pending_swapped_surfaces_.empty()); |
| 118 pending_swapped_surfaces_.push_back(io_surface_); | 115 pending_swapped_surfaces_.push_back(io_surface_); |
| 119 transport_surface_->UnblockContextAfterPendingSwap(); | 116 |
| 117 transport_surface_->SendSwapBuffers( |
| 118 SurfaceHandleFromIOSurfaceID(io_surface_id_), size, scale_factor); |
| 120 } | 119 } |
| 121 | 120 |
| 122 void IOSurfaceStorageProvider::CanFreeSwappedBuffer() { | 121 void IOSurfaceStorageProvider::WillWriteToBackbuffer() { |
| 122 } |
| 123 |
| 124 void IOSurfaceStorageProvider::DiscardBackbuffer() { |
| 125 } |
| 126 |
| 127 void IOSurfaceStorageProvider::SwapBuffersAckedByBrowser() { |
| 123 DCHECK(!pending_swapped_surfaces_.empty()); | 128 DCHECK(!pending_swapped_surfaces_.empty()); |
| 124 pending_swapped_surfaces_.pop_front(); | 129 pending_swapped_surfaces_.pop_front(); |
| 125 } | 130 } |
| 126 | 131 |
| 127 } // namespace content | 132 } // namespace content |
| OLD | NEW |