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

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: 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
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 3458 matching lines...) Expand 10 before | Expand all | Expand 10 after
3469 child->SetPosition(gfx::PointF(25.f * i, 0.f)); 3469 child->SetPosition(gfx::PointF(25.f * i, 0.f));
3470 child->SetBounds(gfx::Size(1, 1)); 3470 child->SetBounds(gfx::Size(1, 1));
3471 child->SetDrawsContent(true); 3471 child->SetDrawsContent(true);
3472 child->SetPrimarySurfaceInfo( 3472 child->SetPrimarySurfaceInfo(
3473 SurfaceInfo(children[i], 1.f /* device_scale_factor */, 3473 SurfaceInfo(children[i], 1.f /* device_scale_factor */,
3474 gfx::Size(10, 10) /* size_in_pixels */)); 3474 gfx::Size(10, 10) /* size_in_pixels */));
3475 root->test_properties()->AddChild(std::move(child)); 3475 root->test_properties()->AddChild(std::move(child));
3476 } 3476 }
3477 3477
3478 host_impl_->active_tree()->BuildPropertyTreesForTesting(); 3478 host_impl_->active_tree()->BuildPropertyTreesForTesting();
3479 host_impl_->active_tree()->SetSurfaceLayerIds(children);
3479 DrawFrame(); 3480 DrawFrame();
3480 3481
3481 FakeCompositorFrameSink* fake_compositor_frame_sink = 3482 FakeCompositorFrameSink* fake_compositor_frame_sink =
3482 static_cast<FakeCompositorFrameSink*>( 3483 static_cast<FakeCompositorFrameSink*>(
3483 host_impl_->compositor_frame_sink()); 3484 host_impl_->compositor_frame_sink());
3484 const CompositorFrameMetadata& metadata = 3485 const CompositorFrameMetadata& metadata =
3485 fake_compositor_frame_sink->last_sent_frame()->metadata; 3486 fake_compositor_frame_sink->last_sent_frame()->metadata;
3486 EXPECT_THAT(metadata.activation_dependencies, 3487 EXPECT_THAT(metadata.activation_dependencies,
3487 testing::UnorderedElementsAre(children[0], children[1])); 3488 testing::UnorderedElementsAre(children[0], children[1]));
3488 EXPECT_THAT( 3489 EXPECT_THAT(
(...skipping 8902 matching lines...) Expand 10 before | Expand all | Expand 10 after
12391 12392
12392 TEST_F(LayerTreeHostImplTest, RasterColorSpace) { 12393 TEST_F(LayerTreeHostImplTest, RasterColorSpace) {
12393 LayerTreeSettings settings = DefaultSettings(); 12394 LayerTreeSettings settings = DefaultSettings();
12394 settings.enable_color_correct_rasterization = true; 12395 settings.enable_color_correct_rasterization = true;
12395 CreateHostImpl(settings, CreateCompositorFrameSink()); 12396 CreateHostImpl(settings, CreateCompositorFrameSink());
12396 EXPECT_EQ(host_impl_->GetRasterColorSpace(), gfx::ColorSpace::CreateSRGB()); 12397 EXPECT_EQ(host_impl_->GetRasterColorSpace(), gfx::ColorSpace::CreateSRGB());
12397 } 12398 }
12398 12399
12399 } // namespace 12400 } // namespace
12400 } // namespace cc 12401 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698