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

Side by Side Diff: cc/layers/render_surface_unittest.cc

Issue 2080223010: cc: Clean up root_layer code in LTI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase++ Created 4 years, 5 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/layers/render_surface_impl_unittest.cc ('k') | cc/layers/video_layer_impl_unittest.cc » ('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/layers/append_quads_data.h" 5 #include "cc/layers/append_quads_data.h"
6 #include "cc/layers/layer_impl.h" 6 #include "cc/layers/layer_impl.h"
7 #include "cc/layers/render_pass_sink.h" 7 #include "cc/layers/render_pass_sink.h"
8 #include "cc/layers/render_surface_impl.h" 8 #include "cc/layers/render_surface_impl.h"
9 #include "cc/quads/shared_quad_state.h" 9 #include "cc/quads/shared_quad_state.h"
10 #include "cc/test/fake_impl_task_runner_provider.h" 10 #include "cc/test/fake_impl_task_runner_provider.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 std::unique_ptr<LayerImpl> owning_layer = 96 std::unique_ptr<LayerImpl> owning_layer =
97 LayerImpl::Create(host_impl.active_tree(), 2); 97 LayerImpl::Create(host_impl.active_tree(), 2);
98 owning_layer->SetHasRenderSurface(true); 98 owning_layer->SetHasRenderSurface(true);
99 ASSERT_TRUE(owning_layer->render_surface()); 99 ASSERT_TRUE(owning_layer->render_surface());
100 100
101 SkXfermode::Mode blend_mode = SkXfermode::kSoftLight_Mode; 101 SkXfermode::Mode blend_mode = SkXfermode::kSoftLight_Mode;
102 owning_layer->SetBlendMode(blend_mode); 102 owning_layer->SetBlendMode(blend_mode);
103 RenderSurfaceImpl* render_surface = owning_layer->render_surface(); 103 RenderSurfaceImpl* render_surface = owning_layer->render_surface();
104 104
105 root_layer->test_properties()->AddChild(std::move(owning_layer)); 105 root_layer->test_properties()->AddChild(std::move(owning_layer));
106 host_impl.active_tree()->SetRootLayer(std::move(root_layer)); 106 host_impl.active_tree()->SetRootLayerForTesting(std::move(root_layer));
107 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting(); 107 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting();
108 108
109 gfx::Rect content_rect(0, 0, 50, 50); 109 gfx::Rect content_rect(0, 0, 50, 50);
110 gfx::Rect clip_rect(5, 5, 40, 40); 110 gfx::Rect clip_rect(5, 5, 40, 40);
111 gfx::Transform origin; 111 gfx::Transform origin;
112 origin.Translate(30, 40); 112 origin.Translate(30, 40);
113 113
114 render_surface->SetContentRectForTesting(content_rect); 114 render_surface->SetContentRectForTesting(content_rect);
115 render_surface->SetClipRect(clip_rect); 115 render_surface->SetClipRect(clip_rect);
116 render_surface->SetDrawOpacity(1.f); 116 render_surface->SetDrawOpacity(1.f);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 ASSERT_EQ(1u, pass_sink.RenderPasses().size()); 183 ASSERT_EQ(1u, pass_sink.RenderPasses().size());
184 RenderPass* pass = pass_sink.RenderPasses()[0].get(); 184 RenderPass* pass = pass_sink.RenderPasses()[0].get();
185 185
186 EXPECT_EQ(RenderPassId(2, 0), pass->id); 186 EXPECT_EQ(RenderPassId(2, 0), pass->id);
187 EXPECT_EQ(content_rect, pass->output_rect); 187 EXPECT_EQ(content_rect, pass->output_rect);
188 EXPECT_EQ(origin, pass->transform_to_root_target); 188 EXPECT_EQ(origin, pass->transform_to_root_target);
189 } 189 }
190 190
191 } // namespace 191 } // namespace
192 } // namespace cc 192 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/render_surface_impl_unittest.cc ('k') | cc/layers/video_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698