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 #include "cc/thread_proxy.h" | 5 #include "cc/thread_proxy.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "cc/delay_based_time_source.h" | 10 #include "cc/delay_based_time_source.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 Proxy::implThread()->postTask(base::Bind(&ThreadProxy::requestStartPageScale
AnimationOnImplThread, m_implThreadWeakPtr, targetOffset, useAnchor, scale, dura
tion)); | 131 Proxy::implThread()->postTask(base::Bind(&ThreadProxy::requestStartPageScale
AnimationOnImplThread, m_implThreadWeakPtr, targetOffset, useAnchor, scale, dura
tion)); |
132 } | 132 } |
133 | 133 |
134 void ThreadProxy::requestStartPageScaleAnimationOnImplThread(gfx::Vector2d targe
tOffset, bool useAnchor, float scale, base::TimeDelta duration) | 134 void ThreadProxy::requestStartPageScaleAnimationOnImplThread(gfx::Vector2d targe
tOffset, bool useAnchor, float scale, base::TimeDelta duration) |
135 { | 135 { |
136 DCHECK(Proxy::isImplThread()); | 136 DCHECK(Proxy::isImplThread()); |
137 if (m_layerTreeHostImpl.get()) | 137 if (m_layerTreeHostImpl.get()) |
138 m_layerTreeHostImpl->startPageScaleAnimation(targetOffset, useAnchor, sc
ale, base::TimeTicks::Now(), duration); | 138 m_layerTreeHostImpl->startPageScaleAnimation(targetOffset, useAnchor, sc
ale, base::TimeTicks::Now(), duration); |
139 } | 139 } |
140 | 140 |
| 141 void ThreadProxy::programmaticScroll(gfx::Vector2d targetOffset) |
| 142 { |
| 143 DCHECK(Proxy::isMainThread()); |
| 144 Proxy::implThread()->postTask(base::Bind(&ThreadProxy::requestProgrammaticSc
roll, m_implThreadWeakPtr, targetOffset)); |
| 145 } |
| 146 |
| 147 void ThreadProxy::requestProgrammaticScroll(gfx::Vector2d targetOffset) |
| 148 { |
| 149 DCHECK(Proxy::isImplThread()); |
| 150 if (m_layerTreeHostImpl.get()) |
| 151 m_layerTreeHostImpl->programmaticScroll(targetOffset); |
| 152 } |
| 153 |
141 void ThreadProxy::finishAllRendering() | 154 void ThreadProxy::finishAllRendering() |
142 { | 155 { |
143 DCHECK(Proxy::isMainThread()); | 156 DCHECK(Proxy::isMainThread()); |
144 DCHECK(!m_deferCommits); | 157 DCHECK(!m_deferCommits); |
145 | 158 |
146 // Make sure all GL drawing is finished on the impl thread. | 159 // Make sure all GL drawing is finished on the impl thread. |
147 DebugScopedSetMainThreadBlocked mainThreadBlocked(this); | 160 DebugScopedSetMainThreadBlocked mainThreadBlocked(this); |
148 CompletionEvent completion; | 161 CompletionEvent completion; |
149 Proxy::implThread()->postTask(base::Bind(&ThreadProxy::finishAllRenderingOnI
mplThread, m_implThreadWeakPtr, &completion)); | 162 Proxy::implThread()->postTask(base::Bind(&ThreadProxy::finishAllRenderingOnI
mplThread, m_implThreadWeakPtr, &completion)); |
150 completion.wait(); | 163 completion.wait(); |
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1171 | 1184 |
1172 void ThreadProxy::renewTreePriorityOnImplThread() | 1185 void ThreadProxy::renewTreePriorityOnImplThread() |
1173 { | 1186 { |
1174 DCHECK(m_renewTreePriorityOnImplThreadPending); | 1187 DCHECK(m_renewTreePriorityOnImplThreadPending); |
1175 m_renewTreePriorityOnImplThreadPending = false; | 1188 m_renewTreePriorityOnImplThreadPending = false; |
1176 | 1189 |
1177 renewTreePriority(); | 1190 renewTreePriority(); |
1178 } | 1191 } |
1179 | 1192 |
1180 } // namespace cc | 1193 } // namespace cc |
OLD | NEW |