OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/layer_iterator.h" | 5 #include "cc/layer_iterator.h" |
6 | 6 |
7 #include "cc/layer.h" | 7 #include "cc/layer.h" |
8 #include "cc/layer_tree_host_common.h" | 8 #include "cc/layer_tree_host_common.h" |
9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 scoped_refptr<TestLayer> root221 = TestLayer::create(); | 208 scoped_refptr<TestLayer> root221 = TestLayer::create(); |
209 scoped_refptr<TestLayer> root231 = TestLayer::create(); | 209 scoped_refptr<TestLayer> root231 = TestLayer::create(); |
210 | 210 |
211 rootLayer->createRenderSurface(); | 211 rootLayer->createRenderSurface(); |
212 rootLayer->renderSurface()->setContentRect(gfx::Rect(gfx::Point(), rootLayer
->bounds())); | 212 rootLayer->renderSurface()->setContentRect(gfx::Rect(gfx::Point(), rootLayer
->bounds())); |
213 | 213 |
214 rootLayer->addChild(root1); | 214 rootLayer->addChild(root1); |
215 rootLayer->addChild(root2); | 215 rootLayer->addChild(root2); |
216 rootLayer->addChild(root3); | 216 rootLayer->addChild(root3); |
217 root2->setDrawsContent(false); | 217 root2->setDrawsContent(false); |
218 root2->setOpacity(0.5); // Force the layer to own a new surface. | 218 root2->setOpacity(0.5); |
| 219 root2->setForceRenderSurface(true); // Force the layer to own a new surface. |
219 root2->addChild(root21); | 220 root2->addChild(root21); |
220 root2->addChild(root22); | 221 root2->addChild(root22); |
221 root2->addChild(root23); | 222 root2->addChild(root23); |
222 root22->setOpacity(0.5); | 223 root22->setOpacity(0.5); |
223 root22->addChild(root221); | 224 root22->addChild(root221); |
224 root23->setOpacity(0.5); | 225 root23->setOpacity(0.5); |
225 root23->addChild(root231); | 226 root23->addChild(root231); |
226 | 227 |
227 std::vector<scoped_refptr<Layer> > renderSurfaceLayerList; | 228 std::vector<scoped_refptr<Layer> > renderSurfaceLayerList; |
228 LayerTreeHostCommon::calculateDrawTransforms(rootLayer.get(), rootLayer->bou
nds(), 1, 1, 256, renderSurfaceLayerList); | 229 LayerTreeHostCommon::calculateDrawTransforms(rootLayer.get(), rootLayer->bou
nds(), 1, 1, 256, renderSurfaceLayerList); |
(...skipping 16 matching lines...) Expand all Loading... |
245 EXPECT_COUNT(root21, -1, -1, 9); | 246 EXPECT_COUNT(root21, -1, -1, 9); |
246 EXPECT_COUNT(root22, 7, 8, 6); | 247 EXPECT_COUNT(root22, 7, 8, 6); |
247 EXPECT_COUNT(root221, -1, -1, 5); | 248 EXPECT_COUNT(root221, -1, -1, 5); |
248 EXPECT_COUNT(root23, 3, 4, 2); | 249 EXPECT_COUNT(root23, 3, 4, 2); |
249 EXPECT_COUNT(root231, -1, -1, 1); | 250 EXPECT_COUNT(root231, -1, -1, 1); |
250 EXPECT_COUNT(root3, -1, -1, 0); | 251 EXPECT_COUNT(root3, -1, -1, 0); |
251 } | 252 } |
252 | 253 |
253 } // namespace | 254 } // namespace |
254 } // namespace cc | 255 } // namespace cc |
OLD | NEW |