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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 scoped_refptr<TestLayer> root221 = TestLayer::create(); | 207 scoped_refptr<TestLayer> root221 = TestLayer::create(); |
208 scoped_refptr<TestLayer> root231 = TestLayer::create(); | 208 scoped_refptr<TestLayer> root231 = TestLayer::create(); |
209 | 209 |
210 rootLayer->createRenderSurface(); | 210 rootLayer->createRenderSurface(); |
211 rootLayer->renderSurface()->setContentRect(gfx::Rect(gfx::Point(), rootLayer
->bounds())); | 211 rootLayer->renderSurface()->setContentRect(gfx::Rect(gfx::Point(), rootLayer
->bounds())); |
212 | 212 |
213 rootLayer->addChild(root1); | 213 rootLayer->addChild(root1); |
214 rootLayer->addChild(root2); | 214 rootLayer->addChild(root2); |
215 rootLayer->addChild(root3); | 215 rootLayer->addChild(root3); |
216 root2->setDrawsContent(false); | 216 root2->setDrawsContent(false); |
217 root2->setOpacity(0.5); // Force the layer to own a new surface. | 217 root2->setOpacity(0.5); |
| 218 root2->setForceRenderSurface(true); // Force the layer to own a new surface. |
218 root2->addChild(root21); | 219 root2->addChild(root21); |
219 root2->addChild(root22); | 220 root2->addChild(root22); |
220 root2->addChild(root23); | 221 root2->addChild(root23); |
221 root22->setOpacity(0.5); | 222 root22->setOpacity(0.5); |
222 root22->addChild(root221); | 223 root22->addChild(root221); |
223 root23->setOpacity(0.5); | 224 root23->setOpacity(0.5); |
224 root23->addChild(root231); | 225 root23->addChild(root231); |
225 | 226 |
226 std::vector<scoped_refptr<Layer> > renderSurfaceLayerList; | 227 std::vector<scoped_refptr<Layer> > renderSurfaceLayerList; |
227 LayerTreeHostCommon::calculateDrawTransforms(rootLayer.get(), rootLayer->bou
nds(), 1, 1, 256, renderSurfaceLayerList); | 228 LayerTreeHostCommon::calculateDrawTransforms(rootLayer.get(), rootLayer->bou
nds(), 1, 1, 256, renderSurfaceLayerList); |
(...skipping 16 matching lines...) Expand all Loading... |
244 EXPECT_COUNT(root21, -1, -1, 9); | 245 EXPECT_COUNT(root21, -1, -1, 9); |
245 EXPECT_COUNT(root22, 7, 8, 6); | 246 EXPECT_COUNT(root22, 7, 8, 6); |
246 EXPECT_COUNT(root221, -1, -1, 5); | 247 EXPECT_COUNT(root221, -1, -1, 5); |
247 EXPECT_COUNT(root23, 3, 4, 2); | 248 EXPECT_COUNT(root23, 3, 4, 2); |
248 EXPECT_COUNT(root231, -1, -1, 1); | 249 EXPECT_COUNT(root231, -1, -1, 1); |
249 EXPECT_COUNT(root3, -1, -1, 0); | 250 EXPECT_COUNT(root3, -1, -1, 0); |
250 } | 251 } |
251 | 252 |
252 } // namespace | 253 } // namespace |
253 } // namespace cc | 254 } // namespace cc |
OLD | NEW |