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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 1307713002: cc: Allow transparent layers with background filters to render (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update test comment Created 5 years, 4 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/trees/layer_tree_host_common.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_common_unittest.cc
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc
index da015435cf5197022b0fc75adc6eec1d44b7d6dc..9e54e11e7167fd6c9c88f33a6fa51b21d41bd521 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -1189,6 +1189,42 @@ TEST_F(LayerTreeHostCommonTest, RenderSurfaceListForTransparentChild) {
EXPECT_EQ(gfx::Rect(), parent->drawable_content_rect());
}
+TEST_F(LayerTreeHostCommonTest,
+ RenderSurfaceListForTransparentChildWithBackgroundFilter) {
+ LayerImpl* parent = root_layer();
+ LayerImpl* render_surface1 = AddChild<LayerImpl>(parent);
+ LayerImpl* child = AddChild<LayerImpl>(render_surface1);
+ child->SetDrawsContent(true);
+
+ const gfx::Transform identity_matrix;
+ SetLayerPropertiesForTesting(parent, identity_matrix, gfx::Point3F(),
+ gfx::PointF(), gfx::Size(10, 10), true, false,
+ true);
+ SetLayerPropertiesForTesting(render_surface1, identity_matrix, gfx::Point3F(),
+ gfx::PointF(), gfx::Size(10, 10), true, false,
+ true);
+ SetLayerPropertiesForTesting(child, identity_matrix, gfx::Point3F(),
+ gfx::PointF(), gfx::Size(10, 10), true, false,
+ false);
+ render_surface1->SetOpacity(0.f);
+ FilterOperations filters;
+ filters.Append(FilterOperation::CreateBlurFilter(1.5f));
+ render_surface1->SetBackgroundFilters(filters);
+
+ LayerImplList render_surface_layer_list;
+ LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs(
+ parent, parent->bounds(), &render_surface_layer_list);
+ inputs.can_adjust_raster_scales = true;
+ LayerTreeHostCommon::CalculateDrawProperties(&inputs);
+
+ // The layer is fully transparent, but has a background filter, so it
+ // shouldn't be skipped.
+ ASSERT_TRUE(parent->render_surface());
+ EXPECT_EQ(1U, parent->render_surface()->layer_list().size());
+ EXPECT_EQ(2U, render_surface_layer_list.size());
+ EXPECT_EQ(gfx::Rect(0, 0, 10, 10), parent->drawable_content_rect());
+}
+
TEST_F(LayerTreeHostCommonTest, RenderSurfaceForBlendMode) {
LayerImpl* parent = root_layer();
LayerImpl* child = AddChild<LayerImpl>(parent);
« no previous file with comments | « cc/trees/layer_tree_host_common.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698