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

Unified Diff: cc/delegated_renderer_layer_impl_unittest.cc

Issue 11929045: cc: DelegatedRenderer layer needs a surface if rotated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | « no previous file | cc/layer_tree_host_common.cc » ('j') | cc/layer_tree_host_common.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/delegated_renderer_layer_impl_unittest.cc
diff --git a/cc/delegated_renderer_layer_impl_unittest.cc b/cc/delegated_renderer_layer_impl_unittest.cc
index b9c9b9228dfaf62783659092bb949782afcde2f0..e896658ac6faae5b8f10f18cb96d007e8fb3f0e4 100644
--- a/cc/delegated_renderer_layer_impl_unittest.cc
+++ b/cc/delegated_renderer_layer_impl_unittest.cc
@@ -238,7 +238,7 @@ TEST_F(DelegatedRendererLayerImplTestSimple, DoesNotOwnARenderSurface)
m_hostImpl->didDrawAllLayers(frame);
}
-TEST_F(DelegatedRendererLayerImplTestSimple, DoesOwnARenderSurface)
+TEST_F(DelegatedRendererLayerImplTestSimple, DoesOwnARenderSurfaceForOpacity)
{
m_delegatedRendererLayerPtr->setOpacity(0.5f);
@@ -254,6 +254,24 @@ TEST_F(DelegatedRendererLayerImplTestSimple, DoesOwnARenderSurface)
m_hostImpl->didDrawAllLayers(frame);
}
+TEST_F(DelegatedRendererLayerImplTestSimple, DoesOwnARenderSurfaceForTransform)
+{
+ gfx::Transform rotation;
+ rotation.RotateAboutZAxis(30.0);
+ m_delegatedRendererLayerPtr->setTransform(rotation);
+
+ LayerTreeHostImpl::FrameData frame;
+ EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
+
+ // This test case has quads from multiple layers in the delegated renderer,
+ // so if the DelegatedRendererLayer has opacity < 1, it should end up with
+ // a render surface.
+ EXPECT_TRUE(m_delegatedRendererLayerPtr->renderSurface());
+
+ m_hostImpl->drawLayers(frame);
+ m_hostImpl->didDrawAllLayers(frame);
+}
+
class DelegatedRendererLayerImplTestOwnSurface : public DelegatedRendererLayerImplTestSimple {
public:
DelegatedRendererLayerImplTestOwnSurface()
« no previous file with comments | « no previous file | cc/layer_tree_host_common.cc » ('j') | cc/layer_tree_host_common.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698