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_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 3467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3478 child->SetDrawsContent(true); | 3478 child->SetDrawsContent(true); |
3479 child->SetPrimarySurfaceInfo( | 3479 child->SetPrimarySurfaceInfo( |
3480 SurfaceInfo(primary_surfaces[i], 1.f /* device_scale_factor */, | 3480 SurfaceInfo(primary_surfaces[i], 1.f /* device_scale_factor */, |
3481 gfx::Size(10, 10) /* size_in_pixels */)); | 3481 gfx::Size(10, 10) /* size_in_pixels */)); |
3482 child->SetFallbackSurfaceInfo( | 3482 child->SetFallbackSurfaceInfo( |
3483 SurfaceInfo(fallback_surfaces[i], 1.f /* device_scale_factor */, | 3483 SurfaceInfo(fallback_surfaces[i], 1.f /* device_scale_factor */, |
3484 gfx::Size(10, 10) /* size_in_pixels */)); | 3484 gfx::Size(10, 10) /* size_in_pixels */)); |
3485 root->test_properties()->AddChild(std::move(child)); | 3485 root->test_properties()->AddChild(std::move(child)); |
3486 } | 3486 } |
3487 | 3487 |
| 3488 base::flat_set<SurfaceId> fallback_surfaces_set; |
| 3489 for (size_t i = 0; i < fallback_surfaces.size(); ++i) { |
| 3490 fallback_surfaces_set.insert(fallback_surfaces[i]); |
| 3491 } |
| 3492 |
3488 host_impl_->active_tree()->BuildPropertyTreesForTesting(); | 3493 host_impl_->active_tree()->BuildPropertyTreesForTesting(); |
| 3494 host_impl_->active_tree()->SetSurfaceLayerIds(fallback_surfaces_set); |
3489 DrawFrame(); | 3495 DrawFrame(); |
3490 | 3496 |
3491 FakeCompositorFrameSink* fake_compositor_frame_sink = | 3497 FakeCompositorFrameSink* fake_compositor_frame_sink = |
3492 static_cast<FakeCompositorFrameSink*>( | 3498 static_cast<FakeCompositorFrameSink*>( |
3493 host_impl_->compositor_frame_sink()); | 3499 host_impl_->compositor_frame_sink()); |
3494 const CompositorFrameMetadata& metadata = | 3500 const CompositorFrameMetadata& metadata = |
3495 fake_compositor_frame_sink->last_sent_frame()->metadata; | 3501 fake_compositor_frame_sink->last_sent_frame()->metadata; |
3496 EXPECT_THAT( | 3502 EXPECT_THAT( |
3497 metadata.activation_dependencies, | 3503 metadata.activation_dependencies, |
3498 testing::UnorderedElementsAre(primary_surfaces[0], primary_surfaces[1])); | 3504 testing::UnorderedElementsAre(primary_surfaces[0], primary_surfaces[1])); |
(...skipping 8904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12403 | 12409 |
12404 TEST_F(LayerTreeHostImplTest, RasterColorSpace) { | 12410 TEST_F(LayerTreeHostImplTest, RasterColorSpace) { |
12405 LayerTreeSettings settings = DefaultSettings(); | 12411 LayerTreeSettings settings = DefaultSettings(); |
12406 settings.enable_color_correct_rasterization = true; | 12412 settings.enable_color_correct_rasterization = true; |
12407 CreateHostImpl(settings, CreateCompositorFrameSink()); | 12413 CreateHostImpl(settings, CreateCompositorFrameSink()); |
12408 EXPECT_EQ(host_impl_->GetRasterColorSpace(), gfx::ColorSpace::CreateSRGB()); | 12414 EXPECT_EQ(host_impl_->GetRasterColorSpace(), gfx::ColorSpace::CreateSRGB()); |
12409 } | 12415 } |
12410 | 12416 |
12411 } // namespace | 12417 } // namespace |
12412 } // namespace cc | 12418 } // namespace cc |
OLD | NEW |