| 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 #ifndef CC_SURFACES_SURFACE_H_ | 5 #ifndef CC_SURFACES_SURFACE_H_ |
| 6 #define CC_SURFACES_SURFACE_H_ | 6 #define CC_SURFACES_SURFACE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 void ActivatePendingFrame(); | 125 void ActivatePendingFrame(); |
| 126 // Called when all of the surface's dependencies have been resolved. | 126 // Called when all of the surface's dependencies have been resolved. |
| 127 void ActivateFrame(CompositorFrame frame); | 127 void ActivateFrame(CompositorFrame frame); |
| 128 void UpdateBlockingSurfaces( | 128 void UpdateBlockingSurfaces( |
| 129 const base::Optional<CompositorFrame>& previous_pending_frame, | 129 const base::Optional<CompositorFrame>& previous_pending_frame, |
| 130 const CompositorFrame& current_frame); | 130 const CompositorFrame& current_frame); |
| 131 | 131 |
| 132 void UnrefFrameResources(const CompositorFrame& frame_data); | 132 void UnrefFrameResources(const CompositorFrame& frame_data); |
| 133 void ClearCopyRequests(); | 133 void ClearCopyRequests(); |
| 134 | 134 |
| 135 void TakeLatencyInfoFromPendingFrame( |
| 136 std::vector<ui::LatencyInfo>* latency_info); |
| 137 static void TakeLatencyInfoFromFrame( |
| 138 CompositorFrame* frame, |
| 139 std::vector<ui::LatencyInfo>* latency_info); |
| 140 |
| 135 SurfaceId surface_id_; | 141 SurfaceId surface_id_; |
| 136 SurfaceId previous_frame_surface_id_; | 142 SurfaceId previous_frame_surface_id_; |
| 137 base::WeakPtr<SurfaceFactory> factory_; | 143 base::WeakPtr<SurfaceFactory> factory_; |
| 138 // TODO(jamesr): Support multiple frames in flight. | 144 // TODO(jamesr): Support multiple frames in flight. |
| 139 base::Optional<CompositorFrame> pending_frame_; | 145 base::Optional<CompositorFrame> pending_frame_; |
| 140 base::Optional<CompositorFrame> active_frame_; | 146 base::Optional<CompositorFrame> active_frame_; |
| 141 int frame_index_; | 147 int frame_index_; |
| 142 bool destroyed_; | 148 bool destroyed_; |
| 143 std::vector<SurfaceSequence> destruction_dependencies_; | 149 std::vector<SurfaceSequence> destruction_dependencies_; |
| 144 | 150 |
| 145 // This surface may have multiple BeginFrameSources if it is | 151 // This surface may have multiple BeginFrameSources if it is |
| 146 // on multiple Displays. | 152 // on multiple Displays. |
| 147 std::set<BeginFrameSource*> begin_frame_sources_; | 153 std::set<BeginFrameSource*> begin_frame_sources_; |
| 148 | 154 |
| 149 SurfaceDependencies blocking_surfaces_; | 155 SurfaceDependencies blocking_surfaces_; |
| 150 base::ObserverList<PendingFrameObserver, true> observers_; | 156 base::ObserverList<PendingFrameObserver, true> observers_; |
| 151 | 157 |
| 152 DrawCallback draw_callback_; | 158 DrawCallback draw_callback_; |
| 153 | 159 |
| 154 DISALLOW_COPY_AND_ASSIGN(Surface); | 160 DISALLOW_COPY_AND_ASSIGN(Surface); |
| 155 }; | 161 }; |
| 156 | 162 |
| 157 using PendingSurfaceSet = base::flat_set<Surface*>; | 163 using PendingSurfaceSet = base::flat_set<Surface*>; |
| 158 | 164 |
| 159 } // namespace cc | 165 } // namespace cc |
| 160 | 166 |
| 161 #endif // CC_SURFACES_SURFACE_H_ | 167 #endif // CC_SURFACES_SURFACE_H_ |
| OLD | NEW |