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

Unified Diff: cc/layers/render_surface_unittest.cc

Issue 2659883003: cc: Remove direct calls to LayerImpl::SetHasRenderSurface from tests (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/render_surface_impl_unittest.cc ('k') | cc/test/layer_test_common.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/render_surface_unittest.cc
diff --git a/cc/layers/render_surface_unittest.cc b/cc/layers/render_surface_unittest.cc
index 511108dc0f232aff6cec11076b156a61596c8ef9..ce28a3323becc7f066c873896b37d9f781d36b16 100644
--- a/cc/layers/render_surface_unittest.cc
+++ b/cc/layers/render_surface_unittest.cc
@@ -101,14 +101,13 @@ TEST(RenderSurfaceTest, SanityCheckSurfaceCreatesCorrectSharedQuadState) {
std::unique_ptr<LayerImpl> root_layer =
LayerImpl::Create(host_impl.active_tree(), 1);
+ int owning_layer_id = 2;
std::unique_ptr<LayerImpl> owning_layer =
- LayerImpl::Create(host_impl.active_tree(), 2);
- owning_layer->SetHasRenderSurface(true);
- ASSERT_TRUE(owning_layer->render_surface());
+ LayerImpl::Create(host_impl.active_tree(), owning_layer_id);
+ owning_layer->test_properties()->force_render_surface = true;
SkBlendMode blend_mode = SkBlendMode::kSoftLight;
owning_layer->test_properties()->blend_mode = blend_mode;
- RenderSurfaceImpl* render_surface = owning_layer->render_surface();
root_layer->test_properties()->AddChild(std::move(owning_layer));
host_impl.active_tree()->SetRootLayerForTesting(std::move(root_layer));
@@ -117,6 +116,11 @@ TEST(RenderSurfaceTest, SanityCheckSurfaceCreatesCorrectSharedQuadState) {
host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting();
host_impl.active_tree()->UpdateDrawProperties(false /* update_lcd_text */);
+ ASSERT_TRUE(
+ host_impl.active_tree()->LayerById(owning_layer_id)->render_surface());
+ RenderSurfaceImpl* render_surface =
+ host_impl.active_tree()->LayerById(owning_layer_id)->render_surface();
+
gfx::Rect content_rect(0, 0, 50, 50);
gfx::Rect clip_rect(5, 5, 40, 40);
gfx::Transform origin;
« no previous file with comments | « cc/layers/render_surface_impl_unittest.cc ('k') | cc/test/layer_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698