| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_TREES_SINGLE_THREAD_PROXY_H_ | 5 #ifndef CC_TREES_SINGLE_THREAD_PROXY_H_ |
| 6 #define CC_TREES_SINGLE_THREAD_PROXY_H_ | 6 #define CC_TREES_SINGLE_THREAD_PROXY_H_ |
| 7 | 7 |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/cancelable_callback.h" | 10 #include "base/cancelable_callback.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 void DoPainting(); | 115 void DoPainting(); |
| 116 void DoCommit(); | 116 void DoCommit(); |
| 117 DrawResult DoComposite(LayerTreeHostImpl::FrameData* frame); | 117 DrawResult DoComposite(LayerTreeHostImpl::FrameData* frame); |
| 118 void DoSwap(); | 118 void DoSwap(); |
| 119 void DidCommitAndDrawFrame(); | 119 void DidCommitAndDrawFrame(); |
| 120 void CommitComplete(); | 120 void CommitComplete(); |
| 121 | 121 |
| 122 bool ShouldComposite() const; | 122 bool ShouldComposite() const; |
| 123 void ScheduleRequestNewCompositorFrameSink(); | 123 void ScheduleRequestNewCompositorFrameSink(); |
| 124 | 124 |
| 125 void DidReceiveCompositorFrameAck(); |
| 126 |
| 125 // Accessed on main thread only. | 127 // Accessed on main thread only. |
| 126 LayerTreeHost* layer_tree_host_; | 128 LayerTreeHost* layer_tree_host_; |
| 127 LayerTreeHostSingleThreadClient* single_thread_client_; | 129 LayerTreeHostSingleThreadClient* single_thread_client_; |
| 128 | 130 |
| 129 TaskRunnerProvider* task_runner_provider_; | 131 TaskRunnerProvider* task_runner_provider_; |
| 130 | 132 |
| 131 // Used on the Thread, but checked on main thread during | 133 // Used on the Thread, but checked on main thread during |
| 132 // initialization/shutdown. | 134 // initialization/shutdown. |
| 133 std::unique_ptr<LayerTreeHostImpl> layer_tree_host_impl_; | 135 std::unique_ptr<LayerTreeHostImpl> layer_tree_host_impl_; |
| 134 | 136 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 151 // True if a request to the LayerTreeHostClient to create an output surface | 153 // True if a request to the LayerTreeHostClient to create an output surface |
| 152 // is still outstanding. | 154 // is still outstanding. |
| 153 bool compositor_frame_sink_creation_requested_; | 155 bool compositor_frame_sink_creation_requested_; |
| 154 // When output surface is lost, is set to true until a new output surface is | 156 // When output surface is lost, is set to true until a new output surface is |
| 155 // initialized. | 157 // initialized. |
| 156 bool compositor_frame_sink_lost_; | 158 bool compositor_frame_sink_lost_; |
| 157 | 159 |
| 158 // This is the callback for the scheduled RequestNewCompositorFrameSink. | 160 // This is the callback for the scheduled RequestNewCompositorFrameSink. |
| 159 base::CancelableClosure compositor_frame_sink_creation_callback_; | 161 base::CancelableClosure compositor_frame_sink_creation_callback_; |
| 160 | 162 |
| 163 // WeakPtrs generated by this factory will be invalidated when |
| 164 // CompositorFrameSink is released. |
| 165 base::WeakPtrFactory<SingleThreadProxy> compositor_frame_sink_weak_factory_; |
| 166 |
| 161 base::WeakPtrFactory<SingleThreadProxy> weak_factory_; | 167 base::WeakPtrFactory<SingleThreadProxy> weak_factory_; |
| 162 | 168 |
| 163 DISALLOW_COPY_AND_ASSIGN(SingleThreadProxy); | 169 DISALLOW_COPY_AND_ASSIGN(SingleThreadProxy); |
| 164 }; | 170 }; |
| 165 | 171 |
| 166 // For use in the single-threaded case. In debug builds, it pretends that the | 172 // For use in the single-threaded case. In debug builds, it pretends that the |
| 167 // code is running on the impl thread to satisfy assertion checks. | 173 // code is running on the impl thread to satisfy assertion checks. |
| 168 class DebugScopedSetImplThread { | 174 class DebugScopedSetImplThread { |
| 169 public: | 175 public: |
| 170 #if DCHECK_IS_ON() | 176 #if DCHECK_IS_ON() |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 private: | 240 private: |
| 235 DebugScopedSetImplThread impl_thread_; | 241 DebugScopedSetImplThread impl_thread_; |
| 236 DebugScopedSetMainThreadBlocked main_thread_blocked_; | 242 DebugScopedSetMainThreadBlocked main_thread_blocked_; |
| 237 | 243 |
| 238 DISALLOW_COPY_AND_ASSIGN(DebugScopedSetImplThreadAndMainThreadBlocked); | 244 DISALLOW_COPY_AND_ASSIGN(DebugScopedSetImplThreadAndMainThreadBlocked); |
| 239 }; | 245 }; |
| 240 | 246 |
| 241 } // namespace cc | 247 } // namespace cc |
| 242 | 248 |
| 243 #endif // CC_TREES_SINGLE_THREAD_PROXY_H_ | 249 #endif // CC_TREES_SINGLE_THREAD_PROXY_H_ |
| OLD | NEW |