Index: cc/trees/layer_tree_host_impl_unittest.cc |
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc |
index 6976087869b597287f5db6748b536a8f5ea0fa71..4e3c2e53145b740a5195ada91ebc1b7a04522b5d 100644 |
--- a/cc/trees/layer_tree_host_impl_unittest.cc |
+++ b/cc/trees/layer_tree_host_impl_unittest.cc |
@@ -5749,5 +5749,38 @@ TEST_F(LayerTreeHostImplTest, ForcedDrawToSoftwareDeviceBasicRender) { |
EXPECT_TRUE(host_impl_->ActivationStateAsValue()); |
} |
+TEST_F(LayerTreeHostImplTest, |
+ ForcedDrawToSoftwareDeviceSkipsUnsupportedLayers) { |
+ FakeOutputSurface* output_surface = FakeOutputSurface::CreateDeferredGL( |
+ scoped_ptr<SoftwareOutputDevice>(new CountingSoftwareDevice())).release(); |
+ host_impl_->InitializeRenderer( |
+ scoped_ptr<OutputSurface>(output_surface)); |
+ |
+ output_surface->set_forced_draw_to_software_device(true); |
+ EXPECT_TRUE(output_surface->ForcedDrawToSoftwareDevice()); |
+ |
+ // SolidColorLayerImpl will be drawn. |
+ scoped_ptr<SolidColorLayerImpl> root_layer = |
+ SolidColorLayerImpl::Create(host_impl_->active_tree(), 1); |
+ |
+ // VideoLayerImpl will not be drawn. |
+ FakeVideoFrameProvider provider; |
+ scoped_ptr<VideoLayerImpl> video_layer = |
+ VideoLayerImpl::Create(host_impl_->active_tree(), 2, &provider); |
+ video_layer->SetBounds(gfx::Size(10, 10)); |
+ video_layer->SetContentBounds(gfx::Size(10, 10)); |
+ video_layer->SetDrawsContent(true); |
+ root_layer->AddChild(video_layer.PassAs<LayerImpl>()); |
+ SetupRootLayerImpl(root_layer.PassAs<LayerImpl>()); |
+ |
+ LayerTreeHostImpl::FrameData frame; |
+ EXPECT_TRUE(host_impl_->PrepareToDraw(&frame, gfx::Rect())); |
+ host_impl_->DrawLayers(&frame, base::TimeTicks::Now()); |
+ host_impl_->DidDrawAllLayers(frame); |
+ |
+ EXPECT_EQ(1u, frame.will_draw_layers.size()); |
+ EXPECT_EQ(host_impl_->active_tree()->root_layer(), frame.will_draw_layers[0]); |
+} |
+ |
} // namespace |
} // namespace cc |