summaryrefslogtreecommitdiffstats
path: root/cc/layer_tree_host_impl_unittest.cc
diff options
context:
space:
mode:
authorskaslev@chromium.org <skaslev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-30 18:24:57 +0000
committerskaslev@chromium.org <skaslev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-30 18:24:57 +0000
commit498ec6e0ebe1a042f35dc51c000a80de34eb17ef (patch)
treeab0fc2f9684b5df9afdb325d8b105dd9c45f53b7 /cc/layer_tree_host_impl_unittest.cc
parent4e28d8043881bff74b1473d622513c8cb07fe35d (diff)
downloadchromium_src-498ec6e0ebe1a042f35dc51c000a80de34eb17ef.zip
chromium_src-498ec6e0ebe1a042f35dc51c000a80de34eb17ef.tar.gz
chromium_src-498ec6e0ebe1a042f35dc51c000a80de34eb17ef.tar.bz2
Don't create render passes for transparent images.
That patch speeds up Google Maps use-case smoke test by a factor of 10x. It also reduces memory pressure on the GPU. See the related bugs for more info. BUG=161434,160871 Review URL: https://chromiumcodereview.appspot.com/11316171 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170487 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layer_tree_host_impl_unittest.cc')
-rw-r--r--cc/layer_tree_host_impl_unittest.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/cc/layer_tree_host_impl_unittest.cc b/cc/layer_tree_host_impl_unittest.cc
index a85ff1d..58e361e 100644
--- a/cc/layer_tree_host_impl_unittest.cc
+++ b/cc/layer_tree_host_impl_unittest.cc
@@ -2389,6 +2389,7 @@ static scoped_ptr<LayerTreeHostImpl> setupLayersForOpacity(bool partialSwap, Lay
child->setContentBounds(child->bounds());
child->setVisibleContentRect(childRect);
child->setDrawsContent(false);
+ child->setForceRenderSurface(true);
grandChild->setAnchorPoint(gfx::PointF(0, 0));
grandChild->setPosition(gfx::Point(grandChildRect.x(), grandChildRect.y()));
@@ -3138,7 +3139,8 @@ static void setupLayersForTextureCaching(LayerTreeHostImpl* layerTreeHostImpl, L
// It will contain other layers that draw content.
addDrawingLayerTo(intermediateLayerPtr, 3, gfx::Rect(10, 10, rootSize.width(), rootSize.height()), &surfaceLayerPtr);
surfaceLayerPtr->setDrawsContent(false); // only children draw content
- surfaceLayerPtr->setOpacity(0.5f); // This will cause it to have a surface
+ surfaceLayerPtr->setOpacity(0.5f);
+ surfaceLayerPtr->setForceRenderSurface(true); // This will cause it to have a surface
// Child of the surface layer will produce some quads
addDrawingLayerTo(surfaceLayerPtr, 4, gfx::Rect(5, 5, rootSize.width() - 25, rootSize.height() - 25), &childPtr);
@@ -3182,7 +3184,8 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithClipping)
// Surface layer is the layer that changes its opacity
// It will contain other layers that draw content.
- surfaceLayerPtr->setOpacity(0.5f); // This will cause it to have a surface
+ surfaceLayerPtr->setOpacity(0.5f);
+ surfaceLayerPtr->setForceRenderSurface(true); // This will cause it to have a surface
addDrawingLayerTo(surfaceLayerPtr, 4, gfx::Rect(0, 0, 100, 3), 0);
addDrawingLayerTo(surfaceLayerPtr, 5, gfx::Rect(0, 97, 100, 3), 0);