| 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/occlusion_tracker.h" | 5 #include "cc/trees/occlusion_tracker.h" |
| 6 | 6 |
| 7 #include "cc/animation/layer_animation_controller.h" | 7 #include "cc/animation/layer_animation_controller.h" |
| 8 #include "cc/base/math_util.h" | 8 #include "cc/base/math_util.h" |
| 9 #include "cc/layers/layer.h" | 9 #include "cc/layers/layer.h" |
| 10 #include "cc/layers/layer_impl.h" | 10 #include "cc/layers/layer_impl.h" |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 RUN_TEST_MAIN_THREAD_OPAQUE_LAYERS(ClassName) \ | 510 RUN_TEST_MAIN_THREAD_OPAQUE_LAYERS(ClassName) \ |
| 511 RUN_TEST_IMPL_THREAD_OPAQUE_LAYERS(ClassName) | 511 RUN_TEST_IMPL_THREAD_OPAQUE_LAYERS(ClassName) |
| 512 | 512 |
| 513 template <class Types> | 513 template <class Types> |
| 514 class OcclusionTrackerTestIdentityTransforms | 514 class OcclusionTrackerTestIdentityTransforms |
| 515 : public OcclusionTrackerTest<Types> { | 515 : public OcclusionTrackerTest<Types> { |
| 516 protected: | 516 protected: |
| 517 explicit OcclusionTrackerTestIdentityTransforms(bool opaque_layers) | 517 explicit OcclusionTrackerTestIdentityTransforms(bool opaque_layers) |
| 518 : OcclusionTrackerTest<Types>(opaque_layers) {} | 518 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 519 | 519 |
| 520 void RunMyTest() { | 520 void RunMyTest() override { |
| 521 typename Types::ContentLayerType* root = this->CreateRoot( | 521 typename Types::ContentLayerType* root = this->CreateRoot( |
| 522 this->identity_matrix, gfx::PointF(), gfx::Size(200, 200)); | 522 this->identity_matrix, gfx::PointF(), gfx::Size(200, 200)); |
| 523 typename Types::ContentLayerType* parent = this->CreateDrawingLayer( | 523 typename Types::ContentLayerType* parent = this->CreateDrawingLayer( |
| 524 root, this->identity_matrix, gfx::PointF(), gfx::Size(100, 100), true); | 524 root, this->identity_matrix, gfx::PointF(), gfx::Size(100, 100), true); |
| 525 typename Types::ContentLayerType* layer = | 525 typename Types::ContentLayerType* layer = |
| 526 this->CreateDrawingLayer(parent, | 526 this->CreateDrawingLayer(parent, |
| 527 this->identity_matrix, | 527 this->identity_matrix, |
| 528 gfx::PointF(30.f, 30.f), | 528 gfx::PointF(30.f, 30.f), |
| 529 gfx::Size(500, 500), | 529 gfx::Size(500, 500), |
| 530 true); | 530 true); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 544 } | 544 } |
| 545 }; | 545 }; |
| 546 | 546 |
| 547 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestIdentityTransforms); | 547 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestIdentityTransforms); |
| 548 | 548 |
| 549 template <class Types> | 549 template <class Types> |
| 550 class OcclusionTrackerTestRotatedChild : public OcclusionTrackerTest<Types> { | 550 class OcclusionTrackerTestRotatedChild : public OcclusionTrackerTest<Types> { |
| 551 protected: | 551 protected: |
| 552 explicit OcclusionTrackerTestRotatedChild(bool opaque_layers) | 552 explicit OcclusionTrackerTestRotatedChild(bool opaque_layers) |
| 553 : OcclusionTrackerTest<Types>(opaque_layers) {} | 553 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 554 void RunMyTest() { | 554 void RunMyTest() override { |
| 555 gfx::Transform layer_transform; | 555 gfx::Transform layer_transform; |
| 556 layer_transform.Translate(250.0, 250.0); | 556 layer_transform.Translate(250.0, 250.0); |
| 557 layer_transform.Rotate(90.0); | 557 layer_transform.Rotate(90.0); |
| 558 layer_transform.Translate(-250.0, -250.0); | 558 layer_transform.Translate(-250.0, -250.0); |
| 559 | 559 |
| 560 typename Types::ContentLayerType* root = this->CreateRoot( | 560 typename Types::ContentLayerType* root = this->CreateRoot( |
| 561 this->identity_matrix, gfx::Point(0, 0), gfx::Size(200, 200)); | 561 this->identity_matrix, gfx::Point(0, 0), gfx::Size(200, 200)); |
| 562 typename Types::ContentLayerType* parent = this->CreateDrawingLayer( | 562 typename Types::ContentLayerType* parent = this->CreateDrawingLayer( |
| 563 root, this->identity_matrix, gfx::PointF(), gfx::Size(100, 100), true); | 563 root, this->identity_matrix, gfx::PointF(), gfx::Size(100, 100), true); |
| 564 typename Types::ContentLayerType* layer = | 564 typename Types::ContentLayerType* layer = |
| (...skipping 18 matching lines...) Expand all Loading... |
| 583 } | 583 } |
| 584 }; | 584 }; |
| 585 | 585 |
| 586 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestRotatedChild); | 586 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestRotatedChild); |
| 587 | 587 |
| 588 template <class Types> | 588 template <class Types> |
| 589 class OcclusionTrackerTestTranslatedChild : public OcclusionTrackerTest<Types> { | 589 class OcclusionTrackerTestTranslatedChild : public OcclusionTrackerTest<Types> { |
| 590 protected: | 590 protected: |
| 591 explicit OcclusionTrackerTestTranslatedChild(bool opaque_layers) | 591 explicit OcclusionTrackerTestTranslatedChild(bool opaque_layers) |
| 592 : OcclusionTrackerTest<Types>(opaque_layers) {} | 592 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 593 void RunMyTest() { | 593 void RunMyTest() override { |
| 594 gfx::Transform layer_transform; | 594 gfx::Transform layer_transform; |
| 595 layer_transform.Translate(20.0, 20.0); | 595 layer_transform.Translate(20.0, 20.0); |
| 596 | 596 |
| 597 typename Types::ContentLayerType* root = this->CreateRoot( | 597 typename Types::ContentLayerType* root = this->CreateRoot( |
| 598 this->identity_matrix, gfx::PointF(), gfx::Size(200, 200)); | 598 this->identity_matrix, gfx::PointF(), gfx::Size(200, 200)); |
| 599 typename Types::ContentLayerType* parent = this->CreateDrawingLayer( | 599 typename Types::ContentLayerType* parent = this->CreateDrawingLayer( |
| 600 root, this->identity_matrix, gfx::PointF(), gfx::Size(100, 100), true); | 600 root, this->identity_matrix, gfx::PointF(), gfx::Size(100, 100), true); |
| 601 typename Types::ContentLayerType* layer = | 601 typename Types::ContentLayerType* layer = |
| 602 this->CreateDrawingLayer(parent, | 602 this->CreateDrawingLayer(parent, |
| 603 layer_transform, | 603 layer_transform, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 621 }; | 621 }; |
| 622 | 622 |
| 623 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestTranslatedChild); | 623 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestTranslatedChild); |
| 624 | 624 |
| 625 template <class Types> | 625 template <class Types> |
| 626 class OcclusionTrackerTestChildInRotatedChild | 626 class OcclusionTrackerTestChildInRotatedChild |
| 627 : public OcclusionTrackerTest<Types> { | 627 : public OcclusionTrackerTest<Types> { |
| 628 protected: | 628 protected: |
| 629 explicit OcclusionTrackerTestChildInRotatedChild(bool opaque_layers) | 629 explicit OcclusionTrackerTestChildInRotatedChild(bool opaque_layers) |
| 630 : OcclusionTrackerTest<Types>(opaque_layers) {} | 630 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 631 void RunMyTest() { | 631 void RunMyTest() override { |
| 632 gfx::Transform child_transform; | 632 gfx::Transform child_transform; |
| 633 child_transform.Translate(250.0, 250.0); | 633 child_transform.Translate(250.0, 250.0); |
| 634 child_transform.Rotate(90.0); | 634 child_transform.Rotate(90.0); |
| 635 child_transform.Translate(-250.0, -250.0); | 635 child_transform.Translate(-250.0, -250.0); |
| 636 | 636 |
| 637 typename Types::ContentLayerType* parent = this->CreateRoot( | 637 typename Types::ContentLayerType* parent = this->CreateRoot( |
| 638 this->identity_matrix, gfx::PointF(), gfx::Size(100, 100)); | 638 this->identity_matrix, gfx::PointF(), gfx::Size(100, 100)); |
| 639 parent->SetMasksToBounds(true); | 639 parent->SetMasksToBounds(true); |
| 640 typename Types::LayerType* child = this->CreateSurface( | 640 typename Types::LayerType* child = this->CreateSurface( |
| 641 parent, child_transform, gfx::PointF(30.f, 30.f), gfx::Size(500, 500)); | 641 parent, child_transform, gfx::PointF(30.f, 30.f), gfx::Size(500, 500)); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 | 719 |
| 720 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestChildInRotatedChild); | 720 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestChildInRotatedChild); |
| 721 | 721 |
| 722 template <class Types> | 722 template <class Types> |
| 723 class OcclusionTrackerTestScaledRenderSurface | 723 class OcclusionTrackerTestScaledRenderSurface |
| 724 : public OcclusionTrackerTest<Types> { | 724 : public OcclusionTrackerTest<Types> { |
| 725 protected: | 725 protected: |
| 726 explicit OcclusionTrackerTestScaledRenderSurface(bool opaque_layers) | 726 explicit OcclusionTrackerTestScaledRenderSurface(bool opaque_layers) |
| 727 : OcclusionTrackerTest<Types>(opaque_layers) {} | 727 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 728 | 728 |
| 729 void RunMyTest() { | 729 void RunMyTest() override { |
| 730 typename Types::ContentLayerType* parent = this->CreateRoot( | 730 typename Types::ContentLayerType* parent = this->CreateRoot( |
| 731 this->identity_matrix, gfx::PointF(), gfx::Size(200, 200)); | 731 this->identity_matrix, gfx::PointF(), gfx::Size(200, 200)); |
| 732 | 732 |
| 733 gfx::Transform layer1_matrix; | 733 gfx::Transform layer1_matrix; |
| 734 layer1_matrix.Scale(2.0, 2.0); | 734 layer1_matrix.Scale(2.0, 2.0); |
| 735 typename Types::ContentLayerType* layer1 = this->CreateDrawingLayer( | 735 typename Types::ContentLayerType* layer1 = this->CreateDrawingLayer( |
| 736 parent, layer1_matrix, gfx::PointF(), gfx::Size(100, 100), true); | 736 parent, layer1_matrix, gfx::PointF(), gfx::Size(100, 100), true); |
| 737 layer1->SetForceRenderSurface(true); | 737 layer1->SetForceRenderSurface(true); |
| 738 | 738 |
| 739 gfx::Transform layer2_matrix; | 739 gfx::Transform layer2_matrix; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 762 }; | 762 }; |
| 763 | 763 |
| 764 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestScaledRenderSurface); | 764 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestScaledRenderSurface); |
| 765 | 765 |
| 766 template <class Types> | 766 template <class Types> |
| 767 class OcclusionTrackerTestVisitTargetTwoTimes | 767 class OcclusionTrackerTestVisitTargetTwoTimes |
| 768 : public OcclusionTrackerTest<Types> { | 768 : public OcclusionTrackerTest<Types> { |
| 769 protected: | 769 protected: |
| 770 explicit OcclusionTrackerTestVisitTargetTwoTimes(bool opaque_layers) | 770 explicit OcclusionTrackerTestVisitTargetTwoTimes(bool opaque_layers) |
| 771 : OcclusionTrackerTest<Types>(opaque_layers) {} | 771 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 772 void RunMyTest() { | 772 void RunMyTest() override { |
| 773 typename Types::ContentLayerType* root = this->CreateRoot( | 773 typename Types::ContentLayerType* root = this->CreateRoot( |
| 774 this->identity_matrix, gfx::PointF(), gfx::Size(200, 200)); | 774 this->identity_matrix, gfx::PointF(), gfx::Size(200, 200)); |
| 775 typename Types::LayerType* surface = this->CreateSurface( | 775 typename Types::LayerType* surface = this->CreateSurface( |
| 776 root, this->identity_matrix, gfx::PointF(30.f, 30.f), gfx::Size()); | 776 root, this->identity_matrix, gfx::PointF(30.f, 30.f), gfx::Size()); |
| 777 typename Types::ContentLayerType* surface_child = | 777 typename Types::ContentLayerType* surface_child = |
| 778 this->CreateDrawingLayer(surface, | 778 this->CreateDrawingLayer(surface, |
| 779 this->identity_matrix, | 779 this->identity_matrix, |
| 780 gfx::PointF(10.f, 10.f), | 780 gfx::PointF(10.f, 10.f), |
| 781 gfx::Size(50, 50), | 781 gfx::Size(50, 50), |
| 782 true); | 782 true); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 }; | 828 }; |
| 829 | 829 |
| 830 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestVisitTargetTwoTimes); | 830 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestVisitTargetTwoTimes); |
| 831 | 831 |
| 832 template <class Types> | 832 template <class Types> |
| 833 class OcclusionTrackerTestSurfaceRotatedOffAxis | 833 class OcclusionTrackerTestSurfaceRotatedOffAxis |
| 834 : public OcclusionTrackerTest<Types> { | 834 : public OcclusionTrackerTest<Types> { |
| 835 protected: | 835 protected: |
| 836 explicit OcclusionTrackerTestSurfaceRotatedOffAxis(bool opaque_layers) | 836 explicit OcclusionTrackerTestSurfaceRotatedOffAxis(bool opaque_layers) |
| 837 : OcclusionTrackerTest<Types>(opaque_layers) {} | 837 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 838 void RunMyTest() { | 838 void RunMyTest() override { |
| 839 gfx::Transform child_transform; | 839 gfx::Transform child_transform; |
| 840 child_transform.Translate(250.0, 250.0); | 840 child_transform.Translate(250.0, 250.0); |
| 841 child_transform.Rotate(95.0); | 841 child_transform.Rotate(95.0); |
| 842 child_transform.Translate(-250.0, -250.0); | 842 child_transform.Translate(-250.0, -250.0); |
| 843 | 843 |
| 844 gfx::Transform layer_transform; | 844 gfx::Transform layer_transform; |
| 845 layer_transform.Translate(10.0, 10.0); | 845 layer_transform.Translate(10.0, 10.0); |
| 846 | 846 |
| 847 typename Types::ContentLayerType* root = this->CreateRoot( | 847 typename Types::ContentLayerType* root = this->CreateRoot( |
| 848 this->identity_matrix, gfx::PointF(), gfx::Size(1000, 1000)); | 848 this->identity_matrix, gfx::PointF(), gfx::Size(1000, 1000)); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 880 }; | 880 }; |
| 881 | 881 |
| 882 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestSurfaceRotatedOffAxis); | 882 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestSurfaceRotatedOffAxis); |
| 883 | 883 |
| 884 template <class Types> | 884 template <class Types> |
| 885 class OcclusionTrackerTestSurfaceWithTwoOpaqueChildren | 885 class OcclusionTrackerTestSurfaceWithTwoOpaqueChildren |
| 886 : public OcclusionTrackerTest<Types> { | 886 : public OcclusionTrackerTest<Types> { |
| 887 protected: | 887 protected: |
| 888 explicit OcclusionTrackerTestSurfaceWithTwoOpaqueChildren(bool opaque_layers) | 888 explicit OcclusionTrackerTestSurfaceWithTwoOpaqueChildren(bool opaque_layers) |
| 889 : OcclusionTrackerTest<Types>(opaque_layers) {} | 889 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 890 void RunMyTest() { | 890 void RunMyTest() override { |
| 891 gfx::Transform child_transform; | 891 gfx::Transform child_transform; |
| 892 child_transform.Translate(250.0, 250.0); | 892 child_transform.Translate(250.0, 250.0); |
| 893 child_transform.Rotate(90.0); | 893 child_transform.Rotate(90.0); |
| 894 child_transform.Translate(-250.0, -250.0); | 894 child_transform.Translate(-250.0, -250.0); |
| 895 | 895 |
| 896 typename Types::ContentLayerType* root = this->CreateRoot( | 896 typename Types::ContentLayerType* root = this->CreateRoot( |
| 897 this->identity_matrix, gfx::PointF(), gfx::Size(1000, 1000)); | 897 this->identity_matrix, gfx::PointF(), gfx::Size(1000, 1000)); |
| 898 typename Types::ContentLayerType* parent = this->CreateDrawingLayer( | 898 typename Types::ContentLayerType* parent = this->CreateDrawingLayer( |
| 899 root, this->identity_matrix, gfx::PointF(), gfx::Size(100, 100), true); | 899 root, this->identity_matrix, gfx::PointF(), gfx::Size(100, 100), true); |
| 900 parent->SetMasksToBounds(true); | 900 parent->SetMasksToBounds(true); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 }; | 968 }; |
| 969 | 969 |
| 970 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestSurfaceWithTwoOpaqueChildren); | 970 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestSurfaceWithTwoOpaqueChildren); |
| 971 | 971 |
| 972 template <class Types> | 972 template <class Types> |
| 973 class OcclusionTrackerTestOverlappingSurfaceSiblings | 973 class OcclusionTrackerTestOverlappingSurfaceSiblings |
| 974 : public OcclusionTrackerTest<Types> { | 974 : public OcclusionTrackerTest<Types> { |
| 975 protected: | 975 protected: |
| 976 explicit OcclusionTrackerTestOverlappingSurfaceSiblings(bool opaque_layers) | 976 explicit OcclusionTrackerTestOverlappingSurfaceSiblings(bool opaque_layers) |
| 977 : OcclusionTrackerTest<Types>(opaque_layers) {} | 977 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 978 void RunMyTest() { | 978 void RunMyTest() override { |
| 979 typename Types::ContentLayerType* parent = this->CreateRoot( | 979 typename Types::ContentLayerType* parent = this->CreateRoot( |
| 980 this->identity_matrix, gfx::PointF(), gfx::Size(100, 100)); | 980 this->identity_matrix, gfx::PointF(), gfx::Size(100, 100)); |
| 981 parent->SetMasksToBounds(true); | 981 parent->SetMasksToBounds(true); |
| 982 typename Types::LayerType* child1 = this->CreateSurface( | 982 typename Types::LayerType* child1 = this->CreateSurface( |
| 983 parent, this->identity_matrix, gfx::PointF(10.f, 0.f), gfx::Size()); | 983 parent, this->identity_matrix, gfx::PointF(10.f, 0.f), gfx::Size()); |
| 984 typename Types::LayerType* child2 = this->CreateSurface( | 984 typename Types::LayerType* child2 = this->CreateSurface( |
| 985 parent, this->identity_matrix, gfx::PointF(30.f, 0.f), gfx::Size()); | 985 parent, this->identity_matrix, gfx::PointF(30.f, 0.f), gfx::Size()); |
| 986 typename Types::ContentLayerType* layer1 = this->CreateDrawingLayer( | 986 typename Types::ContentLayerType* layer1 = this->CreateDrawingLayer( |
| 987 child1, this->identity_matrix, gfx::PointF(), gfx::Size(40, 50), true); | 987 child1, this->identity_matrix, gfx::PointF(), gfx::Size(40, 50), true); |
| 988 typename Types::ContentLayerType* layer2 = | 988 typename Types::ContentLayerType* layer2 = |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1028 | 1028 |
| 1029 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestOverlappingSurfaceSiblings); | 1029 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestOverlappingSurfaceSiblings); |
| 1030 | 1030 |
| 1031 template <class Types> | 1031 template <class Types> |
| 1032 class OcclusionTrackerTestOverlappingSurfaceSiblingsWithTwoTransforms | 1032 class OcclusionTrackerTestOverlappingSurfaceSiblingsWithTwoTransforms |
| 1033 : public OcclusionTrackerTest<Types> { | 1033 : public OcclusionTrackerTest<Types> { |
| 1034 protected: | 1034 protected: |
| 1035 explicit OcclusionTrackerTestOverlappingSurfaceSiblingsWithTwoTransforms( | 1035 explicit OcclusionTrackerTestOverlappingSurfaceSiblingsWithTwoTransforms( |
| 1036 bool opaque_layers) | 1036 bool opaque_layers) |
| 1037 : OcclusionTrackerTest<Types>(opaque_layers) {} | 1037 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 1038 void RunMyTest() { | 1038 void RunMyTest() override { |
| 1039 gfx::Transform child1_transform; | 1039 gfx::Transform child1_transform; |
| 1040 child1_transform.Translate(250.0, 250.0); | 1040 child1_transform.Translate(250.0, 250.0); |
| 1041 child1_transform.Rotate(-90.0); | 1041 child1_transform.Rotate(-90.0); |
| 1042 child1_transform.Translate(-250.0, -250.0); | 1042 child1_transform.Translate(-250.0, -250.0); |
| 1043 | 1043 |
| 1044 gfx::Transform child2_transform; | 1044 gfx::Transform child2_transform; |
| 1045 child2_transform.Translate(250.0, 250.0); | 1045 child2_transform.Translate(250.0, 250.0); |
| 1046 child2_transform.Rotate(90.0); | 1046 child2_transform.Rotate(90.0); |
| 1047 child2_transform.Translate(-250.0, -250.0); | 1047 child2_transform.Translate(-250.0, -250.0); |
| 1048 | 1048 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1134 }; | 1134 }; |
| 1135 | 1135 |
| 1136 ALL_OCCLUSIONTRACKER_TEST( | 1136 ALL_OCCLUSIONTRACKER_TEST( |
| 1137 OcclusionTrackerTestOverlappingSurfaceSiblingsWithTwoTransforms); | 1137 OcclusionTrackerTestOverlappingSurfaceSiblingsWithTwoTransforms); |
| 1138 | 1138 |
| 1139 template <class Types> | 1139 template <class Types> |
| 1140 class OcclusionTrackerTestFilters : public OcclusionTrackerTest<Types> { | 1140 class OcclusionTrackerTestFilters : public OcclusionTrackerTest<Types> { |
| 1141 protected: | 1141 protected: |
| 1142 explicit OcclusionTrackerTestFilters(bool opaque_layers) | 1142 explicit OcclusionTrackerTestFilters(bool opaque_layers) |
| 1143 : OcclusionTrackerTest<Types>(opaque_layers) {} | 1143 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 1144 void RunMyTest() { | 1144 void RunMyTest() override { |
| 1145 gfx::Transform layer_transform; | 1145 gfx::Transform layer_transform; |
| 1146 layer_transform.Translate(250.0, 250.0); | 1146 layer_transform.Translate(250.0, 250.0); |
| 1147 layer_transform.Rotate(90.0); | 1147 layer_transform.Rotate(90.0); |
| 1148 layer_transform.Translate(-250.0, -250.0); | 1148 layer_transform.Translate(-250.0, -250.0); |
| 1149 | 1149 |
| 1150 typename Types::ContentLayerType* parent = this->CreateRoot( | 1150 typename Types::ContentLayerType* parent = this->CreateRoot( |
| 1151 this->identity_matrix, gfx::PointF(), gfx::Size(100, 100)); | 1151 this->identity_matrix, gfx::PointF(), gfx::Size(100, 100)); |
| 1152 parent->SetMasksToBounds(true); | 1152 parent->SetMasksToBounds(true); |
| 1153 typename Types::ContentLayerType* blur_layer = | 1153 typename Types::ContentLayerType* blur_layer = |
| 1154 this->CreateDrawingLayer(parent, | 1154 this->CreateDrawingLayer(parent, |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1234 }; | 1234 }; |
| 1235 | 1235 |
| 1236 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestFilters); | 1236 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestFilters); |
| 1237 | 1237 |
| 1238 template <class Types> | 1238 template <class Types> |
| 1239 class OcclusionTrackerTestReplicaDoesOcclude | 1239 class OcclusionTrackerTestReplicaDoesOcclude |
| 1240 : public OcclusionTrackerTest<Types> { | 1240 : public OcclusionTrackerTest<Types> { |
| 1241 protected: | 1241 protected: |
| 1242 explicit OcclusionTrackerTestReplicaDoesOcclude(bool opaque_layers) | 1242 explicit OcclusionTrackerTestReplicaDoesOcclude(bool opaque_layers) |
| 1243 : OcclusionTrackerTest<Types>(opaque_layers) {} | 1243 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 1244 void RunMyTest() { | 1244 void RunMyTest() override { |
| 1245 typename Types::ContentLayerType* parent = this->CreateRoot( | 1245 typename Types::ContentLayerType* parent = this->CreateRoot( |
| 1246 this->identity_matrix, gfx::PointF(), gfx::Size(100, 200)); | 1246 this->identity_matrix, gfx::PointF(), gfx::Size(100, 200)); |
| 1247 typename Types::LayerType* surface = this->CreateDrawingSurface( | 1247 typename Types::LayerType* surface = this->CreateDrawingSurface( |
| 1248 parent, this->identity_matrix, gfx::PointF(), gfx::Size(50, 50), true); | 1248 parent, this->identity_matrix, gfx::PointF(), gfx::Size(50, 50), true); |
| 1249 this->CreateReplicaLayer( | 1249 this->CreateReplicaLayer( |
| 1250 surface, this->identity_matrix, gfx::PointF(0.f, 50.f), gfx::Size()); | 1250 surface, this->identity_matrix, gfx::PointF(0.f, 50.f), gfx::Size()); |
| 1251 this->CalcDrawEtc(parent); | 1251 this->CalcDrawEtc(parent); |
| 1252 | 1252 |
| 1253 TestOcclusionTrackerWithClip<typename Types::LayerType> occlusion( | 1253 TestOcclusionTrackerWithClip<typename Types::LayerType> occlusion( |
| 1254 gfx::Rect(0, 0, 1000, 1000)); | 1254 gfx::Rect(0, 0, 1000, 1000)); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1268 }; | 1268 }; |
| 1269 | 1269 |
| 1270 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestReplicaDoesOcclude); | 1270 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestReplicaDoesOcclude); |
| 1271 | 1271 |
| 1272 template <class Types> | 1272 template <class Types> |
| 1273 class OcclusionTrackerTestReplicaWithClipping | 1273 class OcclusionTrackerTestReplicaWithClipping |
| 1274 : public OcclusionTrackerTest<Types> { | 1274 : public OcclusionTrackerTest<Types> { |
| 1275 protected: | 1275 protected: |
| 1276 explicit OcclusionTrackerTestReplicaWithClipping(bool opaque_layers) | 1276 explicit OcclusionTrackerTestReplicaWithClipping(bool opaque_layers) |
| 1277 : OcclusionTrackerTest<Types>(opaque_layers) {} | 1277 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 1278 void RunMyTest() { | 1278 void RunMyTest() override { |
| 1279 typename Types::ContentLayerType* parent = this->CreateRoot( | 1279 typename Types::ContentLayerType* parent = this->CreateRoot( |
| 1280 this->identity_matrix, gfx::PointF(), gfx::Size(100, 170)); | 1280 this->identity_matrix, gfx::PointF(), gfx::Size(100, 170)); |
| 1281 parent->SetMasksToBounds(true); | 1281 parent->SetMasksToBounds(true); |
| 1282 typename Types::LayerType* surface = | 1282 typename Types::LayerType* surface = |
| 1283 this->CreateDrawingSurface(parent, | 1283 this->CreateDrawingSurface(parent, |
| 1284 this->identity_matrix, | 1284 this->identity_matrix, |
| 1285 gfx::PointF(0.f, 100.f), | 1285 gfx::PointF(0.f, 100.f), |
| 1286 gfx::Size(50, 50), | 1286 gfx::Size(50, 50), |
| 1287 true); | 1287 true); |
| 1288 this->CreateReplicaLayer( | 1288 this->CreateReplicaLayer( |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1310 } | 1310 } |
| 1311 }; | 1311 }; |
| 1312 | 1312 |
| 1313 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestReplicaWithClipping); | 1313 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestReplicaWithClipping); |
| 1314 | 1314 |
| 1315 template <class Types> | 1315 template <class Types> |
| 1316 class OcclusionTrackerTestReplicaWithMask : public OcclusionTrackerTest<Types> { | 1316 class OcclusionTrackerTestReplicaWithMask : public OcclusionTrackerTest<Types> { |
| 1317 protected: | 1317 protected: |
| 1318 explicit OcclusionTrackerTestReplicaWithMask(bool opaque_layers) | 1318 explicit OcclusionTrackerTestReplicaWithMask(bool opaque_layers) |
| 1319 : OcclusionTrackerTest<Types>(opaque_layers) {} | 1319 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 1320 void RunMyTest() { | 1320 void RunMyTest() override { |
| 1321 typename Types::ContentLayerType* parent = this->CreateRoot( | 1321 typename Types::ContentLayerType* parent = this->CreateRoot( |
| 1322 this->identity_matrix, gfx::PointF(), gfx::Size(100, 200)); | 1322 this->identity_matrix, gfx::PointF(), gfx::Size(100, 200)); |
| 1323 typename Types::LayerType* surface = | 1323 typename Types::LayerType* surface = |
| 1324 this->CreateDrawingSurface(parent, | 1324 this->CreateDrawingSurface(parent, |
| 1325 this->identity_matrix, | 1325 this->identity_matrix, |
| 1326 gfx::PointF(0.f, 100.f), | 1326 gfx::PointF(0.f, 100.f), |
| 1327 gfx::Size(50, 50), | 1327 gfx::Size(50, 50), |
| 1328 true); | 1328 true); |
| 1329 typename Types::LayerType* replica = this->CreateReplicaLayer( | 1329 typename Types::LayerType* replica = this->CreateReplicaLayer( |
| 1330 surface, this->identity_matrix, gfx::PointF(50.f, 50.f), gfx::Size()); | 1330 surface, this->identity_matrix, gfx::PointF(50.f, 50.f), gfx::Size()); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1350 }; | 1350 }; |
| 1351 | 1351 |
| 1352 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestReplicaWithMask); | 1352 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestReplicaWithMask); |
| 1353 | 1353 |
| 1354 template <class Types> | 1354 template <class Types> |
| 1355 class OcclusionTrackerTestOpaqueContentsRegionEmpty | 1355 class OcclusionTrackerTestOpaqueContentsRegionEmpty |
| 1356 : public OcclusionTrackerTest<Types> { | 1356 : public OcclusionTrackerTest<Types> { |
| 1357 protected: | 1357 protected: |
| 1358 explicit OcclusionTrackerTestOpaqueContentsRegionEmpty(bool opaque_layers) | 1358 explicit OcclusionTrackerTestOpaqueContentsRegionEmpty(bool opaque_layers) |
| 1359 : OcclusionTrackerTest<Types>(opaque_layers) {} | 1359 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 1360 void RunMyTest() { | 1360 void RunMyTest() override { |
| 1361 typename Types::ContentLayerType* parent = this->CreateRoot( | 1361 typename Types::ContentLayerType* parent = this->CreateRoot( |
| 1362 this->identity_matrix, gfx::PointF(), gfx::Size(300, 300)); | 1362 this->identity_matrix, gfx::PointF(), gfx::Size(300, 300)); |
| 1363 typename Types::ContentLayerType* layer = | 1363 typename Types::ContentLayerType* layer = |
| 1364 this->CreateDrawingSurface(parent, | 1364 this->CreateDrawingSurface(parent, |
| 1365 this->identity_matrix, | 1365 this->identity_matrix, |
| 1366 gfx::PointF(), | 1366 gfx::PointF(), |
| 1367 gfx::Size(200, 200), | 1367 gfx::Size(200, 200), |
| 1368 false); | 1368 false); |
| 1369 this->CalcDrawEtc(parent); | 1369 this->CalcDrawEtc(parent); |
| 1370 | 1370 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1385 }; | 1385 }; |
| 1386 | 1386 |
| 1387 MAIN_AND_IMPL_THREAD_TEST(OcclusionTrackerTestOpaqueContentsRegionEmpty); | 1387 MAIN_AND_IMPL_THREAD_TEST(OcclusionTrackerTestOpaqueContentsRegionEmpty); |
| 1388 | 1388 |
| 1389 template <class Types> | 1389 template <class Types> |
| 1390 class OcclusionTrackerTestOpaqueContentsRegionNonEmpty | 1390 class OcclusionTrackerTestOpaqueContentsRegionNonEmpty |
| 1391 : public OcclusionTrackerTest<Types> { | 1391 : public OcclusionTrackerTest<Types> { |
| 1392 protected: | 1392 protected: |
| 1393 explicit OcclusionTrackerTestOpaqueContentsRegionNonEmpty(bool opaque_layers) | 1393 explicit OcclusionTrackerTestOpaqueContentsRegionNonEmpty(bool opaque_layers) |
| 1394 : OcclusionTrackerTest<Types>(opaque_layers) {} | 1394 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 1395 void RunMyTest() { | 1395 void RunMyTest() override { |
| 1396 typename Types::ContentLayerType* parent = this->CreateRoot( | 1396 typename Types::ContentLayerType* parent = this->CreateRoot( |
| 1397 this->identity_matrix, gfx::PointF(), gfx::Size(300, 300)); | 1397 this->identity_matrix, gfx::PointF(), gfx::Size(300, 300)); |
| 1398 typename Types::ContentLayerType* layer = | 1398 typename Types::ContentLayerType* layer = |
| 1399 this->CreateDrawingLayer(parent, | 1399 this->CreateDrawingLayer(parent, |
| 1400 this->identity_matrix, | 1400 this->identity_matrix, |
| 1401 gfx::PointF(100.f, 100.f), | 1401 gfx::PointF(100.f, 100.f), |
| 1402 gfx::Size(200, 200), | 1402 gfx::Size(200, 200), |
| 1403 false); | 1403 false); |
| 1404 this->CalcDrawEtc(parent); | 1404 this->CalcDrawEtc(parent); |
| 1405 { | 1405 { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1442 }; | 1442 }; |
| 1443 | 1443 |
| 1444 MAIN_AND_IMPL_THREAD_TEST(OcclusionTrackerTestOpaqueContentsRegionNonEmpty); | 1444 MAIN_AND_IMPL_THREAD_TEST(OcclusionTrackerTestOpaqueContentsRegionNonEmpty); |
| 1445 | 1445 |
| 1446 template <class Types> | 1446 template <class Types> |
| 1447 class OcclusionTrackerTestUnsorted3dLayers | 1447 class OcclusionTrackerTestUnsorted3dLayers |
| 1448 : public OcclusionTrackerTest<Types> { | 1448 : public OcclusionTrackerTest<Types> { |
| 1449 protected: | 1449 protected: |
| 1450 explicit OcclusionTrackerTestUnsorted3dLayers(bool opaque_layers) | 1450 explicit OcclusionTrackerTestUnsorted3dLayers(bool opaque_layers) |
| 1451 : OcclusionTrackerTest<Types>(opaque_layers) {} | 1451 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 1452 void RunMyTest() { | 1452 void RunMyTest() override { |
| 1453 // Currently, The main thread layer iterator does not iterate over 3d items | 1453 // Currently, The main thread layer iterator does not iterate over 3d items |
| 1454 // in sorted order, because layer sorting is not performed on the main | 1454 // in sorted order, because layer sorting is not performed on the main |
| 1455 // thread. Because of this, the occlusion tracker cannot assume that a 3d | 1455 // thread. Because of this, the occlusion tracker cannot assume that a 3d |
| 1456 // layer occludes other layers that have not yet been iterated over. For | 1456 // layer occludes other layers that have not yet been iterated over. For |
| 1457 // now, the expected behavior is that a 3d layer simply does not add any | 1457 // now, the expected behavior is that a 3d layer simply does not add any |
| 1458 // occlusion to the occlusion tracker. | 1458 // occlusion to the occlusion tracker. |
| 1459 | 1459 |
| 1460 gfx::Transform translation_to_front; | 1460 gfx::Transform translation_to_front; |
| 1461 translation_to_front.Translate3d(0.0, 0.0, -10.0); | 1461 translation_to_front.Translate3d(0.0, 0.0, -10.0); |
| 1462 gfx::Transform translation_to_back; | 1462 gfx::Transform translation_to_back; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1495 // will only work on the main thread. | 1495 // will only work on the main thread. |
| 1496 MAIN_THREAD_TEST(OcclusionTrackerTestUnsorted3dLayers); | 1496 MAIN_THREAD_TEST(OcclusionTrackerTestUnsorted3dLayers); |
| 1497 | 1497 |
| 1498 template <class Types> | 1498 template <class Types> |
| 1499 class OcclusionTrackerTestLayerBehindCameraDoesNotOcclude | 1499 class OcclusionTrackerTestLayerBehindCameraDoesNotOcclude |
| 1500 : public OcclusionTrackerTest<Types> { | 1500 : public OcclusionTrackerTest<Types> { |
| 1501 protected: | 1501 protected: |
| 1502 explicit OcclusionTrackerTestLayerBehindCameraDoesNotOcclude( | 1502 explicit OcclusionTrackerTestLayerBehindCameraDoesNotOcclude( |
| 1503 bool opaque_layers) | 1503 bool opaque_layers) |
| 1504 : OcclusionTrackerTest<Types>(opaque_layers) {} | 1504 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 1505 void RunMyTest() { | 1505 void RunMyTest() override { |
| 1506 gfx::Transform transform; | 1506 gfx::Transform transform; |
| 1507 transform.Translate(50.0, 50.0); | 1507 transform.Translate(50.0, 50.0); |
| 1508 transform.ApplyPerspectiveDepth(100.0); | 1508 transform.ApplyPerspectiveDepth(100.0); |
| 1509 transform.Translate3d(0.0, 0.0, 110.0); | 1509 transform.Translate3d(0.0, 0.0, 110.0); |
| 1510 transform.Translate(-50.0, -50.0); | 1510 transform.Translate(-50.0, -50.0); |
| 1511 | 1511 |
| 1512 typename Types::ContentLayerType* parent = this->CreateRoot( | 1512 typename Types::ContentLayerType* parent = this->CreateRoot( |
| 1513 this->identity_matrix, gfx::PointF(), gfx::Size(100, 100)); | 1513 this->identity_matrix, gfx::PointF(), gfx::Size(100, 100)); |
| 1514 typename Types::ContentLayerType* layer = this->CreateDrawingLayer( | 1514 typename Types::ContentLayerType* layer = this->CreateDrawingLayer( |
| 1515 parent, transform, gfx::PointF(), gfx::Size(100, 100), true); | 1515 parent, transform, gfx::PointF(), gfx::Size(100, 100), true); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1535 // thread. | 1535 // thread. |
| 1536 IMPL_THREAD_TEST(OcclusionTrackerTestLayerBehindCameraDoesNotOcclude); | 1536 IMPL_THREAD_TEST(OcclusionTrackerTestLayerBehindCameraDoesNotOcclude); |
| 1537 | 1537 |
| 1538 template <class Types> | 1538 template <class Types> |
| 1539 class OcclusionTrackerTestLargePixelsOccludeInsideClipRect | 1539 class OcclusionTrackerTestLargePixelsOccludeInsideClipRect |
| 1540 : public OcclusionTrackerTest<Types> { | 1540 : public OcclusionTrackerTest<Types> { |
| 1541 protected: | 1541 protected: |
| 1542 explicit OcclusionTrackerTestLargePixelsOccludeInsideClipRect( | 1542 explicit OcclusionTrackerTestLargePixelsOccludeInsideClipRect( |
| 1543 bool opaque_layers) | 1543 bool opaque_layers) |
| 1544 : OcclusionTrackerTest<Types>(opaque_layers) {} | 1544 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 1545 void RunMyTest() { | 1545 void RunMyTest() override { |
| 1546 gfx::Transform transform; | 1546 gfx::Transform transform; |
| 1547 transform.Translate(50.0, 50.0); | 1547 transform.Translate(50.0, 50.0); |
| 1548 transform.ApplyPerspectiveDepth(100.0); | 1548 transform.ApplyPerspectiveDepth(100.0); |
| 1549 transform.Translate3d(0.0, 0.0, 99.0); | 1549 transform.Translate3d(0.0, 0.0, 99.0); |
| 1550 transform.Translate(-50.0, -50.0); | 1550 transform.Translate(-50.0, -50.0); |
| 1551 | 1551 |
| 1552 typename Types::ContentLayerType* parent = this->CreateRoot( | 1552 typename Types::ContentLayerType* parent = this->CreateRoot( |
| 1553 this->identity_matrix, gfx::PointF(), gfx::Size(100, 100)); | 1553 this->identity_matrix, gfx::PointF(), gfx::Size(100, 100)); |
| 1554 parent->SetMasksToBounds(true); | 1554 parent->SetMasksToBounds(true); |
| 1555 typename Types::ContentLayerType* layer = this->CreateDrawingLayer( | 1555 typename Types::ContentLayerType* layer = this->CreateDrawingLayer( |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1579 // the occlusion tracker on the main thread. So this test should run on the impl | 1579 // the occlusion tracker on the main thread. So this test should run on the impl |
| 1580 // thread. | 1580 // thread. |
| 1581 IMPL_THREAD_TEST(OcclusionTrackerTestLargePixelsOccludeInsideClipRect); | 1581 IMPL_THREAD_TEST(OcclusionTrackerTestLargePixelsOccludeInsideClipRect); |
| 1582 | 1582 |
| 1583 template <class Types> | 1583 template <class Types> |
| 1584 class OcclusionTrackerTestAnimationOpacity1OnMainThread | 1584 class OcclusionTrackerTestAnimationOpacity1OnMainThread |
| 1585 : public OcclusionTrackerTest<Types> { | 1585 : public OcclusionTrackerTest<Types> { |
| 1586 protected: | 1586 protected: |
| 1587 explicit OcclusionTrackerTestAnimationOpacity1OnMainThread(bool opaque_layers) | 1587 explicit OcclusionTrackerTestAnimationOpacity1OnMainThread(bool opaque_layers) |
| 1588 : OcclusionTrackerTest<Types>(opaque_layers) {} | 1588 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 1589 void RunMyTest() { | 1589 void RunMyTest() override { |
| 1590 // parent | 1590 // parent |
| 1591 // +--layer | 1591 // +--layer |
| 1592 // +--surface | 1592 // +--surface |
| 1593 // | +--surface_child | 1593 // | +--surface_child |
| 1594 // | +--surface_child2 | 1594 // | +--surface_child2 |
| 1595 // +--parent2 | 1595 // +--parent2 |
| 1596 // +--topmost | 1596 // +--topmost |
| 1597 | 1597 |
| 1598 typename Types::ContentLayerType* parent = this->CreateRoot( | 1598 typename Types::ContentLayerType* parent = this->CreateRoot( |
| 1599 this->identity_matrix, gfx::PointF(), gfx::Size(300, 300)); | 1599 this->identity_matrix, gfx::PointF(), gfx::Size(300, 300)); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1698 }; | 1698 }; |
| 1699 | 1699 |
| 1700 MAIN_THREAD_TEST(OcclusionTrackerTestAnimationOpacity1OnMainThread); | 1700 MAIN_THREAD_TEST(OcclusionTrackerTestAnimationOpacity1OnMainThread); |
| 1701 | 1701 |
| 1702 template <class Types> | 1702 template <class Types> |
| 1703 class OcclusionTrackerTestAnimationOpacity0OnMainThread | 1703 class OcclusionTrackerTestAnimationOpacity0OnMainThread |
| 1704 : public OcclusionTrackerTest<Types> { | 1704 : public OcclusionTrackerTest<Types> { |
| 1705 protected: | 1705 protected: |
| 1706 explicit OcclusionTrackerTestAnimationOpacity0OnMainThread(bool opaque_layers) | 1706 explicit OcclusionTrackerTestAnimationOpacity0OnMainThread(bool opaque_layers) |
| 1707 : OcclusionTrackerTest<Types>(opaque_layers) {} | 1707 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 1708 void RunMyTest() { | 1708 void RunMyTest() override { |
| 1709 typename Types::ContentLayerType* parent = this->CreateRoot( | 1709 typename Types::ContentLayerType* parent = this->CreateRoot( |
| 1710 this->identity_matrix, gfx::PointF(), gfx::Size(300, 300)); | 1710 this->identity_matrix, gfx::PointF(), gfx::Size(300, 300)); |
| 1711 typename Types::ContentLayerType* layer = | 1711 typename Types::ContentLayerType* layer = |
| 1712 this->CreateDrawingLayer(parent, | 1712 this->CreateDrawingLayer(parent, |
| 1713 this->identity_matrix, | 1713 this->identity_matrix, |
| 1714 gfx::PointF(), | 1714 gfx::PointF(), |
| 1715 gfx::Size(300, 300), | 1715 gfx::Size(300, 300), |
| 1716 true); | 1716 true); |
| 1717 typename Types::ContentLayerType* surface = | 1717 typename Types::ContentLayerType* surface = |
| 1718 this->CreateDrawingSurface(parent, | 1718 this->CreateDrawingSurface(parent, |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1809 | 1809 |
| 1810 MAIN_THREAD_TEST(OcclusionTrackerTestAnimationOpacity0OnMainThread); | 1810 MAIN_THREAD_TEST(OcclusionTrackerTestAnimationOpacity0OnMainThread); |
| 1811 | 1811 |
| 1812 template <class Types> | 1812 template <class Types> |
| 1813 class OcclusionTrackerTestAnimationTranslateOnMainThread | 1813 class OcclusionTrackerTestAnimationTranslateOnMainThread |
| 1814 : public OcclusionTrackerTest<Types> { | 1814 : public OcclusionTrackerTest<Types> { |
| 1815 protected: | 1815 protected: |
| 1816 explicit OcclusionTrackerTestAnimationTranslateOnMainThread( | 1816 explicit OcclusionTrackerTestAnimationTranslateOnMainThread( |
| 1817 bool opaque_layers) | 1817 bool opaque_layers) |
| 1818 : OcclusionTrackerTest<Types>(opaque_layers) {} | 1818 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 1819 void RunMyTest() { | 1819 void RunMyTest() override { |
| 1820 typename Types::ContentLayerType* parent = this->CreateRoot( | 1820 typename Types::ContentLayerType* parent = this->CreateRoot( |
| 1821 this->identity_matrix, gfx::PointF(), gfx::Size(300, 300)); | 1821 this->identity_matrix, gfx::PointF(), gfx::Size(300, 300)); |
| 1822 typename Types::ContentLayerType* layer = | 1822 typename Types::ContentLayerType* layer = |
| 1823 this->CreateDrawingLayer(parent, | 1823 this->CreateDrawingLayer(parent, |
| 1824 this->identity_matrix, | 1824 this->identity_matrix, |
| 1825 gfx::PointF(), | 1825 gfx::PointF(), |
| 1826 gfx::Size(300, 300), | 1826 gfx::Size(300, 300), |
| 1827 true); | 1827 true); |
| 1828 typename Types::ContentLayerType* surface = | 1828 typename Types::ContentLayerType* surface = |
| 1829 this->CreateDrawingSurface(parent, | 1829 this->CreateDrawingSurface(parent, |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1939 | 1939 |
| 1940 MAIN_THREAD_TEST(OcclusionTrackerTestAnimationTranslateOnMainThread); | 1940 MAIN_THREAD_TEST(OcclusionTrackerTestAnimationTranslateOnMainThread); |
| 1941 | 1941 |
| 1942 template <class Types> | 1942 template <class Types> |
| 1943 class OcclusionTrackerTestSurfaceOcclusionTranslatesToParent | 1943 class OcclusionTrackerTestSurfaceOcclusionTranslatesToParent |
| 1944 : public OcclusionTrackerTest<Types> { | 1944 : public OcclusionTrackerTest<Types> { |
| 1945 protected: | 1945 protected: |
| 1946 explicit OcclusionTrackerTestSurfaceOcclusionTranslatesToParent( | 1946 explicit OcclusionTrackerTestSurfaceOcclusionTranslatesToParent( |
| 1947 bool opaque_layers) | 1947 bool opaque_layers) |
| 1948 : OcclusionTrackerTest<Types>(opaque_layers) {} | 1948 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 1949 void RunMyTest() { | 1949 void RunMyTest() override { |
| 1950 gfx::Transform surface_transform; | 1950 gfx::Transform surface_transform; |
| 1951 surface_transform.Translate(300.0, 300.0); | 1951 surface_transform.Translate(300.0, 300.0); |
| 1952 surface_transform.Scale(2.0, 2.0); | 1952 surface_transform.Scale(2.0, 2.0); |
| 1953 surface_transform.Translate(-150.0, -150.0); | 1953 surface_transform.Translate(-150.0, -150.0); |
| 1954 | 1954 |
| 1955 typename Types::ContentLayerType* parent = this->CreateRoot( | 1955 typename Types::ContentLayerType* parent = this->CreateRoot( |
| 1956 this->identity_matrix, gfx::PointF(), gfx::Size(500, 500)); | 1956 this->identity_matrix, gfx::PointF(), gfx::Size(500, 500)); |
| 1957 typename Types::ContentLayerType* surface = this->CreateDrawingSurface( | 1957 typename Types::ContentLayerType* surface = this->CreateDrawingSurface( |
| 1958 parent, surface_transform, gfx::PointF(), gfx::Size(300, 300), false); | 1958 parent, surface_transform, gfx::PointF(), gfx::Size(300, 300), false); |
| 1959 typename Types::ContentLayerType* surface2 = | 1959 typename Types::ContentLayerType* surface2 = |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1994 MAIN_AND_IMPL_THREAD_TEST( | 1994 MAIN_AND_IMPL_THREAD_TEST( |
| 1995 OcclusionTrackerTestSurfaceOcclusionTranslatesToParent); | 1995 OcclusionTrackerTestSurfaceOcclusionTranslatesToParent); |
| 1996 | 1996 |
| 1997 template <class Types> | 1997 template <class Types> |
| 1998 class OcclusionTrackerTestSurfaceOcclusionTranslatesWithClipping | 1998 class OcclusionTrackerTestSurfaceOcclusionTranslatesWithClipping |
| 1999 : public OcclusionTrackerTest<Types> { | 1999 : public OcclusionTrackerTest<Types> { |
| 2000 protected: | 2000 protected: |
| 2001 explicit OcclusionTrackerTestSurfaceOcclusionTranslatesWithClipping( | 2001 explicit OcclusionTrackerTestSurfaceOcclusionTranslatesWithClipping( |
| 2002 bool opaque_layers) | 2002 bool opaque_layers) |
| 2003 : OcclusionTrackerTest<Types>(opaque_layers) {} | 2003 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 2004 void RunMyTest() { | 2004 void RunMyTest() override { |
| 2005 typename Types::ContentLayerType* parent = this->CreateRoot( | 2005 typename Types::ContentLayerType* parent = this->CreateRoot( |
| 2006 this->identity_matrix, gfx::PointF(), gfx::Size(300, 300)); | 2006 this->identity_matrix, gfx::PointF(), gfx::Size(300, 300)); |
| 2007 parent->SetMasksToBounds(true); | 2007 parent->SetMasksToBounds(true); |
| 2008 typename Types::ContentLayerType* surface = | 2008 typename Types::ContentLayerType* surface = |
| 2009 this->CreateDrawingSurface(parent, | 2009 this->CreateDrawingSurface(parent, |
| 2010 this->identity_matrix, | 2010 this->identity_matrix, |
| 2011 gfx::PointF(), | 2011 gfx::PointF(), |
| 2012 gfx::Size(500, 300), | 2012 gfx::Size(500, 300), |
| 2013 false); | 2013 false); |
| 2014 surface->SetOpaqueContentsRect(gfx::Rect(0, 0, 400, 200)); | 2014 surface->SetOpaqueContentsRect(gfx::Rect(0, 0, 400, 200)); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 2029 | 2029 |
| 2030 MAIN_AND_IMPL_THREAD_TEST( | 2030 MAIN_AND_IMPL_THREAD_TEST( |
| 2031 OcclusionTrackerTestSurfaceOcclusionTranslatesWithClipping); | 2031 OcclusionTrackerTestSurfaceOcclusionTranslatesWithClipping); |
| 2032 | 2032 |
| 2033 template <class Types> | 2033 template <class Types> |
| 2034 class OcclusionTrackerTestSurfaceWithReplicaUnoccluded | 2034 class OcclusionTrackerTestSurfaceWithReplicaUnoccluded |
| 2035 : public OcclusionTrackerTest<Types> { | 2035 : public OcclusionTrackerTest<Types> { |
| 2036 protected: | 2036 protected: |
| 2037 explicit OcclusionTrackerTestSurfaceWithReplicaUnoccluded(bool opaque_layers) | 2037 explicit OcclusionTrackerTestSurfaceWithReplicaUnoccluded(bool opaque_layers) |
| 2038 : OcclusionTrackerTest<Types>(opaque_layers) {} | 2038 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 2039 void RunMyTest() { | 2039 void RunMyTest() override { |
| 2040 typename Types::ContentLayerType* parent = this->CreateRoot( | 2040 typename Types::ContentLayerType* parent = this->CreateRoot( |
| 2041 this->identity_matrix, gfx::PointF(), gfx::Size(100, 200)); | 2041 this->identity_matrix, gfx::PointF(), gfx::Size(100, 200)); |
| 2042 typename Types::LayerType* surface = | 2042 typename Types::LayerType* surface = |
| 2043 this->CreateDrawingSurface(parent, | 2043 this->CreateDrawingSurface(parent, |
| 2044 this->identity_matrix, | 2044 this->identity_matrix, |
| 2045 gfx::PointF(), | 2045 gfx::PointF(), |
| 2046 gfx::Size(100, 100), | 2046 gfx::Size(100, 100), |
| 2047 true); | 2047 true); |
| 2048 this->CreateReplicaLayer(surface, | 2048 this->CreateReplicaLayer(surface, |
| 2049 this->identity_matrix, | 2049 this->identity_matrix, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2089 }; | 2089 }; |
| 2090 | 2090 |
| 2091 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestSurfaceWithReplicaUnoccluded); | 2091 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestSurfaceWithReplicaUnoccluded); |
| 2092 | 2092 |
| 2093 template <class Types> | 2093 template <class Types> |
| 2094 class OcclusionTrackerTestSurfaceChildOfSurface | 2094 class OcclusionTrackerTestSurfaceChildOfSurface |
| 2095 : public OcclusionTrackerTest<Types> { | 2095 : public OcclusionTrackerTest<Types> { |
| 2096 protected: | 2096 protected: |
| 2097 explicit OcclusionTrackerTestSurfaceChildOfSurface(bool opaque_layers) | 2097 explicit OcclusionTrackerTestSurfaceChildOfSurface(bool opaque_layers) |
| 2098 : OcclusionTrackerTest<Types>(opaque_layers) {} | 2098 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 2099 void RunMyTest() { | 2099 void RunMyTest() override { |
| 2100 // This test verifies that the surface cliprect does not end up empty and | 2100 // This test verifies that the surface cliprect does not end up empty and |
| 2101 // clip away the entire unoccluded rect. | 2101 // clip away the entire unoccluded rect. |
| 2102 | 2102 |
| 2103 typename Types::ContentLayerType* parent = this->CreateRoot( | 2103 typename Types::ContentLayerType* parent = this->CreateRoot( |
| 2104 this->identity_matrix, gfx::PointF(), gfx::Size(100, 200)); | 2104 this->identity_matrix, gfx::PointF(), gfx::Size(100, 200)); |
| 2105 typename Types::LayerType* surface = | 2105 typename Types::LayerType* surface = |
| 2106 this->CreateDrawingSurface(parent, | 2106 this->CreateDrawingSurface(parent, |
| 2107 this->identity_matrix, | 2107 this->identity_matrix, |
| 2108 gfx::PointF(), | 2108 gfx::PointF(), |
| 2109 gfx::Size(100, 100), | 2109 gfx::Size(100, 100), |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2187 | 2187 |
| 2188 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestSurfaceChildOfSurface); | 2188 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestSurfaceChildOfSurface); |
| 2189 | 2189 |
| 2190 template <class Types> | 2190 template <class Types> |
| 2191 class OcclusionTrackerTestDontOccludePixelsNeededForBackgroundFilter | 2191 class OcclusionTrackerTestDontOccludePixelsNeededForBackgroundFilter |
| 2192 : public OcclusionTrackerTest<Types> { | 2192 : public OcclusionTrackerTest<Types> { |
| 2193 protected: | 2193 protected: |
| 2194 explicit OcclusionTrackerTestDontOccludePixelsNeededForBackgroundFilter( | 2194 explicit OcclusionTrackerTestDontOccludePixelsNeededForBackgroundFilter( |
| 2195 bool opaque_layers) | 2195 bool opaque_layers) |
| 2196 : OcclusionTrackerTest<Types>(opaque_layers) {} | 2196 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 2197 void RunMyTest() { | 2197 void RunMyTest() override { |
| 2198 gfx::Transform scale_by_half; | 2198 gfx::Transform scale_by_half; |
| 2199 scale_by_half.Scale(0.5, 0.5); | 2199 scale_by_half.Scale(0.5, 0.5); |
| 2200 | 2200 |
| 2201 FilterOperations filters; | 2201 FilterOperations filters; |
| 2202 filters.Append(FilterOperation::CreateBlurFilter(10.f)); | 2202 filters.Append(FilterOperation::CreateBlurFilter(10.f)); |
| 2203 | 2203 |
| 2204 // Save the distance of influence for the blur effect. | 2204 // Save the distance of influence for the blur effect. |
| 2205 int outset_top, outset_right, outset_bottom, outset_left; | 2205 int outset_top, outset_right, outset_bottom, outset_left; |
| 2206 filters.GetOutsets( | 2206 filters.GetOutsets( |
| 2207 &outset_top, &outset_right, &outset_bottom, &outset_left); | 2207 &outset_top, &outset_right, &outset_bottom, &outset_left); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2311 ALL_OCCLUSIONTRACKER_TEST( | 2311 ALL_OCCLUSIONTRACKER_TEST( |
| 2312 OcclusionTrackerTestDontOccludePixelsNeededForBackgroundFilter); | 2312 OcclusionTrackerTestDontOccludePixelsNeededForBackgroundFilter); |
| 2313 | 2313 |
| 2314 template <class Types> | 2314 template <class Types> |
| 2315 class OcclusionTrackerTestTwoBackgroundFiltersReduceOcclusionTwice | 2315 class OcclusionTrackerTestTwoBackgroundFiltersReduceOcclusionTwice |
| 2316 : public OcclusionTrackerTest<Types> { | 2316 : public OcclusionTrackerTest<Types> { |
| 2317 protected: | 2317 protected: |
| 2318 explicit OcclusionTrackerTestTwoBackgroundFiltersReduceOcclusionTwice( | 2318 explicit OcclusionTrackerTestTwoBackgroundFiltersReduceOcclusionTwice( |
| 2319 bool opaque_layers) | 2319 bool opaque_layers) |
| 2320 : OcclusionTrackerTest<Types>(opaque_layers) {} | 2320 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 2321 void RunMyTest() { | 2321 void RunMyTest() override { |
| 2322 gfx::Transform scale_by_half; | 2322 gfx::Transform scale_by_half; |
| 2323 scale_by_half.Scale(0.5, 0.5); | 2323 scale_by_half.Scale(0.5, 0.5); |
| 2324 | 2324 |
| 2325 // Makes two surfaces that completely cover |parent|. The occlusion both | 2325 // Makes two surfaces that completely cover |parent|. The occlusion both |
| 2326 // above and below the filters will be reduced by each of them. | 2326 // above and below the filters will be reduced by each of them. |
| 2327 typename Types::ContentLayerType* root = this->CreateRoot( | 2327 typename Types::ContentLayerType* root = this->CreateRoot( |
| 2328 this->identity_matrix, gfx::PointF(), gfx::Size(75, 75)); | 2328 this->identity_matrix, gfx::PointF(), gfx::Size(75, 75)); |
| 2329 typename Types::LayerType* parent = this->CreateSurface( | 2329 typename Types::LayerType* parent = this->CreateSurface( |
| 2330 root, scale_by_half, gfx::PointF(), gfx::Size(150, 150)); | 2330 root, scale_by_half, gfx::PointF(), gfx::Size(150, 150)); |
| 2331 parent->SetMasksToBounds(true); | 2331 parent->SetMasksToBounds(true); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2386 ALL_OCCLUSIONTRACKER_TEST( | 2386 ALL_OCCLUSIONTRACKER_TEST( |
| 2387 OcclusionTrackerTestTwoBackgroundFiltersReduceOcclusionTwice); | 2387 OcclusionTrackerTestTwoBackgroundFiltersReduceOcclusionTwice); |
| 2388 | 2388 |
| 2389 template <class Types> | 2389 template <class Types> |
| 2390 class OcclusionTrackerTestDontReduceOcclusionBelowBackgroundFilter | 2390 class OcclusionTrackerTestDontReduceOcclusionBelowBackgroundFilter |
| 2391 : public OcclusionTrackerTest<Types> { | 2391 : public OcclusionTrackerTest<Types> { |
| 2392 protected: | 2392 protected: |
| 2393 explicit OcclusionTrackerTestDontReduceOcclusionBelowBackgroundFilter( | 2393 explicit OcclusionTrackerTestDontReduceOcclusionBelowBackgroundFilter( |
| 2394 bool opaque_layers) | 2394 bool opaque_layers) |
| 2395 : OcclusionTrackerTest<Types>(opaque_layers) {} | 2395 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 2396 void RunMyTest() { | 2396 void RunMyTest() override { |
| 2397 gfx::Transform scale_by_half; | 2397 gfx::Transform scale_by_half; |
| 2398 scale_by_half.Scale(0.5, 0.5); | 2398 scale_by_half.Scale(0.5, 0.5); |
| 2399 | 2399 |
| 2400 // Make a surface and its replica, each 50x50, with a smaller 30x30 layer | 2400 // Make a surface and its replica, each 50x50, with a smaller 30x30 layer |
| 2401 // centered below each. The surface is scaled to test that the pixel moving | 2401 // centered below each. The surface is scaled to test that the pixel moving |
| 2402 // is done in the target space, where the background filter is applied, but | 2402 // is done in the target space, where the background filter is applied, but |
| 2403 // the surface appears at 50, 50 and the replica at 200, 50. | 2403 // the surface appears at 50, 50 and the replica at 200, 50. |
| 2404 typename Types::ContentLayerType* parent = this->CreateRoot( | 2404 typename Types::ContentLayerType* parent = this->CreateRoot( |
| 2405 this->identity_matrix, gfx::PointF(), gfx::Size(300, 150)); | 2405 this->identity_matrix, gfx::PointF(), gfx::Size(300, 150)); |
| 2406 typename Types::LayerType* behind_surface_layer = | 2406 typename Types::LayerType* behind_surface_layer = |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2470 ALL_OCCLUSIONTRACKER_TEST( | 2470 ALL_OCCLUSIONTRACKER_TEST( |
| 2471 OcclusionTrackerTestDontReduceOcclusionBelowBackgroundFilter); | 2471 OcclusionTrackerTestDontReduceOcclusionBelowBackgroundFilter); |
| 2472 | 2472 |
| 2473 template <class Types> | 2473 template <class Types> |
| 2474 class OcclusionTrackerTestDontReduceOcclusionIfBackgroundFilterIsOccluded | 2474 class OcclusionTrackerTestDontReduceOcclusionIfBackgroundFilterIsOccluded |
| 2475 : public OcclusionTrackerTest<Types> { | 2475 : public OcclusionTrackerTest<Types> { |
| 2476 protected: | 2476 protected: |
| 2477 explicit OcclusionTrackerTestDontReduceOcclusionIfBackgroundFilterIsOccluded( | 2477 explicit OcclusionTrackerTestDontReduceOcclusionIfBackgroundFilterIsOccluded( |
| 2478 bool opaque_layers) | 2478 bool opaque_layers) |
| 2479 : OcclusionTrackerTest<Types>(opaque_layers) {} | 2479 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 2480 void RunMyTest() { | 2480 void RunMyTest() override { |
| 2481 gfx::Transform scale_by_half; | 2481 gfx::Transform scale_by_half; |
| 2482 scale_by_half.Scale(0.5, 0.5); | 2482 scale_by_half.Scale(0.5, 0.5); |
| 2483 | 2483 |
| 2484 // Make a 50x50 filtered surface that is completely occluded by an opaque | 2484 // Make a 50x50 filtered surface that is completely occluded by an opaque |
| 2485 // layer which is above it in the z-order. The surface is | 2485 // layer which is above it in the z-order. The surface is |
| 2486 // scaled to test that the pixel moving is done in the target space, where | 2486 // scaled to test that the pixel moving is done in the target space, where |
| 2487 // the background filter is applied, but the surface appears at 50, 50. | 2487 // the background filter is applied, but the surface appears at 50, 50. |
| 2488 typename Types::ContentLayerType* parent = this->CreateRoot( | 2488 typename Types::ContentLayerType* parent = this->CreateRoot( |
| 2489 this->identity_matrix, gfx::PointF(), gfx::Size(200, 150)); | 2489 this->identity_matrix, gfx::PointF(), gfx::Size(200, 150)); |
| 2490 typename Types::LayerType* filtered_surface = | 2490 typename Types::LayerType* filtered_surface = |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2543 OcclusionTrackerTestDontReduceOcclusionIfBackgroundFilterIsOccluded); | 2543 OcclusionTrackerTestDontReduceOcclusionIfBackgroundFilterIsOccluded); |
| 2544 | 2544 |
| 2545 template <class Types> | 2545 template <class Types> |
| 2546 class OcclusionTrackerTestReduceOcclusionWhenBackgroundFilterIsPartiallyOccluded | 2546 class OcclusionTrackerTestReduceOcclusionWhenBackgroundFilterIsPartiallyOccluded |
| 2547 : public OcclusionTrackerTest<Types> { | 2547 : public OcclusionTrackerTest<Types> { |
| 2548 protected: | 2548 protected: |
| 2549 explicit | 2549 explicit |
| 2550 OcclusionTrackerTestReduceOcclusionWhenBackgroundFilterIsPartiallyOccluded( | 2550 OcclusionTrackerTestReduceOcclusionWhenBackgroundFilterIsPartiallyOccluded( |
| 2551 bool opaque_layers) | 2551 bool opaque_layers) |
| 2552 : OcclusionTrackerTest<Types>(opaque_layers) {} | 2552 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 2553 void RunMyTest() { | 2553 void RunMyTest() override { |
| 2554 gfx::Transform scale_by_half; | 2554 gfx::Transform scale_by_half; |
| 2555 scale_by_half.Scale(0.5, 0.5); | 2555 scale_by_half.Scale(0.5, 0.5); |
| 2556 | 2556 |
| 2557 // Make a surface and its replica, each 50x50, that are partially occluded | 2557 // Make a surface and its replica, each 50x50, that are partially occluded |
| 2558 // by opaque layers which are above them in the z-order. The surface is | 2558 // by opaque layers which are above them in the z-order. The surface is |
| 2559 // scaled to test that the pixel moving is done in the target space, where | 2559 // scaled to test that the pixel moving is done in the target space, where |
| 2560 // the background filter is applied, but the surface appears at 50, 50 and | 2560 // the background filter is applied, but the surface appears at 50, 50 and |
| 2561 // the replica at 200, 50. | 2561 // the replica at 200, 50. |
| 2562 typename Types::ContentLayerType* parent = this->CreateRoot( | 2562 typename Types::ContentLayerType* parent = this->CreateRoot( |
| 2563 this->identity_matrix, gfx::PointF(), gfx::Size(300, 150)); | 2563 this->identity_matrix, gfx::PointF(), gfx::Size(300, 150)); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2655 | 2655 |
| 2656 ALL_OCCLUSIONTRACKER_TEST( | 2656 ALL_OCCLUSIONTRACKER_TEST( |
| 2657 OcclusionTrackerTestReduceOcclusionWhenBackgroundFilterIsPartiallyOccluded); | 2657 OcclusionTrackerTestReduceOcclusionWhenBackgroundFilterIsPartiallyOccluded); |
| 2658 | 2658 |
| 2659 template <class Types> | 2659 template <class Types> |
| 2660 class OcclusionTrackerTestMinimumTrackingSize | 2660 class OcclusionTrackerTestMinimumTrackingSize |
| 2661 : public OcclusionTrackerTest<Types> { | 2661 : public OcclusionTrackerTest<Types> { |
| 2662 protected: | 2662 protected: |
| 2663 explicit OcclusionTrackerTestMinimumTrackingSize(bool opaque_layers) | 2663 explicit OcclusionTrackerTestMinimumTrackingSize(bool opaque_layers) |
| 2664 : OcclusionTrackerTest<Types>(opaque_layers) {} | 2664 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 2665 void RunMyTest() { | 2665 void RunMyTest() override { |
| 2666 gfx::Size tracking_size(100, 100); | 2666 gfx::Size tracking_size(100, 100); |
| 2667 gfx::Size below_tracking_size(99, 99); | 2667 gfx::Size below_tracking_size(99, 99); |
| 2668 | 2668 |
| 2669 typename Types::ContentLayerType* parent = this->CreateRoot( | 2669 typename Types::ContentLayerType* parent = this->CreateRoot( |
| 2670 this->identity_matrix, gfx::PointF(), gfx::Size(400, 400)); | 2670 this->identity_matrix, gfx::PointF(), gfx::Size(400, 400)); |
| 2671 typename Types::LayerType* large = this->CreateDrawingLayer( | 2671 typename Types::LayerType* large = this->CreateDrawingLayer( |
| 2672 parent, this->identity_matrix, gfx::PointF(), tracking_size, true); | 2672 parent, this->identity_matrix, gfx::PointF(), tracking_size, true); |
| 2673 typename Types::LayerType* small = | 2673 typename Types::LayerType* small = |
| 2674 this->CreateDrawingLayer(parent, | 2674 this->CreateDrawingLayer(parent, |
| 2675 this->identity_matrix, | 2675 this->identity_matrix, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 2701 }; | 2701 }; |
| 2702 | 2702 |
| 2703 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestMinimumTrackingSize); | 2703 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestMinimumTrackingSize); |
| 2704 | 2704 |
| 2705 template <class Types> | 2705 template <class Types> |
| 2706 class OcclusionTrackerTestScaledLayerIsClipped | 2706 class OcclusionTrackerTestScaledLayerIsClipped |
| 2707 : public OcclusionTrackerTest<Types> { | 2707 : public OcclusionTrackerTest<Types> { |
| 2708 protected: | 2708 protected: |
| 2709 explicit OcclusionTrackerTestScaledLayerIsClipped(bool opaque_layers) | 2709 explicit OcclusionTrackerTestScaledLayerIsClipped(bool opaque_layers) |
| 2710 : OcclusionTrackerTest<Types>(opaque_layers) {} | 2710 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 2711 void RunMyTest() { | 2711 void RunMyTest() override { |
| 2712 gfx::Transform scale_transform; | 2712 gfx::Transform scale_transform; |
| 2713 scale_transform.Scale(512.0, 512.0); | 2713 scale_transform.Scale(512.0, 512.0); |
| 2714 | 2714 |
| 2715 typename Types::ContentLayerType* parent = this->CreateRoot( | 2715 typename Types::ContentLayerType* parent = this->CreateRoot( |
| 2716 this->identity_matrix, gfx::PointF(), gfx::Size(400, 400)); | 2716 this->identity_matrix, gfx::PointF(), gfx::Size(400, 400)); |
| 2717 typename Types::LayerType* clip = this->CreateLayer(parent, | 2717 typename Types::LayerType* clip = this->CreateLayer(parent, |
| 2718 this->identity_matrix, | 2718 this->identity_matrix, |
| 2719 gfx::PointF(10.f, 10.f), | 2719 gfx::PointF(10.f, 10.f), |
| 2720 gfx::Size(50, 50)); | 2720 gfx::Size(50, 50)); |
| 2721 clip->SetMasksToBounds(true); | 2721 clip->SetMasksToBounds(true); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 2738 }; | 2738 }; |
| 2739 | 2739 |
| 2740 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestScaledLayerIsClipped) | 2740 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestScaledLayerIsClipped) |
| 2741 | 2741 |
| 2742 template <class Types> | 2742 template <class Types> |
| 2743 class OcclusionTrackerTestScaledLayerInSurfaceIsClipped | 2743 class OcclusionTrackerTestScaledLayerInSurfaceIsClipped |
| 2744 : public OcclusionTrackerTest<Types> { | 2744 : public OcclusionTrackerTest<Types> { |
| 2745 protected: | 2745 protected: |
| 2746 explicit OcclusionTrackerTestScaledLayerInSurfaceIsClipped(bool opaque_layers) | 2746 explicit OcclusionTrackerTestScaledLayerInSurfaceIsClipped(bool opaque_layers) |
| 2747 : OcclusionTrackerTest<Types>(opaque_layers) {} | 2747 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 2748 void RunMyTest() { | 2748 void RunMyTest() override { |
| 2749 gfx::Transform scale_transform; | 2749 gfx::Transform scale_transform; |
| 2750 scale_transform.Scale(512.0, 512.0); | 2750 scale_transform.Scale(512.0, 512.0); |
| 2751 | 2751 |
| 2752 typename Types::ContentLayerType* parent = this->CreateRoot( | 2752 typename Types::ContentLayerType* parent = this->CreateRoot( |
| 2753 this->identity_matrix, gfx::PointF(), gfx::Size(400, 400)); | 2753 this->identity_matrix, gfx::PointF(), gfx::Size(400, 400)); |
| 2754 typename Types::LayerType* clip = this->CreateLayer(parent, | 2754 typename Types::LayerType* clip = this->CreateLayer(parent, |
| 2755 this->identity_matrix, | 2755 this->identity_matrix, |
| 2756 gfx::PointF(10.f, 10.f), | 2756 gfx::PointF(10.f, 10.f), |
| 2757 gfx::Size(50, 50)); | 2757 gfx::Size(50, 50)); |
| 2758 clip->SetMasksToBounds(true); | 2758 clip->SetMasksToBounds(true); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 2779 }; | 2779 }; |
| 2780 | 2780 |
| 2781 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestScaledLayerInSurfaceIsClipped) | 2781 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestScaledLayerInSurfaceIsClipped) |
| 2782 | 2782 |
| 2783 template <class Types> | 2783 template <class Types> |
| 2784 class OcclusionTrackerTestCopyRequestDoesOcclude | 2784 class OcclusionTrackerTestCopyRequestDoesOcclude |
| 2785 : public OcclusionTrackerTest<Types> { | 2785 : public OcclusionTrackerTest<Types> { |
| 2786 protected: | 2786 protected: |
| 2787 explicit OcclusionTrackerTestCopyRequestDoesOcclude(bool opaque_layers) | 2787 explicit OcclusionTrackerTestCopyRequestDoesOcclude(bool opaque_layers) |
| 2788 : OcclusionTrackerTest<Types>(opaque_layers) {} | 2788 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 2789 void RunMyTest() { | 2789 void RunMyTest() override { |
| 2790 typename Types::ContentLayerType* root = this->CreateRoot( | 2790 typename Types::ContentLayerType* root = this->CreateRoot( |
| 2791 this->identity_matrix, gfx::Point(), gfx::Size(400, 400)); | 2791 this->identity_matrix, gfx::Point(), gfx::Size(400, 400)); |
| 2792 typename Types::ContentLayerType* parent = this->CreateDrawingLayer( | 2792 typename Types::ContentLayerType* parent = this->CreateDrawingLayer( |
| 2793 root, this->identity_matrix, gfx::Point(), gfx::Size(400, 400), true); | 2793 root, this->identity_matrix, gfx::Point(), gfx::Size(400, 400), true); |
| 2794 typename Types::LayerType* copy = this->CreateLayer(parent, | 2794 typename Types::LayerType* copy = this->CreateLayer(parent, |
| 2795 this->identity_matrix, | 2795 this->identity_matrix, |
| 2796 gfx::Point(100, 0), | 2796 gfx::Point(100, 0), |
| 2797 gfx::Size(200, 400)); | 2797 gfx::Size(200, 400)); |
| 2798 this->AddCopyRequest(copy); | 2798 this->AddCopyRequest(copy); |
| 2799 typename Types::LayerType* copy_child = this->CreateDrawingLayer( | 2799 typename Types::LayerType* copy_child = this->CreateDrawingLayer( |
| (...skipping 26 matching lines...) Expand all Loading... |
| 2826 | 2826 |
| 2827 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestCopyRequestDoesOcclude) | 2827 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestCopyRequestDoesOcclude) |
| 2828 | 2828 |
| 2829 template <class Types> | 2829 template <class Types> |
| 2830 class OcclusionTrackerTestHiddenCopyRequestDoesNotOcclude | 2830 class OcclusionTrackerTestHiddenCopyRequestDoesNotOcclude |
| 2831 : public OcclusionTrackerTest<Types> { | 2831 : public OcclusionTrackerTest<Types> { |
| 2832 protected: | 2832 protected: |
| 2833 explicit OcclusionTrackerTestHiddenCopyRequestDoesNotOcclude( | 2833 explicit OcclusionTrackerTestHiddenCopyRequestDoesNotOcclude( |
| 2834 bool opaque_layers) | 2834 bool opaque_layers) |
| 2835 : OcclusionTrackerTest<Types>(opaque_layers) {} | 2835 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 2836 void RunMyTest() { | 2836 void RunMyTest() override { |
| 2837 typename Types::ContentLayerType* root = this->CreateRoot( | 2837 typename Types::ContentLayerType* root = this->CreateRoot( |
| 2838 this->identity_matrix, gfx::Point(), gfx::Size(400, 400)); | 2838 this->identity_matrix, gfx::Point(), gfx::Size(400, 400)); |
| 2839 typename Types::ContentLayerType* parent = this->CreateDrawingLayer( | 2839 typename Types::ContentLayerType* parent = this->CreateDrawingLayer( |
| 2840 root, this->identity_matrix, gfx::Point(), gfx::Size(400, 400), true); | 2840 root, this->identity_matrix, gfx::Point(), gfx::Size(400, 400), true); |
| 2841 typename Types::LayerType* hide = this->CreateLayer( | 2841 typename Types::LayerType* hide = this->CreateLayer( |
| 2842 parent, this->identity_matrix, gfx::Point(), gfx::Size()); | 2842 parent, this->identity_matrix, gfx::Point(), gfx::Size()); |
| 2843 typename Types::LayerType* copy = this->CreateLayer( | 2843 typename Types::LayerType* copy = this->CreateLayer( |
| 2844 hide, this->identity_matrix, gfx::Point(100, 0), gfx::Size(200, 400)); | 2844 hide, this->identity_matrix, gfx::Point(100, 0), gfx::Size(200, 400)); |
| 2845 this->AddCopyRequest(copy); | 2845 this->AddCopyRequest(copy); |
| 2846 typename Types::LayerType* copy_child = this->CreateDrawingLayer( | 2846 typename Types::LayerType* copy_child = this->CreateDrawingLayer( |
| (...skipping 25 matching lines...) Expand all Loading... |
| 2872 } | 2872 } |
| 2873 }; | 2873 }; |
| 2874 | 2874 |
| 2875 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestHiddenCopyRequestDoesNotOcclude) | 2875 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestHiddenCopyRequestDoesNotOcclude) |
| 2876 | 2876 |
| 2877 template <class Types> | 2877 template <class Types> |
| 2878 class OcclusionTrackerTestOccludedLayer : public OcclusionTrackerTest<Types> { | 2878 class OcclusionTrackerTestOccludedLayer : public OcclusionTrackerTest<Types> { |
| 2879 protected: | 2879 protected: |
| 2880 explicit OcclusionTrackerTestOccludedLayer(bool opaque_layers) | 2880 explicit OcclusionTrackerTestOccludedLayer(bool opaque_layers) |
| 2881 : OcclusionTrackerTest<Types>(opaque_layers) {} | 2881 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 2882 void RunMyTest() { | 2882 void RunMyTest() override { |
| 2883 gfx::Transform translate; | 2883 gfx::Transform translate; |
| 2884 translate.Translate(10.0, 20.0); | 2884 translate.Translate(10.0, 20.0); |
| 2885 typename Types::ContentLayerType* root = this->CreateRoot( | 2885 typename Types::ContentLayerType* root = this->CreateRoot( |
| 2886 this->identity_matrix, gfx::Point(), gfx::Size(200, 200)); | 2886 this->identity_matrix, gfx::Point(), gfx::Size(200, 200)); |
| 2887 typename Types::LayerType* surface = this->CreateSurface( | 2887 typename Types::LayerType* surface = this->CreateSurface( |
| 2888 root, this->identity_matrix, gfx::Point(), gfx::Size(200, 200)); | 2888 root, this->identity_matrix, gfx::Point(), gfx::Size(200, 200)); |
| 2889 typename Types::LayerType* layer = this->CreateDrawingLayer( | 2889 typename Types::LayerType* layer = this->CreateDrawingLayer( |
| 2890 surface, translate, gfx::Point(), gfx::Size(200, 200), false); | 2890 surface, translate, gfx::Point(), gfx::Size(200, 200), false); |
| 2891 typename Types::ContentLayerType* outside_layer = this->CreateDrawingLayer( | 2891 typename Types::ContentLayerType* outside_layer = this->CreateDrawingLayer( |
| 2892 root, this->identity_matrix, gfx::Point(), gfx::Size(200, 200), false); | 2892 root, this->identity_matrix, gfx::Point(), gfx::Size(200, 200), false); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2963 }; | 2963 }; |
| 2964 | 2964 |
| 2965 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestOccludedLayer) | 2965 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestOccludedLayer) |
| 2966 | 2966 |
| 2967 template <class Types> | 2967 template <class Types> |
| 2968 class OcclusionTrackerTestUnoccludedLayerQuery | 2968 class OcclusionTrackerTestUnoccludedLayerQuery |
| 2969 : public OcclusionTrackerTest<Types> { | 2969 : public OcclusionTrackerTest<Types> { |
| 2970 protected: | 2970 protected: |
| 2971 explicit OcclusionTrackerTestUnoccludedLayerQuery(bool opaque_layers) | 2971 explicit OcclusionTrackerTestUnoccludedLayerQuery(bool opaque_layers) |
| 2972 : OcclusionTrackerTest<Types>(opaque_layers) {} | 2972 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 2973 void RunMyTest() { | 2973 void RunMyTest() override { |
| 2974 gfx::Transform translate; | 2974 gfx::Transform translate; |
| 2975 translate.Translate(10.0, 20.0); | 2975 translate.Translate(10.0, 20.0); |
| 2976 typename Types::ContentLayerType* root = this->CreateRoot( | 2976 typename Types::ContentLayerType* root = this->CreateRoot( |
| 2977 this->identity_matrix, gfx::Point(), gfx::Size(200, 200)); | 2977 this->identity_matrix, gfx::Point(), gfx::Size(200, 200)); |
| 2978 typename Types::LayerType* surface = this->CreateSurface( | 2978 typename Types::LayerType* surface = this->CreateSurface( |
| 2979 root, this->identity_matrix, gfx::Point(), gfx::Size(200, 200)); | 2979 root, this->identity_matrix, gfx::Point(), gfx::Size(200, 200)); |
| 2980 typename Types::LayerType* layer = this->CreateDrawingLayer( | 2980 typename Types::LayerType* layer = this->CreateDrawingLayer( |
| 2981 surface, translate, gfx::Point(), gfx::Size(200, 200), false); | 2981 surface, translate, gfx::Point(), gfx::Size(200, 200), false); |
| 2982 typename Types::ContentLayerType* outside_layer = this->CreateDrawingLayer( | 2982 typename Types::ContentLayerType* outside_layer = this->CreateDrawingLayer( |
| 2983 root, this->identity_matrix, gfx::Point(), gfx::Size(200, 200), false); | 2983 root, this->identity_matrix, gfx::Point(), gfx::Size(200, 200), false); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3129 }; | 3129 }; |
| 3130 | 3130 |
| 3131 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedLayerQuery) | 3131 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedLayerQuery) |
| 3132 | 3132 |
| 3133 template <class Types> | 3133 template <class Types> |
| 3134 class OcclusionTrackerTestUnoccludedSurfaceQuery | 3134 class OcclusionTrackerTestUnoccludedSurfaceQuery |
| 3135 : public OcclusionTrackerTest<Types> { | 3135 : public OcclusionTrackerTest<Types> { |
| 3136 protected: | 3136 protected: |
| 3137 explicit OcclusionTrackerTestUnoccludedSurfaceQuery(bool opaque_layers) | 3137 explicit OcclusionTrackerTestUnoccludedSurfaceQuery(bool opaque_layers) |
| 3138 : OcclusionTrackerTest<Types>(opaque_layers) {} | 3138 : OcclusionTrackerTest<Types>(opaque_layers) {} |
| 3139 void RunMyTest() { | 3139 void RunMyTest() override { |
| 3140 gfx::Transform translate; | 3140 gfx::Transform translate; |
| 3141 translate.Translate(10.0, 20.0); | 3141 translate.Translate(10.0, 20.0); |
| 3142 typename Types::ContentLayerType* root = this->CreateRoot( | 3142 typename Types::ContentLayerType* root = this->CreateRoot( |
| 3143 this->identity_matrix, gfx::Point(), gfx::Size(200, 200)); | 3143 this->identity_matrix, gfx::Point(), gfx::Size(200, 200)); |
| 3144 typename Types::LayerType* surface = | 3144 typename Types::LayerType* surface = |
| 3145 this->CreateSurface(root, translate, gfx::Point(), gfx::Size(200, 200)); | 3145 this->CreateSurface(root, translate, gfx::Point(), gfx::Size(200, 200)); |
| 3146 typename Types::LayerType* layer = | 3146 typename Types::LayerType* layer = |
| 3147 this->CreateDrawingLayer(surface, | 3147 this->CreateDrawingLayer(surface, |
| 3148 this->identity_matrix, | 3148 this->identity_matrix, |
| 3149 gfx::Point(), | 3149 gfx::Point(), |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3301 EXPECT_EQ(gfx::Rect(), | 3301 EXPECT_EQ(gfx::Rect(), |
| 3302 occlusion.UnoccludedSurfaceContentRect( | 3302 occlusion.UnoccludedSurfaceContentRect( |
| 3303 surface, gfx::Rect(80, 70, 50, 50))); | 3303 surface, gfx::Rect(80, 70, 50, 50))); |
| 3304 } | 3304 } |
| 3305 }; | 3305 }; |
| 3306 | 3306 |
| 3307 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) | 3307 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) |
| 3308 | 3308 |
| 3309 } // namespace | 3309 } // namespace |
| 3310 } // namespace cc | 3310 } // namespace cc |
| OLD | NEW |