| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_test_common.h" | 5 #include "cc/test/layer_test_common.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "cc/animation/animation_host.h" | 9 #include "cc/animation/animation_host.h" |
| 10 #include "cc/animation/animation_id_provider.h" | 10 #include "cc/animation/animation_id_provider.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 LayerTestCommon::LayerImplTest::LayerImplTest(const LayerTreeSettings& settings) | 121 LayerTestCommon::LayerImplTest::LayerImplTest(const LayerTreeSettings& settings) |
| 122 : output_surface_(FakeOutputSurface::CreateDelegating3d()), | 122 : output_surface_(FakeOutputSurface::CreateDelegating3d()), |
| 123 host_(FakeLayerTreeHost::Create(&client_, &task_graph_runner_, settings)), | 123 host_(FakeLayerTreeHost::Create(&client_, &task_graph_runner_, settings)), |
| 124 render_pass_(RenderPass::Create()), | 124 render_pass_(RenderPass::Create()), |
| 125 layer_impl_id_(2) { | 125 layer_impl_id_(2) { |
| 126 std::unique_ptr<LayerImpl> root = | 126 std::unique_ptr<LayerImpl> root = |
| 127 LayerImpl::Create(host_->host_impl()->active_tree(), 1); | 127 LayerImpl::Create(host_->host_impl()->active_tree(), 1); |
| 128 host_->host_impl()->active_tree()->SetRootLayerForTesting(std::move(root)); | 128 host_->host_impl()->active_tree()->SetRootLayerForTesting(std::move(root)); |
| 129 root_layer_for_testing()->SetHasRenderSurface(true); | 129 root_layer_for_testing()->SetHasRenderSurface(true); |
| 130 host_->host_impl()->SetVisible(true); | 130 host_->host_impl()->SetVisible(true); |
| 131 host_->host_impl()->InitializeRenderer(output_surface_.get()); | 131 EXPECT_TRUE(host_->host_impl()->InitializeRenderer(output_surface_.get())); |
| 132 | 132 |
| 133 const int timeline_id = AnimationIdProvider::NextTimelineId(); | 133 const int timeline_id = AnimationIdProvider::NextTimelineId(); |
| 134 timeline_ = AnimationTimeline::Create(timeline_id); | 134 timeline_ = AnimationTimeline::Create(timeline_id); |
| 135 host_->animation_host()->AddAnimationTimeline(timeline_); | 135 host_->animation_host()->AddAnimationTimeline(timeline_); |
| 136 // Create impl-side instance. | 136 // Create impl-side instance. |
| 137 host_->animation_host()->PushPropertiesTo( | 137 host_->animation_host()->PushPropertiesTo( |
| 138 host_->host_impl()->animation_host()); | 138 host_->host_impl()->animation_host()); |
| 139 timeline_impl_ = | 139 timeline_impl_ = |
| 140 host_->host_impl()->animation_host()->GetTimelineById(timeline_id); | 140 host_->host_impl()->animation_host()->GetTimelineById(timeline_id); |
| 141 } | 141 } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 } | 205 } |
| 206 | 206 |
| 207 void EmptyCopyOutputCallback(std::unique_ptr<CopyOutputResult> result) {} | 207 void EmptyCopyOutputCallback(std::unique_ptr<CopyOutputResult> result) {} |
| 208 | 208 |
| 209 void LayerTestCommon::LayerImplTest::RequestCopyOfOutput() { | 209 void LayerTestCommon::LayerImplTest::RequestCopyOfOutput() { |
| 210 root_layer_for_testing()->test_properties()->copy_requests.push_back( | 210 root_layer_for_testing()->test_properties()->copy_requests.push_back( |
| 211 CopyOutputRequest::CreateRequest(base::Bind(&EmptyCopyOutputCallback))); | 211 CopyOutputRequest::CreateRequest(base::Bind(&EmptyCopyOutputCallback))); |
| 212 } | 212 } |
| 213 | 213 |
| 214 } // namespace cc | 214 } // namespace cc |
| OLD | NEW |