diff options
author | enne <enne@chromium.org> | 2015-08-18 09:50:06 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-18 16:50:35 +0000 |
commit | d5f4dddf8b0c5946d066288a9b0b0e6be949d50d (patch) | |
tree | cfe0faddcc2f18e0bc2fde7d6cdfbfa9fb1cf875 /cc/trees | |
parent | 4e6150b17e8304c1a252d19fb991077ed5385c5f (diff) | |
download | chromium_src-d5f4dddf8b0c5946d066288a9b0b0e6be949d50d.zip chromium_src-d5f4dddf8b0c5946d066288a9b0b0e6be949d50d.tar.gz chromium_src-d5f4dddf8b0c5946d066288a9b0b0e6be949d50d.tar.bz2 |
cc: Convert RenderSurfaceForBlendMode to LayerImpl
Drawing blend modes are not computed on the main thread.
R=weiliangc@chromium.org
BUG=502041
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1297853004
Cr-Commit-Position: refs/heads/master@{#343943}
Diffstat (limited to 'cc/trees')
-rw-r--r-- | cc/trees/layer_tree_host_common_unittest.cc | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc index e1794b5..a163569 100644 --- a/cc/trees/layer_tree_host_common_unittest.cc +++ b/cc/trees/layer_tree_host_common_unittest.cc @@ -1269,25 +1269,23 @@ TEST_F(LayerTreeHostCommonTest, RenderSurfaceListForTransparentChild) { } TEST_F(LayerTreeHostCommonTest, RenderSurfaceForBlendMode) { - scoped_refptr<Layer> parent = Layer::Create(layer_settings()); - scoped_refptr<LayerWithForcedDrawsContent> child = - make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings())); - - host()->SetRootLayer(parent); + LayerImpl* parent = root_layer(); + LayerImpl* child = AddChild<LayerImpl>(parent); + child->SetDrawsContent(true); const gfx::Transform identity_matrix; const SkXfermode::Mode blend_mode = SkXfermode::kMultiply_Mode; - SetLayerPropertiesForTesting(child.get(), identity_matrix, gfx::Point3F(), - gfx::PointF(), gfx::Size(10, 10), true, false); + SetLayerPropertiesForTesting(parent, 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, + true); - parent->AddChild(child); child->SetBlendMode(blend_mode); child->SetOpacity(0.5f); - RenderSurfaceLayerList render_surface_layer_list; - LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( - parent.get(), parent->bounds(), &render_surface_layer_list); - LayerTreeHostCommon::CalculateDrawProperties(&inputs); + ExecuteCalculateDrawProperties(parent); // Since the child layer has a blend mode other than normal, it should get // its own render surface. Also, layer's draw_properties should contain the |