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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 16211002: Skip drawing unsupported layers in forced software mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address nits Created 7 years, 7 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
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/layer_tree_host_impl.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_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
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698