Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 2905533002: cc : Store surface layer ids on LayerTreeHost and push them at commit (Closed)
Patch Set: initialize Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698