| 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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" | 
| 6 | 6 | 
| 7 #include "cc/layers/layer.h" | 7 #include "cc/layers/layer.h" | 
| 8 #include "cc/test/layer_tree_test.h" | 8 #include "cc/test/layer_tree_test.h" | 
| 9 #include "cc/test/occlusion_tracker_test_common.h" | 9 #include "cc/test/occlusion_tracker_test_common.h" | 
| 10 | 10 | 
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 342 | 342 | 
| 343 class LayerTreeHostOcclusionTestOcclusionOpacityFilter | 343 class LayerTreeHostOcclusionTestOcclusionOpacityFilter | 
| 344     : public LayerTreeHostOcclusionTest { | 344     : public LayerTreeHostOcclusionTest { | 
| 345  public: | 345  public: | 
| 346   virtual void SetupTree() OVERRIDE { | 346   virtual void SetupTree() OVERRIDE { | 
| 347     gfx::Transform child_transform; | 347     gfx::Transform child_transform; | 
| 348     child_transform.Translate(250.0, 250.0); | 348     child_transform.Translate(250.0, 250.0); | 
| 349     child_transform.Rotate(90.0); | 349     child_transform.Rotate(90.0); | 
| 350     child_transform.Translate(-250.0, -250.0); | 350     child_transform.Translate(-250.0, -250.0); | 
| 351 | 351 | 
| 352     WebKit::WebFilterOperations filters; | 352     FilterOperations filters; | 
| 353     filters.append(WebKit::WebFilterOperation::createOpacityFilter(0.5)); | 353     filters.Append(FilterOperation::CreateOpacityFilter(0.5f)); | 
| 354 | 354 | 
| 355     // If the child layer has a filter that changes alpha values, and is below | 355     // If the child layer has a filter that changes alpha values, and is below | 
| 356     // child2, then child2 should contribute to occlusion on everything, | 356     // child2, then child2 should contribute to occlusion on everything, | 
| 357     // and child shouldn't contribute to the root | 357     // and child shouldn't contribute to the root | 
| 358     SetLayerPropertiesForTesting( | 358     SetLayerPropertiesForTesting( | 
| 359         root_.get(), NULL, identity_matrix_, | 359         root_.get(), NULL, identity_matrix_, | 
| 360         gfx::PointF(0.f, 0.f), gfx::Size(200, 200), true); | 360         gfx::PointF(0.f, 0.f), gfx::Size(200, 200), true); | 
| 361     SetLayerPropertiesForTesting( | 361     SetLayerPropertiesForTesting( | 
| 362         child_.get(), root_.get(), child_transform, | 362         child_.get(), root_.get(), child_transform, | 
| 363         gfx::PointF(30.f, 30.f), gfx::Size(500, 500), true); | 363         gfx::PointF(30.f, 30.f), gfx::Size(500, 500), true); | 
| (...skipping 22 matching lines...) Expand all  Loading... | 
| 386 | 386 | 
| 387 class LayerTreeHostOcclusionTestOcclusionBlurFilter | 387 class LayerTreeHostOcclusionTestOcclusionBlurFilter | 
| 388     : public LayerTreeHostOcclusionTest { | 388     : public LayerTreeHostOcclusionTest { | 
| 389  public: | 389  public: | 
| 390   virtual void SetupTree() OVERRIDE { | 390   virtual void SetupTree() OVERRIDE { | 
| 391     gfx::Transform child_transform; | 391     gfx::Transform child_transform; | 
| 392     child_transform.Translate(250.0, 250.0); | 392     child_transform.Translate(250.0, 250.0); | 
| 393     child_transform.Rotate(90.0); | 393     child_transform.Rotate(90.0); | 
| 394     child_transform.Translate(-250.0, -250.0); | 394     child_transform.Translate(-250.0, -250.0); | 
| 395 | 395 | 
| 396     WebKit::WebFilterOperations filters; | 396     FilterOperations filters; | 
| 397     filters.append(WebKit::WebFilterOperation::createBlurFilter(10)); | 397     filters.Append(FilterOperation::CreateBlurFilter(10.f)); | 
| 398 | 398 | 
| 399     // If the child layer has a filter that moves pixels/changes alpha, and is | 399     // If the child layer has a filter that moves pixels/changes alpha, and is | 
| 400     // below child2, then child should not inherit occlusion from outside its | 400     // below child2, then child should not inherit occlusion from outside its | 
| 401     // subtree, and should not contribute to the root | 401     // subtree, and should not contribute to the root | 
| 402     SetLayerPropertiesForTesting( | 402     SetLayerPropertiesForTesting( | 
| 403         root_.get(), NULL, identity_matrix_, | 403         root_.get(), NULL, identity_matrix_, | 
| 404         gfx::PointF(0.f, 0.f), gfx::Size(200, 200), true); | 404         gfx::PointF(0.f, 0.f), gfx::Size(200, 200), true); | 
| 405     SetLayerPropertiesForTesting( | 405     SetLayerPropertiesForTesting( | 
| 406         child_.get(), root_.get(), child_transform, | 406         child_.get(), root_.get(), child_transform, | 
| 407         gfx::PointF(30.f, 30.f), gfx::Size(500, 500), true); | 407         gfx::PointF(30.f, 30.f), gfx::Size(500, 500), true); | 
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 469 | 469 | 
| 470     layer_tree_host()->SetRootLayer(layers[0]); | 470     layer_tree_host()->SetRootLayer(layers[0]); | 
| 471     LayerTreeTest::SetupTree(); | 471     LayerTreeTest::SetupTree(); | 
| 472   } | 472   } | 
| 473 }; | 473 }; | 
| 474 | 474 | 
| 475 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostOcclusionTestManySurfaces); | 475 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostOcclusionTestManySurfaces); | 
| 476 | 476 | 
| 477 }  // namespace | 477 }  // namespace | 
| 478 }  // namespace cc | 478 }  // namespace cc | 
| OLD | NEW | 
|---|