| 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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
| 10 #include "cc/animation/timing_function.h" | 10 #include "cc/animation/timing_function.h" |
| (...skipping 2299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2310 &LayerTreeHostTestBeginFrameNotification::EndTest, | 2310 &LayerTreeHostTestBeginFrameNotification::EndTest, |
| 2311 base::Unretained(this))); | 2311 base::Unretained(this))); |
| 2312 } | 2312 } |
| 2313 | 2313 |
| 2314 virtual void AfterTest() OVERRIDE {} | 2314 virtual void AfterTest() OVERRIDE {} |
| 2315 }; | 2315 }; |
| 2316 | 2316 |
| 2317 MULTI_THREAD_TEST_F( | 2317 MULTI_THREAD_TEST_F( |
| 2318 LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled); | 2318 LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled); |
| 2319 | 2319 |
| 2320 class LayerTreeHostTestInputDrivenRendering : public LayerTreeHostTest { | |
| 2321 public: | |
| 2322 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { | |
| 2323 settings->begin_frame_scheduling_enabled = true; | |
| 2324 } | |
| 2325 | |
| 2326 virtual void BeginTest() OVERRIDE { | |
| 2327 frame_time_ = base::TimeTicks::Now(); | |
| 2328 PostSetNeedsCommitToMainThread(); | |
| 2329 } | |
| 2330 | |
| 2331 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { | |
| 2332 // Post a task to send the final input event for the current BeginFrame; | |
| 2333 // it should trigger rendering. | |
| 2334 ImplThread()->PostTask( | |
| 2335 base::Bind(&LayerTreeHostTestInputDrivenRendering::SendFinalInputEvent, | |
| 2336 base::Unretained(this), | |
| 2337 base::Unretained(host_impl))); | |
| 2338 } | |
| 2339 | |
| 2340 void SendFinalInputEvent(LayerTreeHostImpl* host_impl) { | |
| 2341 host_impl->DidReceiveLastInputEventForBeginFrame(frame_time_); | |
| 2342 } | |
| 2343 | |
| 2344 virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { | |
| 2345 EXPECT_EQ(frame_time_, **host_impl->fps_counter()->begin()); | |
| 2346 EndTest(); | |
| 2347 } | |
| 2348 | |
| 2349 virtual void AfterTest() OVERRIDE {} | |
| 2350 | |
| 2351 private: | |
| 2352 base::TimeTicks frame_time_; | |
| 2353 }; | |
| 2354 | |
| 2355 MULTI_THREAD_TEST_F(LayerTreeHostTestInputDrivenRendering); | |
| 2356 | |
| 2357 class LayerTreeHostTestUninvertibleTransformDoesNotBlockActivation | 2320 class LayerTreeHostTestUninvertibleTransformDoesNotBlockActivation |
| 2358 : public LayerTreeHostTest { | 2321 : public LayerTreeHostTest { |
| 2359 protected: | 2322 protected: |
| 2360 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { | 2323 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { |
| 2361 settings->impl_side_painting = true; | 2324 settings->impl_side_painting = true; |
| 2362 } | 2325 } |
| 2363 | 2326 |
| 2364 virtual void SetupTree() OVERRIDE { | 2327 virtual void SetupTree() OVERRIDE { |
| 2365 LayerTreeHostTest::SetupTree(); | 2328 LayerTreeHostTest::SetupTree(); |
| 2366 | 2329 |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2873 TEST_F(LayerTreeHostTestNumFramesPending, DelegatingRenderer) { | 2836 TEST_F(LayerTreeHostTestNumFramesPending, DelegatingRenderer) { |
| 2874 RunTest(true, true, true); | 2837 RunTest(true, true, true); |
| 2875 } | 2838 } |
| 2876 | 2839 |
| 2877 TEST_F(LayerTreeHostTestNumFramesPending, GLRenderer) { | 2840 TEST_F(LayerTreeHostTestNumFramesPending, GLRenderer) { |
| 2878 RunTest(true, false, true); | 2841 RunTest(true, false, true); |
| 2879 } | 2842 } |
| 2880 | 2843 |
| 2881 } // namespace | 2844 } // namespace |
| 2882 } // namespace cc | 2845 } // namespace cc |
| OLD | NEW |