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/test/layer_tree_test.h" | 5 #include "cc/test/layer_tree_test.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 void ScheduledActionInvalidateOutputSurface() override { | 174 void ScheduledActionInvalidateOutputSurface() override { |
175 ThreadProxy::ScheduledActionInvalidateOutputSurface(); | 175 ThreadProxy::ScheduledActionInvalidateOutputSurface(); |
176 test_hooks_->ScheduledActionInvalidateOutputSurface(); | 176 test_hooks_->ScheduledActionInvalidateOutputSurface(); |
177 } | 177 } |
178 | 178 |
179 void SendBeginMainFrameNotExpectedSoon() override { | 179 void SendBeginMainFrameNotExpectedSoon() override { |
180 ThreadProxy::SendBeginMainFrameNotExpectedSoon(); | 180 ThreadProxy::SendBeginMainFrameNotExpectedSoon(); |
181 test_hooks_->SendBeginMainFrameNotExpectedSoon(); | 181 test_hooks_->SendBeginMainFrameNotExpectedSoon(); |
182 } | 182 } |
183 | 183 |
| 184 void SetThrottleFrameProductionOnImpl(bool throttle) override { |
| 185 ThreadProxy::SetThrottleFrameProductionOnImpl(throttle); |
| 186 test_hooks_->SetThrottleFrameProductionOnImpl(throttle); |
| 187 } |
| 188 |
| 189 void InitializeOutputSurfaceOnImpl(OutputSurface* output_surface) override { |
| 190 ThreadProxy::InitializeOutputSurfaceOnImpl(output_surface); |
| 191 test_hooks_->InitializeOutputSurfaceOnImpl(output_surface); |
| 192 } |
| 193 |
| 194 void MainThreadHasStoppedFlingingOnImpl() override { |
| 195 ThreadProxy::MainThreadHasStoppedFlingingOnImpl(); |
| 196 test_hooks_->MainThreadHasStoppedFlingingOnImpl(); |
| 197 } |
| 198 |
| 199 void SetInputThrottledUntilCommitOnImpl(bool is_throttled) override { |
| 200 ThreadProxy::SetInputThrottledUntilCommitOnImpl(is_throttled); |
| 201 test_hooks_->SetInputThrottledUntilCommitOnImpl(is_throttled); |
| 202 } |
| 203 |
| 204 void UpdateTopControlsStateOnImpl(TopControlsState constraints, |
| 205 TopControlsState current, |
| 206 bool animate) override { |
| 207 ThreadProxy::UpdateTopControlsStateOnImpl(constraints, current, animate); |
| 208 test_hooks_->UpdateTopControlsStateOnImpl(constraints, current, animate); |
| 209 } |
| 210 |
| 211 void SetDeferCommitsOnImpl(bool defer_commits) const override { |
| 212 ThreadProxy::SetDeferCommitsOnImpl(defer_commits); |
| 213 test_hooks_->SetDeferCommitsOnImpl(defer_commits); |
| 214 } |
| 215 |
| 216 void BeginMainFrameAbortedOnImpl(CommitEarlyOutReason reason) override { |
| 217 ThreadProxy::BeginMainFrameAbortedOnImpl(reason); |
| 218 test_hooks_->BeginMainFrameAbortedOnImpl(reason); |
| 219 } |
| 220 |
| 221 void SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect) override { |
| 222 ThreadProxy::SetNeedsRedrawOnImpl(damage_rect); |
| 223 test_hooks_->SetNeedsRedrawOnImpl(damage_rect); |
| 224 }; |
| 225 |
| 226 void SetNeedsCommitOnImpl() override { |
| 227 ThreadProxy::SetNeedsCommitOnImpl(); |
| 228 test_hooks_->SetNeedsCommitOnImpl(); |
| 229 } |
| 230 |
| 231 void FinishAllRenderingOnImpl(CompletionEvent* completion) override { |
| 232 ThreadProxy::FinishAllRenderingOnImpl(completion); |
| 233 test_hooks_->FinishAllRenderingOnImpl(); |
| 234 }; |
| 235 |
| 236 void SetVisibleOnImpl(CompletionEvent* completion, bool visible) override { |
| 237 ThreadProxy::SetVisibleOnImpl(completion, visible); |
| 238 test_hooks_->SetVisibleOnImpl(visible); |
| 239 } |
| 240 |
| 241 void ReleaseOutputSurfaceOnImpl(CompletionEvent* completion) override { |
| 242 ThreadProxy::ReleaseOutputSurfaceOnImpl(completion); |
| 243 test_hooks_->ReleaseOutputSurfaceOnImpl(); |
| 244 } |
| 245 |
| 246 void FinishGLOnImpl(CompletionEvent* completion) override { |
| 247 ThreadProxy::FinishGLOnImpl(completion); |
| 248 test_hooks_->FinishGLOnImpl(); |
| 249 } |
| 250 |
| 251 void StartCommitOnImpl(CompletionEvent* completion) override { |
| 252 ThreadProxy::StartCommitOnImpl(completion); |
| 253 test_hooks_->StartCommitOnImpl(); |
| 254 } |
| 255 |
| 256 void DidCompleteSwapBuffers() override { |
| 257 ThreadProxy::DidCompleteSwapBuffers(); |
| 258 test_hooks_->ReceivedDidCompleteSwapBuffers(); |
| 259 } |
| 260 |
| 261 void SetRendererCapabilitiesMainCopy( |
| 262 const RendererCapabilities& capabilities) override { |
| 263 ThreadProxy::SetRendererCapabilitiesMainCopy(capabilities); |
| 264 test_hooks_->ReceivedSetRendererCapabilitiesMainCopy(capabilities); |
| 265 } |
| 266 |
| 267 void BeginMainFrameNotExpectedSoon() override { |
| 268 ThreadProxy::BeginMainFrameNotExpectedSoon(); |
| 269 test_hooks_->ReceivedBeginMainFrameNotExpectedSoon(); |
| 270 } |
| 271 |
| 272 void DidCommitAndDrawFrame() override { |
| 273 ThreadProxy::DidCommitAndDrawFrame(); |
| 274 test_hooks_->ReceivedDidCommitAndDrawFrame(); |
| 275 } |
| 276 |
| 277 void SetAnimationEvents(scoped_ptr<AnimationEventsVector> events) override { |
| 278 ThreadProxy::SetAnimationEvents(events.Pass()); |
| 279 test_hooks_->ReceivedSetAnimationEvents(); |
| 280 } |
| 281 |
| 282 void DidLoseOutputSurface() override { |
| 283 ThreadProxy::DidLoseOutputSurface(); |
| 284 test_hooks_->ReceivedDidLoseOutputSurface(); |
| 285 } |
| 286 |
| 287 void RequestNewOutputSurface() override { |
| 288 ThreadProxy::RequestNewOutputSurface(); |
| 289 test_hooks_->ReceivedRequestNewOutputSurface(); |
| 290 } |
| 291 |
| 292 void DidInitializeOutputSurface( |
| 293 bool success, |
| 294 const RendererCapabilities& capabilities) override { |
| 295 ThreadProxy::DidInitializeOutputSurface(success, capabilities); |
| 296 test_hooks_->ReceivedDidInitializeOutputSurface(success, capabilities); |
| 297 } |
| 298 |
| 299 void DidCompletePageScaleAnimation() override { |
| 300 ThreadProxy::DidCompletePageScaleAnimation(); |
| 301 test_hooks_->ReceivedDidCompletePageScaleAnimation(); |
| 302 } |
| 303 |
| 304 void PostFrameTimingEventsOnMain( |
| 305 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, |
| 306 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) |
| 307 override { |
| 308 ThreadProxy::PostFrameTimingEventsOnMain(composite_events.Pass(), |
| 309 main_frame_events.Pass()); |
| 310 test_hooks_->ReceivedPostFrameTimingEventsOnMain(); |
| 311 } |
| 312 |
| 313 void BeginMainFrame(scoped_ptr<BeginMainFrameAndCommitState> |
| 314 begin_main_frame_state) override { |
| 315 ThreadProxy::BeginMainFrame(begin_main_frame_state.Pass()); |
| 316 test_hooks_->ReceivedBeginMainFrame(); |
| 317 }; |
| 318 |
184 ThreadProxyForTest( | 319 ThreadProxyForTest( |
185 TestHooks* test_hooks, | 320 TestHooks* test_hooks, |
186 LayerTreeHost* host, | 321 LayerTreeHost* host, |
187 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 322 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
188 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, | 323 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
189 scoped_ptr<BeginFrameSource> external_begin_frame_source) | 324 scoped_ptr<BeginFrameSource> external_begin_frame_source) |
190 : ThreadProxy(host, main_task_runner, | 325 : ThreadProxy(host, main_task_runner, |
191 impl_task_runner, | 326 impl_task_runner, |
192 external_begin_frame_source.Pass()), | 327 external_begin_frame_source.Pass()), |
193 test_hooks_(test_hooks) {} | 328 test_hooks_(test_hooks) {} |
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 LayerTreeHost* LayerTreeTest::layer_tree_host() { | 1132 LayerTreeHost* LayerTreeTest::layer_tree_host() { |
998 // We check for a null proxy here as we sometimes ask for the layer tree host | 1133 // We check for a null proxy here as we sometimes ask for the layer tree host |
999 // when the proxy does not exist, often for checking settings after a test has | 1134 // when the proxy does not exist, often for checking settings after a test has |
1000 // completed. For example, LTHPixelResourceTest::RunPixelResourceTest. See | 1135 // completed. For example, LTHPixelResourceTest::RunPixelResourceTest. See |
1001 // elsewhere in this file for other examples. | 1136 // elsewhere in this file for other examples. |
1002 DCHECK(!proxy() || proxy()->IsMainThread() || proxy()->IsMainThreadBlocked()); | 1137 DCHECK(!proxy() || proxy()->IsMainThread() || proxy()->IsMainThreadBlocked()); |
1003 return layer_tree_host_.get(); | 1138 return layer_tree_host_.get(); |
1004 } | 1139 } |
1005 | 1140 |
1006 } // namespace cc | 1141 } // namespace cc |
OLD | NEW |