diff options
-rw-r--r-- | cc/test/layer_tree_test.cc | 5 | ||||
-rw-r--r-- | cc/test/layer_tree_test.h | 2 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_unittest.cc | 4 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_unittest_animation.cc | 14 | ||||
-rw-r--r-- | cc/trees/single_thread_proxy.cc | 6 |
5 files changed, 15 insertions, 16 deletions
diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc index 1d4a797..b12f58e 100644 --- a/cc/test/layer_tree_test.cc +++ b/cc/test/layer_tree_test.cc @@ -627,4 +627,9 @@ scoped_refptr<cc::ContextProvider> LayerTreeTest:: return compositor_thread_contexts_; } +LayerTreeHost* LayerTreeTest::layer_tree_host() { + DCHECK(proxy()->IsMainThread() || proxy()->IsMainThreadBlocked()); + return layer_tree_host_.get(); +} + } // namespace cc diff --git a/cc/test/layer_tree_test.h b/cc/test/layer_tree_test.h index 1dbb861..09666a3 100644 --- a/cc/test/layer_tree_test.h +++ b/cc/test/layer_tree_test.h @@ -150,7 +150,7 @@ class LayerTreeTest : public testing::Test, public TestHooks { bool TestEnded() const { return ended_; } - LayerTreeHost* layer_tree_host() { return layer_tree_host_.get(); } + LayerTreeHost* layer_tree_host(); bool delegating_renderer() const { return delegating_renderer_; } virtual scoped_ptr<OutputSurface> CreateOutputSurface() OVERRIDE; diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index 849cb38..47bb753 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc @@ -2147,6 +2147,10 @@ class LayerTreeHostTestShutdownWithOnlySomeResourcesEvicted child_layer2_(FakeContentLayer::Create(&client_)), num_commits_(0) {} + virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { + settings->impl_side_painting = false; + } + virtual void BeginTest() OVERRIDE { layer_tree_host()->SetViewportSize(gfx::Size(100, 100)); root_layer_->SetBounds(gfx::Size(100, 100)); diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc index df283de..7178e5b 100644 --- a/cc/trees/layer_tree_host_unittest_animation.cc +++ b/cc/trees/layer_tree_host_unittest_animation.cc @@ -291,7 +291,6 @@ class LayerTreeHostAnimationTestTickAnimationWhileBackgrounded SINGLE_AND_MULTI_THREAD_TEST_F( LayerTreeHostAnimationTestTickAnimationWhileBackgrounded); -// Ensures that animations continue to be ticked when we are backgrounded. class LayerTreeHostAnimationTestAddAnimationWithTimingFunction : public LayerTreeHostAnimationTest { public: @@ -301,6 +300,7 @@ class LayerTreeHostAnimationTestAddAnimationWithTimingFunction LayerTreeHostAnimationTest::SetupTree(); content_ = FakeContentLayer::Create(&client_); content_->SetBounds(gfx::Size(4, 4)); + content_->set_layer_animation_delegate(this); layer_tree_host()->root_layer()->AddChild(content_); } @@ -308,9 +308,7 @@ class LayerTreeHostAnimationTestAddAnimationWithTimingFunction PostAddAnimationToMainThread(content_.get()); } - virtual void AnimateLayers( - LayerTreeHostImpl* host_impl, - base::TimeTicks monotonic_time) OVERRIDE { + virtual void NotifyAnimationStarted(double wallClockTime) OVERRIDE { LayerAnimationController* controller = layer_tree_host()->root_layer()->children()[0]-> layer_animation_controller(); @@ -331,14 +329,8 @@ class LayerTreeHostAnimationTestAddAnimationWithTimingFunction // because of the default ease timing function. EXPECT_FLOAT_EQ(linearly_interpolated_opacity, curve->GetValue(time)); - LayerAnimationController* controller_impl = - host_impl->active_tree()->root_layer()->children()[0]-> - layer_animation_controller(); - Animation* animation_impl = - controller_impl->GetAnimation(Animation::Opacity); - controller->RemoveAnimation(animation->id()); - controller_impl->RemoveAnimation(animation_impl->id()); + EndTest(); } diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc index 484acb6..ea04442 100644 --- a/cc/trees/single_thread_proxy.cc +++ b/cc/trees/single_thread_proxy.cc @@ -96,7 +96,7 @@ void SingleThreadProxy::SetLayerTreeHostClientReady() { } void SingleThreadProxy::SetVisible(bool visible) { - DebugScopedSetImplThread impl(this); + DebugScopedSetImplThreadAndMainThreadBlocked impl(this); layer_tree_host_impl_->SetVisible(visible); } @@ -175,9 +175,7 @@ void SingleThreadProxy::DoCommit(scoped_ptr<ResourceUpdateQueue> queue) { DCHECK(Proxy::IsMainThread()); // Commit immediately. { - DebugScopedSetMainThreadBlocked mainThreadBlocked(this); - DebugScopedSetImplThread impl(this); - + DebugScopedSetImplThreadAndMainThreadBlocked impl_with_main_blocked(this); RenderingStatsInstrumentation* stats_instrumentation = layer_tree_host_->rendering_stats_instrumentation(); base::TimeTicks start_time = stats_instrumentation->StartRecording(); |