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 2229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2240 private: | 2240 private: |
2241 NotificationClient client_; | 2241 NotificationClient client_; |
2242 }; | 2242 }; |
2243 | 2243 |
2244 SINGLE_THREAD_TEST_F(LayerTreeHostTestLCDNotification); | 2244 SINGLE_THREAD_TEST_F(LayerTreeHostTestLCDNotification); |
2245 | 2245 |
2246 // Verify that the BeginFrame notification is used to initiate rendering. | 2246 // Verify that the BeginFrame notification is used to initiate rendering. |
2247 class LayerTreeHostTestBeginFrameNotification : public LayerTreeHostTest { | 2247 class LayerTreeHostTestBeginFrameNotification : public LayerTreeHostTest { |
2248 public: | 2248 public: |
2249 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { | 2249 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { |
2250 settings->render_parent_drives_begin_frame_ = true; | 2250 settings->begin_frame_scheduling_enabled = true; |
2251 } | 2251 } |
2252 | 2252 |
2253 virtual void BeginTest() OVERRIDE { | 2253 virtual void BeginTest() OVERRIDE { |
2254 PostSetNeedsCommitToMainThread(); | 2254 PostSetNeedsCommitToMainThread(); |
2255 } | 2255 } |
2256 | 2256 |
2257 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { | 2257 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
2258 FakeOutputSurface* fake_output_surface = | 2258 FakeOutputSurface* fake_output_surface = |
2259 reinterpret_cast<FakeOutputSurface*>(host_impl->output_surface()); | 2259 reinterpret_cast<FakeOutputSurface*>(host_impl->output_surface()); |
2260 | 2260 |
(...skipping 29 matching lines...) Expand all Loading... |
2290 private: | 2290 private: |
2291 base::TimeTicks frame_time_; | 2291 base::TimeTicks frame_time_; |
2292 }; | 2292 }; |
2293 | 2293 |
2294 MULTI_THREAD_TEST_F(LayerTreeHostTestBeginFrameNotification); | 2294 MULTI_THREAD_TEST_F(LayerTreeHostTestBeginFrameNotification); |
2295 | 2295 |
2296 class LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled | 2296 class LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled |
2297 : public LayerTreeHostTest { | 2297 : public LayerTreeHostTest { |
2298 public: | 2298 public: |
2299 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { | 2299 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { |
2300 settings->render_parent_drives_begin_frame_ = true; | 2300 settings->begin_frame_scheduling_enabled = true; |
2301 settings->using_synchronous_renderer_compositor = true; | 2301 settings->using_synchronous_renderer_compositor = true; |
2302 } | 2302 } |
2303 | 2303 |
2304 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } | 2304 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } |
2305 | 2305 |
2306 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { | 2306 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
2307 // The BeginFrame notification is turned off now but will get enabled | 2307 // The BeginFrame notification is turned off now but will get enabled |
2308 // once we return. End test while it's enabled. | 2308 // once we return. End test while it's enabled. |
2309 ImplThread()->PostTask(base::Bind( | 2309 ImplThread()->PostTask(base::Bind( |
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 { | 2320 class LayerTreeHostTestInputDrivenRendering : public LayerTreeHostTest { |
2321 public: | 2321 public: |
2322 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { | 2322 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { |
2323 settings->render_parent_drives_begin_frame_ = true; | 2323 settings->begin_frame_scheduling_enabled = true; |
2324 } | 2324 } |
2325 | 2325 |
2326 virtual void BeginTest() OVERRIDE { | 2326 virtual void BeginTest() OVERRIDE { |
2327 frame_time_ = base::TimeTicks::Now(); | 2327 frame_time_ = base::TimeTicks::Now(); |
2328 PostSetNeedsCommitToMainThread(); | 2328 PostSetNeedsCommitToMainThread(); |
2329 } | 2329 } |
2330 | 2330 |
2331 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { | 2331 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
2332 // Post a task to send the final input event for the current BeginFrame; | 2332 // Post a task to send the final input event for the current BeginFrame; |
2333 // it should trigger rendering. | 2333 // it should trigger rendering. |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2873 TEST_F(LayerTreeHostTestNumFramesPending, DelegatingRenderer) { | 2873 TEST_F(LayerTreeHostTestNumFramesPending, DelegatingRenderer) { |
2874 RunTest(true, true, true); | 2874 RunTest(true, true, true); |
2875 } | 2875 } |
2876 | 2876 |
2877 TEST_F(LayerTreeHostTestNumFramesPending, GLRenderer) { | 2877 TEST_F(LayerTreeHostTestNumFramesPending, GLRenderer) { |
2878 RunTest(true, false, true); | 2878 RunTest(true, false, true); |
2879 } | 2879 } |
2880 | 2880 |
2881 } // namespace | 2881 } // namespace |
2882 } // namespace cc | 2882 } // namespace cc |
OLD | NEW |