| 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/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 private: | 95 private: |
| 96 SingleThreadProxy( | 96 SingleThreadProxy( |
| 97 LayerTreeHost* layer_tree_host, | 97 LayerTreeHost* layer_tree_host, |
| 98 LayerTreeHostSingleThreadClient* client, | 98 LayerTreeHostSingleThreadClient* client, |
| 99 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); | 99 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); |
| 100 | 100 |
| 101 void DoCommit(scoped_ptr<ResourceUpdateQueue> queue); | 101 void DoCommit(scoped_ptr<ResourceUpdateQueue> queue); |
| 102 bool DoComposite(base::TimeTicks frame_begin_time, | 102 bool DoComposite(base::TimeTicks frame_begin_time, |
| 103 LayerTreeHostImpl::FrameData* frame); | 103 LayerTreeHostImpl::FrameData* frame); |
| 104 void DidSwapFrame(); | 104 void DidSwapFrame(); |
| 105 void DidLoseOutputSurface(); |
| 105 | 106 |
| 106 bool ShouldComposite() const; | 107 bool ShouldComposite() const; |
| 107 void UpdateBackgroundAnimateTicking(); | 108 void UpdateBackgroundAnimateTicking(); |
| 108 | 109 |
| 109 // Accessed on main thread only. | 110 // Accessed on main thread only. |
| 110 LayerTreeHost* layer_tree_host_; | 111 LayerTreeHost* layer_tree_host_; |
| 111 LayerTreeHostSingleThreadClient* client_; | 112 LayerTreeHostSingleThreadClient* client_; |
| 112 | 113 |
| 113 // Used on the Thread, but checked on main thread during | 114 // Used on the Thread, but checked on main thread during |
| 114 // initialization/shutdown. | 115 // initialization/shutdown. |
| 115 scoped_ptr<LayerTreeHostImpl> layer_tree_host_impl_; | 116 scoped_ptr<LayerTreeHostImpl> layer_tree_host_impl_; |
| 116 RendererCapabilities renderer_capabilities_for_main_thread_; | 117 RendererCapabilities renderer_capabilities_for_main_thread_; |
| 117 | 118 |
| 118 bool next_frame_is_newly_committed_frame_; | 119 bool next_frame_is_newly_committed_frame_; |
| 119 | 120 |
| 120 bool inside_draw_; | 121 bool inside_draw_; |
| 121 | 122 |
| 123 base::WeakPtrFactory<SingleThreadProxy> weak_factory_; |
| 124 |
| 122 DISALLOW_COPY_AND_ASSIGN(SingleThreadProxy); | 125 DISALLOW_COPY_AND_ASSIGN(SingleThreadProxy); |
| 123 }; | 126 }; |
| 124 | 127 |
| 125 // For use in the single-threaded case. In debug builds, it pretends that the | 128 // For use in the single-threaded case. In debug builds, it pretends that the |
| 126 // code is running on the impl thread to satisfy assertion checks. | 129 // code is running on the impl thread to satisfy assertion checks. |
| 127 class DebugScopedSetImplThread { | 130 class DebugScopedSetImplThread { |
| 128 public: | 131 public: |
| 129 explicit DebugScopedSetImplThread(Proxy* proxy) : proxy_(proxy) { | 132 explicit DebugScopedSetImplThread(Proxy* proxy) : proxy_(proxy) { |
| 130 #if DCHECK_IS_ON | 133 #if DCHECK_IS_ON |
| 131 previous_value_ = proxy_->impl_thread_is_overridden_; | 134 previous_value_ = proxy_->impl_thread_is_overridden_; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 private: | 182 private: |
| 180 DebugScopedSetImplThread impl_thread_; | 183 DebugScopedSetImplThread impl_thread_; |
| 181 DebugScopedSetMainThreadBlocked main_thread_blocked_; | 184 DebugScopedSetMainThreadBlocked main_thread_blocked_; |
| 182 | 185 |
| 183 DISALLOW_COPY_AND_ASSIGN(DebugScopedSetImplThreadAndMainThreadBlocked); | 186 DISALLOW_COPY_AND_ASSIGN(DebugScopedSetImplThreadAndMainThreadBlocked); |
| 184 }; | 187 }; |
| 185 | 188 |
| 186 } // namespace cc | 189 } // namespace cc |
| 187 | 190 |
| 188 #endif // CC_TREES_SINGLE_THREAD_PROXY_H_ | 191 #endif // CC_TREES_SINGLE_THREAD_PROXY_H_ |
| OLD | NEW |