OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 | 478 |
479 private: | 479 private: |
480 int m_numCommits; | 480 int m_numCommits; |
481 }; | 481 }; |
482 | 482 |
483 TEST_F(CCLayerTreeHostTestCompositeAndReadbackWhileInvisible, runMultiThread) | 483 TEST_F(CCLayerTreeHostTestCompositeAndReadbackWhileInvisible, runMultiThread) |
484 { | 484 { |
485 runTestThreaded(); | 485 runTestThreaded(); |
486 } | 486 } |
487 | 487 |
| 488 class CCLayerTreeHostTestAbortFrameWhenInvisible : public CCLayerTreeHostTestThr
eadOnly { |
| 489 public: |
| 490 CCLayerTreeHostTestAbortFrameWhenInvisible() |
| 491 { |
| 492 } |
| 493 |
| 494 virtual void beginTest() |
| 495 { |
| 496 // Request a commit (from the main thread), which will trigger the commi
t flow from the impl side. |
| 497 m_layerTreeHost->setNeedsCommit(); |
| 498 // Then mark ourselves as not visible before processing any more message
s on the main thread. |
| 499 m_layerTreeHost->setVisible(false); |
| 500 // If we make it without kicking a frame, we pass! |
| 501 endTestAfterDelay(1); |
| 502 } |
| 503 |
| 504 virtual void layout() OVERRIDE |
| 505 { |
| 506 ASSERT_FALSE(true); |
| 507 endTest(); |
| 508 } |
| 509 |
| 510 virtual void afterTest() |
| 511 { |
| 512 } |
| 513 |
| 514 private: |
| 515 }; |
| 516 |
| 517 TEST_F(CCLayerTreeHostTestAbortFrameWhenInvisible, runMultiThread) |
| 518 { |
| 519 runTestThreaded(); |
| 520 } |
| 521 |
488 | 522 |
489 // Trigger a frame with setNeedsCommit. Then, inside the resulting animate | 523 // Trigger a frame with setNeedsCommit. Then, inside the resulting animate |
490 // callback, requet another frame using setNeedsAnimate. End the test when | 524 // callback, requet another frame using setNeedsAnimate. End the test when |
491 // animate gets called yet-again, indicating that the proxy is correctly | 525 // animate gets called yet-again, indicating that the proxy is correctly |
492 // handling the case where setNeedsAnimate() is called inside the begin frame | 526 // handling the case where setNeedsAnimate() is called inside the begin frame |
493 // flow. | 527 // flow. |
494 class CCLayerTreeHostTestSetNeedsAnimateInsideAnimationCallback : public CCLayer
TreeHostTestThreadOnly { | 528 class CCLayerTreeHostTestSetNeedsAnimateInsideAnimationCallback : public CCLayer
TreeHostTestThreadOnly { |
495 public: | 529 public: |
496 CCLayerTreeHostTestSetNeedsAnimateInsideAnimationCallback() | 530 CCLayerTreeHostTestSetNeedsAnimateInsideAnimationCallback() |
497 : m_numAnimates(0) | 531 : m_numAnimates(0) |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 } | 979 } |
946 | 980 |
947 virtual void afterTest() { } | 981 virtual void afterTest() { } |
948 }; | 982 }; |
949 | 983 |
950 TEST_F(CCLayerTreeHostTestCommit, runTest) | 984 TEST_F(CCLayerTreeHostTestCommit, runTest) |
951 { | 985 { |
952 runTest(true); | 986 runTest(true); |
953 } | 987 } |
954 | 988 |
955 class CCLayerTreeHostTestVisibilityAndAllocationControlDrawing : public CCLayerT
reeHostTest { | |
956 public: | |
957 | |
958 CCLayerTreeHostTestVisibilityAndAllocationControlDrawing() { } | |
959 | |
960 virtual void beginTest() | |
961 { | |
962 postSetNeedsCommitToMainThread(); | |
963 } | |
964 | |
965 virtual void didCommitAndDrawFrame() | |
966 { | |
967 int lastFrame = m_layerTreeHost->frameNumber() - 1; | |
968 | |
969 // These frames should draw. | |
970 switch (lastFrame) { | |
971 case 0: | |
972 // Set the tree invisible, this should not draw. | |
973 m_layerTreeHost->setVisible(false); | |
974 break; | |
975 case 2: | |
976 // Set the tree invisible and give a non-visible allocation, this | |
977 // should not draw. | |
978 m_layerTreeHost->setVisible(false); | |
979 m_layerTreeHost->setContentsMemoryAllocationLimitBytes(0); | |
980 break; | |
981 case 5: | |
982 // Give a memory allocation not for display, but while we are | |
983 // visible. This should not be used and we should remain | |
984 // ready for display and it should draw. | |
985 m_layerTreeHost->setContentsMemoryAllocationLimitBytes(0); | |
986 break; | |
987 case 6: | |
988 endTest(); | |
989 break; | |
990 | |
991 default: | |
992 ASSERT_NOT_REACHED(); | |
993 } | |
994 } | |
995 | |
996 virtual void didCommit() | |
997 { | |
998 int lastFrame = m_layerTreeHost->frameNumber() - 1; | |
999 | |
1000 // These frames should not draw. | |
1001 switch (lastFrame) { | |
1002 case 1: | |
1003 // Set the tree visible, this should draw. | |
1004 m_layerTreeHost->setVisible(true); | |
1005 break; | |
1006 case 3: | |
1007 // Set visible without giving a visible memory allocation, this | |
1008 // shouldn't make the impl side ready for display, so it should | |
1009 // not draw. | |
1010 m_layerTreeHost->setVisible(true); | |
1011 break; | |
1012 case 4: | |
1013 // Now give a memory allocation for display, this should draw. | |
1014 m_layerTreeHost->setContentsMemoryAllocationLimitBytes(1); | |
1015 break; | |
1016 } | |
1017 } | |
1018 | |
1019 virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl) | |
1020 { | |
1021 switch (impl->sourceFrameNumber()) { | |
1022 case 0: | |
1023 // The host starts out visible and able to display before we do any
commit. | |
1024 EXPECT_TRUE(impl->visible()); | |
1025 EXPECT_TRUE(impl->sourceFrameCanBeDrawn()); | |
1026 break; | |
1027 case 1: | |
1028 // We still have a memory allocation for display. | |
1029 EXPECT_FALSE(impl->visible()); | |
1030 EXPECT_TRUE(impl->sourceFrameCanBeDrawn()); | |
1031 break; | |
1032 case 2: | |
1033 EXPECT_TRUE(impl->visible()); | |
1034 EXPECT_TRUE(impl->sourceFrameCanBeDrawn()); | |
1035 break; | |
1036 case 3: | |
1037 EXPECT_FALSE(impl->visible()); | |
1038 EXPECT_FALSE(impl->sourceFrameCanBeDrawn()); | |
1039 break; | |
1040 case 4: | |
1041 EXPECT_TRUE(impl->visible()); | |
1042 EXPECT_FALSE(impl->sourceFrameCanBeDrawn()); | |
1043 break; | |
1044 case 5: | |
1045 EXPECT_TRUE(impl->visible()); | |
1046 EXPECT_TRUE(impl->sourceFrameCanBeDrawn()); | |
1047 break; | |
1048 case 6: | |
1049 EXPECT_TRUE(impl->visible()); | |
1050 EXPECT_TRUE(impl->sourceFrameCanBeDrawn()); | |
1051 break; | |
1052 } | |
1053 } | |
1054 | |
1055 virtual void afterTest() | |
1056 { | |
1057 } | |
1058 }; | |
1059 | |
1060 SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestVisibilityAndAllocationControl
Drawing) | |
1061 | |
1062 // Verifies that startPageScaleAnimation events propagate correctly from CCLayer
TreeHost to | 989 // Verifies that startPageScaleAnimation events propagate correctly from CCLayer
TreeHost to |
1063 // CCLayerTreeHostImpl in the MT compositor. | 990 // CCLayerTreeHostImpl in the MT compositor. |
1064 class CCLayerTreeHostTestStartPageScaleAnimation : public CCLayerTreeHostTest { | 991 class CCLayerTreeHostTestStartPageScaleAnimation : public CCLayerTreeHostTest { |
1065 public: | 992 public: |
1066 | 993 |
1067 CCLayerTreeHostTestStartPageScaleAnimation() | 994 CCLayerTreeHostTestStartPageScaleAnimation() |
1068 : m_animationRequested(false) | 995 : m_animationRequested(false) |
1069 { | 996 { |
1070 } | 997 } |
1071 | 998 |
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1682 | 1609 |
1683 // The child layer is rotated and the grandChild is opaque, but clipped
to the child and rootLayer | 1610 // The child layer is rotated and the grandChild is opaque, but clipped
to the child and rootLayer |
1684 setTestLayerPropertiesForTesting(rootLayer.get(), 0, identityMatrix, Flo
atPoint(0, 0), FloatPoint(0, 0), IntSize(200, 200), true); | 1611 setTestLayerPropertiesForTesting(rootLayer.get(), 0, identityMatrix, Flo
atPoint(0, 0), FloatPoint(0, 0), IntSize(200, 200), true); |
1685 setTestLayerPropertiesForTesting(child.get(), rootLayer.get(), childTran
sform, FloatPoint(0, 0), FloatPoint(30, 30), IntSize(500, 500), false); | 1612 setTestLayerPropertiesForTesting(child.get(), rootLayer.get(), childTran
sform, FloatPoint(0, 0), FloatPoint(30, 30), IntSize(500, 500), false); |
1686 setTestLayerPropertiesForTesting(grandChild.get(), child.get(), identity
Matrix, FloatPoint(0, 0), FloatPoint(10, 10), IntSize(500, 500), true); | 1613 setTestLayerPropertiesForTesting(grandChild.get(), child.get(), identity
Matrix, FloatPoint(0, 0), FloatPoint(10, 10), IntSize(500, 500), true); |
1687 | 1614 |
1688 m_layerTreeHost->setRootLayer(rootLayer); | 1615 m_layerTreeHost->setRootLayer(rootLayer); |
1689 m_layerTreeHost->setViewportSize(rootLayer->bounds()); | 1616 m_layerTreeHost->setViewportSize(rootLayer->bounds()); |
1690 ASSERT_TRUE(m_layerTreeHost->initializeLayerRendererIfNeeded()); | 1617 ASSERT_TRUE(m_layerTreeHost->initializeLayerRendererIfNeeded()); |
1691 CCTextureUpdater updater; | 1618 CCTextureUpdater updater; |
1692 m_layerTreeHost->updateLayers(updater); | 1619 m_layerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max(
)); |
1693 m_layerTreeHost->commitComplete(); | 1620 m_layerTreeHost->commitComplete(); |
1694 | 1621 |
1695 EXPECT_EQ_RECT(IntRect(), grandChild->occludedScreenSpace().bounds()); | 1622 EXPECT_EQ_RECT(IntRect(), grandChild->occludedScreenSpace().bounds()); |
1696 EXPECT_EQ(0u, grandChild->occludedScreenSpace().rects().size()); | 1623 EXPECT_EQ(0u, grandChild->occludedScreenSpace().rects().size()); |
1697 EXPECT_EQ_RECT(IntRect(30, 40, 170, 160), child->occludedScreenSpace().b
ounds()); | 1624 EXPECT_EQ_RECT(IntRect(30, 40, 170, 160), child->occludedScreenSpace().b
ounds()); |
1698 EXPECT_EQ(1u, child->occludedScreenSpace().rects().size()); | 1625 EXPECT_EQ(1u, child->occludedScreenSpace().rects().size()); |
1699 EXPECT_EQ_RECT(IntRect(30, 40, 170, 160), rootLayer->occludedScreenSpace
().bounds()); | 1626 EXPECT_EQ_RECT(IntRect(30, 40, 170, 160), rootLayer->occludedScreenSpace
().bounds()); |
1700 EXPECT_EQ(1u, rootLayer->occludedScreenSpace().rects().size()); | 1627 EXPECT_EQ(1u, rootLayer->occludedScreenSpace().rects().size()); |
1701 | 1628 |
1702 // If the child layer is opaque, then it adds to the occlusion seen by t
he rootLayer. | 1629 // If the child layer is opaque, then it adds to the occlusion seen by t
he rootLayer. |
1703 setLayerPropertiesForTesting(rootLayer.get(), 0, identityMatrix, FloatPo
int(0, 0), FloatPoint(0, 0), IntSize(200, 200), true); | 1630 setLayerPropertiesForTesting(rootLayer.get(), 0, identityMatrix, FloatPo
int(0, 0), FloatPoint(0, 0), IntSize(200, 200), true); |
1704 setLayerPropertiesForTesting(child.get(), rootLayer.get(), childTransfor
m, FloatPoint(0, 0), FloatPoint(30, 30), IntSize(500, 500), true); | 1631 setLayerPropertiesForTesting(child.get(), rootLayer.get(), childTransfor
m, FloatPoint(0, 0), FloatPoint(30, 30), IntSize(500, 500), true); |
1705 setLayerPropertiesForTesting(grandChild.get(), child.get(), identityMatr
ix, FloatPoint(0, 0), FloatPoint(10, 10), IntSize(500, 500), true); | 1632 setLayerPropertiesForTesting(grandChild.get(), child.get(), identityMatr
ix, FloatPoint(0, 0), FloatPoint(10, 10), IntSize(500, 500), true); |
1706 | 1633 |
1707 m_layerTreeHost->setRootLayer(rootLayer); | 1634 m_layerTreeHost->setRootLayer(rootLayer); |
1708 m_layerTreeHost->setViewportSize(rootLayer->bounds()); | 1635 m_layerTreeHost->setViewportSize(rootLayer->bounds()); |
1709 m_layerTreeHost->updateLayers(updater); | 1636 m_layerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max(
)); |
1710 m_layerTreeHost->commitComplete(); | 1637 m_layerTreeHost->commitComplete(); |
1711 | 1638 |
1712 EXPECT_EQ_RECT(IntRect(), grandChild->occludedScreenSpace().bounds()); | 1639 EXPECT_EQ_RECT(IntRect(), grandChild->occludedScreenSpace().bounds()); |
1713 EXPECT_EQ(0u, grandChild->occludedScreenSpace().rects().size()); | 1640 EXPECT_EQ(0u, grandChild->occludedScreenSpace().rects().size()); |
1714 EXPECT_EQ_RECT(IntRect(30, 40, 170, 160), child->occludedScreenSpace().b
ounds()); | 1641 EXPECT_EQ_RECT(IntRect(30, 40, 170, 160), child->occludedScreenSpace().b
ounds()); |
1715 EXPECT_EQ(1u, child->occludedScreenSpace().rects().size()); | 1642 EXPECT_EQ(1u, child->occludedScreenSpace().rects().size()); |
1716 EXPECT_EQ_RECT(IntRect(30, 30, 170, 170), rootLayer->occludedScreenSpace
().bounds()); | 1643 EXPECT_EQ_RECT(IntRect(30, 30, 170, 170), rootLayer->occludedScreenSpace
().bounds()); |
1717 EXPECT_EQ(1u, rootLayer->occludedScreenSpace().rects().size()); | 1644 EXPECT_EQ(1u, rootLayer->occludedScreenSpace().rects().size()); |
1718 | 1645 |
1719 // Add a second child to the root layer and the regions should merge | 1646 // Add a second child to the root layer and the regions should merge |
1720 setTestLayerPropertiesForTesting(rootLayer.get(), 0, identityMatrix, Flo
atPoint(0, 0), FloatPoint(0, 0), IntSize(200, 200), true); | 1647 setTestLayerPropertiesForTesting(rootLayer.get(), 0, identityMatrix, Flo
atPoint(0, 0), FloatPoint(0, 0), IntSize(200, 200), true); |
1721 setTestLayerPropertiesForTesting(child2.get(), rootLayer.get(), identity
Matrix, FloatPoint(0, 0), FloatPoint(70, 20), IntSize(500, 500), true); | 1648 setTestLayerPropertiesForTesting(child2.get(), rootLayer.get(), identity
Matrix, FloatPoint(0, 0), FloatPoint(70, 20), IntSize(500, 500), true); |
1722 setTestLayerPropertiesForTesting(child.get(), rootLayer.get(), childTran
sform, FloatPoint(0, 0), FloatPoint(30, 30), IntSize(500, 500), true); | 1649 setTestLayerPropertiesForTesting(child.get(), rootLayer.get(), childTran
sform, FloatPoint(0, 0), FloatPoint(30, 30), IntSize(500, 500), true); |
1723 setTestLayerPropertiesForTesting(grandChild.get(), child.get(), identity
Matrix, FloatPoint(0, 0), FloatPoint(10, 10), IntSize(500, 500), true); | 1650 setTestLayerPropertiesForTesting(grandChild.get(), child.get(), identity
Matrix, FloatPoint(0, 0), FloatPoint(10, 10), IntSize(500, 500), true); |
1724 | 1651 |
1725 m_layerTreeHost->setRootLayer(rootLayer); | 1652 m_layerTreeHost->setRootLayer(rootLayer); |
1726 m_layerTreeHost->setViewportSize(rootLayer->bounds()); | 1653 m_layerTreeHost->setViewportSize(rootLayer->bounds()); |
1727 m_layerTreeHost->updateLayers(updater); | 1654 m_layerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max(
)); |
1728 m_layerTreeHost->commitComplete(); | 1655 m_layerTreeHost->commitComplete(); |
1729 | 1656 |
1730 EXPECT_EQ_RECT(IntRect(), grandChild->occludedScreenSpace().bounds()); | 1657 EXPECT_EQ_RECT(IntRect(), grandChild->occludedScreenSpace().bounds()); |
1731 EXPECT_EQ(0u, grandChild->occludedScreenSpace().rects().size()); | 1658 EXPECT_EQ(0u, grandChild->occludedScreenSpace().rects().size()); |
1732 EXPECT_EQ_RECT(IntRect(30, 40, 170, 160), child->occludedScreenSpace().b
ounds()); | 1659 EXPECT_EQ_RECT(IntRect(30, 40, 170, 160), child->occludedScreenSpace().b
ounds()); |
1733 EXPECT_EQ(1u, child->occludedScreenSpace().rects().size()); | 1660 EXPECT_EQ(1u, child->occludedScreenSpace().rects().size()); |
1734 EXPECT_EQ_RECT(IntRect(30, 30, 170, 170), child2->occludedScreenSpace().
bounds()); | 1661 EXPECT_EQ_RECT(IntRect(30, 30, 170, 170), child2->occludedScreenSpace().
bounds()); |
1735 EXPECT_EQ(1u, child2->occludedScreenSpace().rects().size()); | 1662 EXPECT_EQ(1u, child2->occludedScreenSpace().rects().size()); |
1736 EXPECT_EQ_RECT(IntRect(30, 20, 170, 180), rootLayer->occludedScreenSpace
().bounds()); | 1663 EXPECT_EQ_RECT(IntRect(30, 20, 170, 180), rootLayer->occludedScreenSpace
().bounds()); |
1737 EXPECT_EQ(2u, rootLayer->occludedScreenSpace().rects().size()); | 1664 EXPECT_EQ(2u, rootLayer->occludedScreenSpace().rects().size()); |
1738 | 1665 |
1739 // Move the second child to be sure. | 1666 // Move the second child to be sure. |
1740 setTestLayerPropertiesForTesting(rootLayer.get(), 0, identityMatrix, Flo
atPoint(0, 0), FloatPoint(0, 0), IntSize(200, 200), true); | 1667 setTestLayerPropertiesForTesting(rootLayer.get(), 0, identityMatrix, Flo
atPoint(0, 0), FloatPoint(0, 0), IntSize(200, 200), true); |
1741 setTestLayerPropertiesForTesting(child2.get(), rootLayer.get(), identity
Matrix, FloatPoint(0, 0), FloatPoint(10, 70), IntSize(500, 500), true); | 1668 setTestLayerPropertiesForTesting(child2.get(), rootLayer.get(), identity
Matrix, FloatPoint(0, 0), FloatPoint(10, 70), IntSize(500, 500), true); |
1742 setTestLayerPropertiesForTesting(child.get(), rootLayer.get(), childTran
sform, FloatPoint(0, 0), FloatPoint(30, 30), IntSize(500, 500), true); | 1669 setTestLayerPropertiesForTesting(child.get(), rootLayer.get(), childTran
sform, FloatPoint(0, 0), FloatPoint(30, 30), IntSize(500, 500), true); |
1743 setTestLayerPropertiesForTesting(grandChild.get(), child.get(), identity
Matrix, FloatPoint(0, 0), FloatPoint(10, 10), IntSize(500, 500), true); | 1670 setTestLayerPropertiesForTesting(grandChild.get(), child.get(), identity
Matrix, FloatPoint(0, 0), FloatPoint(10, 10), IntSize(500, 500), true); |
1744 | 1671 |
1745 m_layerTreeHost->setRootLayer(rootLayer); | 1672 m_layerTreeHost->setRootLayer(rootLayer); |
1746 m_layerTreeHost->setViewportSize(rootLayer->bounds()); | 1673 m_layerTreeHost->setViewportSize(rootLayer->bounds()); |
1747 m_layerTreeHost->updateLayers(updater); | 1674 m_layerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max(
)); |
1748 m_layerTreeHost->commitComplete(); | 1675 m_layerTreeHost->commitComplete(); |
1749 | 1676 |
1750 EXPECT_EQ_RECT(IntRect(), grandChild->occludedScreenSpace().bounds()); | 1677 EXPECT_EQ_RECT(IntRect(), grandChild->occludedScreenSpace().bounds()); |
1751 EXPECT_EQ(0u, grandChild->occludedScreenSpace().rects().size()); | 1678 EXPECT_EQ(0u, grandChild->occludedScreenSpace().rects().size()); |
1752 EXPECT_EQ_RECT(IntRect(30, 40, 170, 160), child->occludedScreenSpace().b
ounds()); | 1679 EXPECT_EQ_RECT(IntRect(30, 40, 170, 160), child->occludedScreenSpace().b
ounds()); |
1753 EXPECT_EQ(1u, child->occludedScreenSpace().rects().size()); | 1680 EXPECT_EQ(1u, child->occludedScreenSpace().rects().size()); |
1754 EXPECT_EQ_RECT(IntRect(30, 30, 170, 170), child2->occludedScreenSpace().
bounds()); | 1681 EXPECT_EQ_RECT(IntRect(30, 30, 170, 170), child2->occludedScreenSpace().
bounds()); |
1755 EXPECT_EQ(1u, child2->occludedScreenSpace().rects().size()); | 1682 EXPECT_EQ(1u, child2->occludedScreenSpace().rects().size()); |
1756 EXPECT_EQ_RECT(IntRect(10, 30, 190, 170), rootLayer->occludedScreenSpace
().bounds()); | 1683 EXPECT_EQ_RECT(IntRect(10, 30, 190, 170), rootLayer->occludedScreenSpace
().bounds()); |
1757 EXPECT_EQ(2u, rootLayer->occludedScreenSpace().rects().size()); | 1684 EXPECT_EQ(2u, rootLayer->occludedScreenSpace().rects().size()); |
1758 | 1685 |
1759 // If the child layer has a mask on it, then it shouldn't contribute to
occlusion on stuff below it | 1686 // If the child layer has a mask on it, then it shouldn't contribute to
occlusion on stuff below it |
1760 setLayerPropertiesForTesting(rootLayer.get(), 0, identityMatrix, FloatPo
int(0, 0), FloatPoint(0, 0), IntSize(200, 200), true); | 1687 setLayerPropertiesForTesting(rootLayer.get(), 0, identityMatrix, FloatPo
int(0, 0), FloatPoint(0, 0), IntSize(200, 200), true); |
1761 setLayerPropertiesForTesting(child2.get(), rootLayer.get(), identityMatr
ix, FloatPoint(0, 0), FloatPoint(10, 70), IntSize(500, 500), true); | 1688 setLayerPropertiesForTesting(child2.get(), rootLayer.get(), identityMatr
ix, FloatPoint(0, 0), FloatPoint(10, 70), IntSize(500, 500), true); |
1762 setLayerPropertiesForTesting(child.get(), rootLayer.get(), childTransfor
m, FloatPoint(0, 0), FloatPoint(30, 30), IntSize(500, 500), true); | 1689 setLayerPropertiesForTesting(child.get(), rootLayer.get(), childTransfor
m, FloatPoint(0, 0), FloatPoint(30, 30), IntSize(500, 500), true); |
1763 setLayerPropertiesForTesting(grandChild.get(), child.get(), identityMatr
ix, FloatPoint(0, 0), FloatPoint(10, 10), IntSize(500, 500), true); | 1690 setLayerPropertiesForTesting(grandChild.get(), child.get(), identityMatr
ix, FloatPoint(0, 0), FloatPoint(10, 10), IntSize(500, 500), true); |
1764 | 1691 |
1765 child->setMaskLayer(mask.get()); | 1692 child->setMaskLayer(mask.get()); |
1766 | 1693 |
1767 m_layerTreeHost->setRootLayer(rootLayer); | 1694 m_layerTreeHost->setRootLayer(rootLayer); |
1768 m_layerTreeHost->setViewportSize(rootLayer->bounds()); | 1695 m_layerTreeHost->setViewportSize(rootLayer->bounds()); |
1769 m_layerTreeHost->updateLayers(updater); | 1696 m_layerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max(
)); |
1770 m_layerTreeHost->commitComplete(); | 1697 m_layerTreeHost->commitComplete(); |
1771 | 1698 |
1772 EXPECT_EQ_RECT(IntRect(), grandChild->occludedScreenSpace().bounds()); | 1699 EXPECT_EQ_RECT(IntRect(), grandChild->occludedScreenSpace().bounds()); |
1773 EXPECT_EQ(0u, grandChild->occludedScreenSpace().rects().size()); | 1700 EXPECT_EQ(0u, grandChild->occludedScreenSpace().rects().size()); |
1774 EXPECT_EQ_RECT(IntRect(30, 40, 170, 160), child->occludedScreenSpace().b
ounds()); | 1701 EXPECT_EQ_RECT(IntRect(30, 40, 170, 160), child->occludedScreenSpace().b
ounds()); |
1775 EXPECT_EQ(1u, child->occludedScreenSpace().rects().size()); | 1702 EXPECT_EQ(1u, child->occludedScreenSpace().rects().size()); |
1776 EXPECT_EQ_RECT(IntRect(), child2->occludedScreenSpace().bounds()); | 1703 EXPECT_EQ_RECT(IntRect(), child2->occludedScreenSpace().bounds()); |
1777 EXPECT_EQ(0u, child2->occludedScreenSpace().rects().size()); | 1704 EXPECT_EQ(0u, child2->occludedScreenSpace().rects().size()); |
1778 EXPECT_EQ_RECT(IntRect(10, 70, 190, 130), rootLayer->occludedScreenSpace
().bounds()); | 1705 EXPECT_EQ_RECT(IntRect(10, 70, 190, 130), rootLayer->occludedScreenSpace
().bounds()); |
1779 EXPECT_EQ(1u, rootLayer->occludedScreenSpace().rects().size()); | 1706 EXPECT_EQ(1u, rootLayer->occludedScreenSpace().rects().size()); |
1780 | 1707 |
1781 // If the child layer with a mask is below child2, then child2 should co
ntribute to occlusion on everything, and child shouldn't contribute to the rootL
ayer | 1708 // If the child layer with a mask is below child2, then child2 should co
ntribute to occlusion on everything, and child shouldn't contribute to the rootL
ayer |
1782 setLayerPropertiesForTesting(rootLayer.get(), 0, identityMatrix, FloatPo
int(0, 0), FloatPoint(0, 0), IntSize(200, 200), true); | 1709 setLayerPropertiesForTesting(rootLayer.get(), 0, identityMatrix, FloatPo
int(0, 0), FloatPoint(0, 0), IntSize(200, 200), true); |
1783 setLayerPropertiesForTesting(child.get(), rootLayer.get(), childTransfor
m, FloatPoint(0, 0), FloatPoint(30, 30), IntSize(500, 500), true); | 1710 setLayerPropertiesForTesting(child.get(), rootLayer.get(), childTransfor
m, FloatPoint(0, 0), FloatPoint(30, 30), IntSize(500, 500), true); |
1784 setLayerPropertiesForTesting(grandChild.get(), child.get(), identityMatr
ix, FloatPoint(0, 0), FloatPoint(10, 10), IntSize(500, 500), true); | 1711 setLayerPropertiesForTesting(grandChild.get(), child.get(), identityMatr
ix, FloatPoint(0, 0), FloatPoint(10, 10), IntSize(500, 500), true); |
1785 setLayerPropertiesForTesting(child2.get(), rootLayer.get(), identityMatr
ix, FloatPoint(0, 0), FloatPoint(10, 70), IntSize(500, 500), true); | 1712 setLayerPropertiesForTesting(child2.get(), rootLayer.get(), identityMatr
ix, FloatPoint(0, 0), FloatPoint(10, 70), IntSize(500, 500), true); |
1786 | 1713 |
1787 child->setMaskLayer(mask.get()); | 1714 child->setMaskLayer(mask.get()); |
1788 | 1715 |
1789 m_layerTreeHost->setRootLayer(rootLayer); | 1716 m_layerTreeHost->setRootLayer(rootLayer); |
1790 m_layerTreeHost->setViewportSize(rootLayer->bounds()); | 1717 m_layerTreeHost->setViewportSize(rootLayer->bounds()); |
1791 m_layerTreeHost->updateLayers(updater); | 1718 m_layerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max(
)); |
1792 m_layerTreeHost->commitComplete(); | 1719 m_layerTreeHost->commitComplete(); |
1793 | 1720 |
1794 EXPECT_EQ_RECT(IntRect(), child2->occludedScreenSpace().bounds()); | 1721 EXPECT_EQ_RECT(IntRect(), child2->occludedScreenSpace().bounds()); |
1795 EXPECT_EQ(0u, child2->occludedScreenSpace().rects().size()); | 1722 EXPECT_EQ(0u, child2->occludedScreenSpace().rects().size()); |
1796 EXPECT_EQ_RECT(IntRect(10, 70, 190, 130), grandChild->occludedScreenSpac
e().bounds()); | 1723 EXPECT_EQ_RECT(IntRect(10, 70, 190, 130), grandChild->occludedScreenSpac
e().bounds()); |
1797 EXPECT_EQ(1u, grandChild->occludedScreenSpace().rects().size()); | 1724 EXPECT_EQ(1u, grandChild->occludedScreenSpace().rects().size()); |
1798 EXPECT_EQ_RECT(IntRect(10, 40, 190, 160), child->occludedScreenSpace().b
ounds()); | 1725 EXPECT_EQ_RECT(IntRect(10, 40, 190, 160), child->occludedScreenSpace().b
ounds()); |
1799 EXPECT_EQ(2u, child->occludedScreenSpace().rects().size()); | 1726 EXPECT_EQ(2u, child->occludedScreenSpace().rects().size()); |
1800 EXPECT_EQ_RECT(IntRect(10, 70, 190, 130), rootLayer->occludedScreenSpace
().bounds()); | 1727 EXPECT_EQ_RECT(IntRect(10, 70, 190, 130), rootLayer->occludedScreenSpace
().bounds()); |
1801 EXPECT_EQ(1u, rootLayer->occludedScreenSpace().rects().size()); | 1728 EXPECT_EQ(1u, rootLayer->occludedScreenSpace().rects().size()); |
1802 | 1729 |
1803 // If the child layer has a non-opaque drawOpacity, then it shouldn't co
ntribute to occlusion on stuff below it | 1730 // If the child layer has a non-opaque drawOpacity, then it shouldn't co
ntribute to occlusion on stuff below it |
1804 setTestLayerPropertiesForTesting(rootLayer.get(), 0, identityMatrix, Flo
atPoint(0, 0), FloatPoint(0, 0), IntSize(200, 200), true); | 1731 setTestLayerPropertiesForTesting(rootLayer.get(), 0, identityMatrix, Flo
atPoint(0, 0), FloatPoint(0, 0), IntSize(200, 200), true); |
1805 setTestLayerPropertiesForTesting(child2.get(), rootLayer.get(), identity
Matrix, FloatPoint(0, 0), FloatPoint(10, 70), IntSize(500, 500), true); | 1732 setTestLayerPropertiesForTesting(child2.get(), rootLayer.get(), identity
Matrix, FloatPoint(0, 0), FloatPoint(10, 70), IntSize(500, 500), true); |
1806 setTestLayerPropertiesForTesting(child.get(), rootLayer.get(), childTran
sform, FloatPoint(0, 0), FloatPoint(30, 30), IntSize(500, 500), true); | 1733 setTestLayerPropertiesForTesting(child.get(), rootLayer.get(), childTran
sform, FloatPoint(0, 0), FloatPoint(30, 30), IntSize(500, 500), true); |
1807 setTestLayerPropertiesForTesting(grandChild.get(), child.get(), identity
Matrix, FloatPoint(0, 0), FloatPoint(10, 10), IntSize(500, 500), true); | 1734 setTestLayerPropertiesForTesting(grandChild.get(), child.get(), identity
Matrix, FloatPoint(0, 0), FloatPoint(10, 10), IntSize(500, 500), true); |
1808 | 1735 |
1809 child->setMaskLayer(0); | 1736 child->setMaskLayer(0); |
1810 child->setOpacity(0.5); | 1737 child->setOpacity(0.5); |
1811 | 1738 |
1812 m_layerTreeHost->setRootLayer(rootLayer); | 1739 m_layerTreeHost->setRootLayer(rootLayer); |
1813 m_layerTreeHost->setViewportSize(rootLayer->bounds()); | 1740 m_layerTreeHost->setViewportSize(rootLayer->bounds()); |
1814 m_layerTreeHost->updateLayers(updater); | 1741 m_layerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max(
)); |
1815 m_layerTreeHost->commitComplete(); | 1742 m_layerTreeHost->commitComplete(); |
1816 | 1743 |
1817 EXPECT_EQ_RECT(IntRect(), grandChild->occludedScreenSpace().bounds()); | 1744 EXPECT_EQ_RECT(IntRect(), grandChild->occludedScreenSpace().bounds()); |
1818 EXPECT_EQ(0u, grandChild->occludedScreenSpace().rects().size()); | 1745 EXPECT_EQ(0u, grandChild->occludedScreenSpace().rects().size()); |
1819 EXPECT_EQ_RECT(IntRect(30, 40, 170, 160), child->occludedScreenSpace().b
ounds()); | 1746 EXPECT_EQ_RECT(IntRect(30, 40, 170, 160), child->occludedScreenSpace().b
ounds()); |
1820 EXPECT_EQ(1u, child->occludedScreenSpace().rects().size()); | 1747 EXPECT_EQ(1u, child->occludedScreenSpace().rects().size()); |
1821 EXPECT_EQ_RECT(IntRect(), child2->occludedScreenSpace().bounds()); | 1748 EXPECT_EQ_RECT(IntRect(), child2->occludedScreenSpace().bounds()); |
1822 EXPECT_EQ(0u, child2->occludedScreenSpace().rects().size()); | 1749 EXPECT_EQ(0u, child2->occludedScreenSpace().rects().size()); |
1823 EXPECT_EQ_RECT(IntRect(10, 70, 190, 130), rootLayer->occludedScreenSpace
().bounds()); | 1750 EXPECT_EQ_RECT(IntRect(10, 70, 190, 130), rootLayer->occludedScreenSpace
().bounds()); |
1824 EXPECT_EQ(1u, rootLayer->occludedScreenSpace().rects().size()); | 1751 EXPECT_EQ(1u, rootLayer->occludedScreenSpace().rects().size()); |
1825 | 1752 |
1826 // If the child layer with non-opaque drawOpacity is below child2, then
child2 should contribute to occlusion on everything, and child shouldn't contrib
ute to the rootLayer | 1753 // If the child layer with non-opaque drawOpacity is below child2, then
child2 should contribute to occlusion on everything, and child shouldn't contrib
ute to the rootLayer |
1827 setTestLayerPropertiesForTesting(rootLayer.get(), 0, identityMatrix, Flo
atPoint(0, 0), FloatPoint(0, 0), IntSize(200, 200), true); | 1754 setTestLayerPropertiesForTesting(rootLayer.get(), 0, identityMatrix, Flo
atPoint(0, 0), FloatPoint(0, 0), IntSize(200, 200), true); |
1828 setTestLayerPropertiesForTesting(child.get(), rootLayer.get(), childTran
sform, FloatPoint(0, 0), FloatPoint(30, 30), IntSize(500, 500), true); | 1755 setTestLayerPropertiesForTesting(child.get(), rootLayer.get(), childTran
sform, FloatPoint(0, 0), FloatPoint(30, 30), IntSize(500, 500), true); |
1829 setTestLayerPropertiesForTesting(grandChild.get(), child.get(), identity
Matrix, FloatPoint(0, 0), FloatPoint(10, 10), IntSize(500, 500), true); | 1756 setTestLayerPropertiesForTesting(grandChild.get(), child.get(), identity
Matrix, FloatPoint(0, 0), FloatPoint(10, 10), IntSize(500, 500), true); |
1830 setTestLayerPropertiesForTesting(child2.get(), rootLayer.get(), identity
Matrix, FloatPoint(0, 0), FloatPoint(10, 70), IntSize(500, 500), true); | 1757 setTestLayerPropertiesForTesting(child2.get(), rootLayer.get(), identity
Matrix, FloatPoint(0, 0), FloatPoint(10, 70), IntSize(500, 500), true); |
1831 | 1758 |
1832 child->setMaskLayer(0); | 1759 child->setMaskLayer(0); |
1833 child->setOpacity(0.5); | 1760 child->setOpacity(0.5); |
1834 | 1761 |
1835 m_layerTreeHost->setRootLayer(rootLayer); | 1762 m_layerTreeHost->setRootLayer(rootLayer); |
1836 m_layerTreeHost->setViewportSize(rootLayer->bounds()); | 1763 m_layerTreeHost->setViewportSize(rootLayer->bounds()); |
1837 m_layerTreeHost->updateLayers(updater); | 1764 m_layerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max(
)); |
1838 m_layerTreeHost->commitComplete(); | 1765 m_layerTreeHost->commitComplete(); |
1839 | 1766 |
1840 EXPECT_EQ_RECT(IntRect(), child2->occludedScreenSpace().bounds()); | 1767 EXPECT_EQ_RECT(IntRect(), child2->occludedScreenSpace().bounds()); |
1841 EXPECT_EQ(0u, child2->occludedScreenSpace().rects().size()); | 1768 EXPECT_EQ(0u, child2->occludedScreenSpace().rects().size()); |
1842 EXPECT_EQ_RECT(IntRect(10, 70, 190, 130), grandChild->occludedScreenSpac
e().bounds()); | 1769 EXPECT_EQ_RECT(IntRect(10, 70, 190, 130), grandChild->occludedScreenSpac
e().bounds()); |
1843 EXPECT_EQ(1u, grandChild->occludedScreenSpace().rects().size()); | 1770 EXPECT_EQ(1u, grandChild->occludedScreenSpace().rects().size()); |
1844 EXPECT_EQ_RECT(IntRect(10, 40, 190, 160), child->occludedScreenSpace().b
ounds()); | 1771 EXPECT_EQ_RECT(IntRect(10, 40, 190, 160), child->occludedScreenSpace().b
ounds()); |
1845 EXPECT_EQ(2u, child->occludedScreenSpace().rects().size()); | 1772 EXPECT_EQ(2u, child->occludedScreenSpace().rects().size()); |
1846 EXPECT_EQ_RECT(IntRect(10, 70, 190, 130), rootLayer->occludedScreenSpace
().bounds()); | 1773 EXPECT_EQ_RECT(IntRect(10, 70, 190, 130), rootLayer->occludedScreenSpace
().bounds()); |
1847 EXPECT_EQ(1u, rootLayer->occludedScreenSpace().rects().size()); | 1774 EXPECT_EQ(1u, rootLayer->occludedScreenSpace().rects().size()); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1890 { | 1817 { |
1891 WebFilterOperations filters; | 1818 WebFilterOperations filters; |
1892 filters.append(WebFilterOperation::createOpacityFilter(0.5)); | 1819 filters.append(WebFilterOperation::createOpacityFilter(0.5)); |
1893 child->setFilters(filters); | 1820 child->setFilters(filters); |
1894 } | 1821 } |
1895 | 1822 |
1896 m_layerTreeHost->setRootLayer(rootLayer); | 1823 m_layerTreeHost->setRootLayer(rootLayer); |
1897 m_layerTreeHost->setViewportSize(rootLayer->bounds()); | 1824 m_layerTreeHost->setViewportSize(rootLayer->bounds()); |
1898 ASSERT_TRUE(m_layerTreeHost->initializeLayerRendererIfNeeded()); | 1825 ASSERT_TRUE(m_layerTreeHost->initializeLayerRendererIfNeeded()); |
1899 CCTextureUpdater updater; | 1826 CCTextureUpdater updater; |
1900 m_layerTreeHost->updateLayers(updater); | 1827 m_layerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max(
)); |
1901 m_layerTreeHost->commitComplete(); | 1828 m_layerTreeHost->commitComplete(); |
1902 | 1829 |
1903 EXPECT_EQ_RECT(IntRect(), child2->occludedScreenSpace().bounds()); | 1830 EXPECT_EQ_RECT(IntRect(), child2->occludedScreenSpace().bounds()); |
1904 EXPECT_EQ(0u, child2->occludedScreenSpace().rects().size()); | 1831 EXPECT_EQ(0u, child2->occludedScreenSpace().rects().size()); |
1905 EXPECT_EQ_RECT(IntRect(10, 70, 190, 130), grandChild->occludedScreenSpac
e().bounds()); | 1832 EXPECT_EQ_RECT(IntRect(10, 70, 190, 130), grandChild->occludedScreenSpac
e().bounds()); |
1906 EXPECT_EQ(1u, grandChild->occludedScreenSpace().rects().size()); | 1833 EXPECT_EQ(1u, grandChild->occludedScreenSpace().rects().size()); |
1907 EXPECT_EQ_RECT(IntRect(10, 40, 190, 160), child->occludedScreenSpace().b
ounds()); | 1834 EXPECT_EQ_RECT(IntRect(10, 40, 190, 160), child->occludedScreenSpace().b
ounds()); |
1908 EXPECT_EQ(2u, child->occludedScreenSpace().rects().size()); | 1835 EXPECT_EQ(2u, child->occludedScreenSpace().rects().size()); |
1909 EXPECT_EQ_RECT(IntRect(10, 70, 190, 130), rootLayer->occludedScreenSpace
().bounds()); | 1836 EXPECT_EQ_RECT(IntRect(10, 70, 190, 130), rootLayer->occludedScreenSpace
().bounds()); |
1910 EXPECT_EQ(1u, rootLayer->occludedScreenSpace().rects().size()); | 1837 EXPECT_EQ(1u, rootLayer->occludedScreenSpace().rects().size()); |
1911 | 1838 |
1912 // If the child layer has a filter that moves pixels/changes alpha, and
is below child2, then child should not inherit occlusion from outside its subtre
e, | 1839 // If the child layer has a filter that moves pixels/changes alpha, and
is below child2, then child should not inherit occlusion from outside its subtre
e, |
1913 // and should not contribute to the rootLayer | 1840 // and should not contribute to the rootLayer |
1914 setTestLayerPropertiesForTesting(rootLayer.get(), 0, identityMatrix, Flo
atPoint(0, 0), FloatPoint(0, 0), IntSize(200, 200), true); | 1841 setTestLayerPropertiesForTesting(rootLayer.get(), 0, identityMatrix, Flo
atPoint(0, 0), FloatPoint(0, 0), IntSize(200, 200), true); |
1915 setTestLayerPropertiesForTesting(child.get(), rootLayer.get(), childTran
sform, FloatPoint(0, 0), FloatPoint(30, 30), IntSize(500, 500), true); | 1842 setTestLayerPropertiesForTesting(child.get(), rootLayer.get(), childTran
sform, FloatPoint(0, 0), FloatPoint(30, 30), IntSize(500, 500), true); |
1916 setTestLayerPropertiesForTesting(grandChild.get(), child.get(), identity
Matrix, FloatPoint(0, 0), FloatPoint(10, 10), IntSize(500, 500), true); | 1843 setTestLayerPropertiesForTesting(grandChild.get(), child.get(), identity
Matrix, FloatPoint(0, 0), FloatPoint(10, 10), IntSize(500, 500), true); |
1917 setTestLayerPropertiesForTesting(child2.get(), rootLayer.get(), identity
Matrix, FloatPoint(0, 0), FloatPoint(10, 70), IntSize(500, 500), true); | 1844 setTestLayerPropertiesForTesting(child2.get(), rootLayer.get(), identity
Matrix, FloatPoint(0, 0), FloatPoint(10, 70), IntSize(500, 500), true); |
1918 | 1845 |
1919 { | 1846 { |
1920 WebFilterOperations filters; | 1847 WebFilterOperations filters; |
1921 filters.append(WebFilterOperation::createBlurFilter(10)); | 1848 filters.append(WebFilterOperation::createBlurFilter(10)); |
1922 child->setFilters(filters); | 1849 child->setFilters(filters); |
1923 } | 1850 } |
1924 | 1851 |
1925 m_layerTreeHost->setRootLayer(rootLayer); | 1852 m_layerTreeHost->setRootLayer(rootLayer); |
1926 m_layerTreeHost->setViewportSize(rootLayer->bounds()); | 1853 m_layerTreeHost->setViewportSize(rootLayer->bounds()); |
1927 m_layerTreeHost->updateLayers(updater); | 1854 m_layerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max(
)); |
1928 m_layerTreeHost->commitComplete(); | 1855 m_layerTreeHost->commitComplete(); |
1929 | 1856 |
1930 EXPECT_EQ_RECT(IntRect(), child2->occludedScreenSpace().bounds()); | 1857 EXPECT_EQ_RECT(IntRect(), child2->occludedScreenSpace().bounds()); |
1931 EXPECT_EQ(0u, child2->occludedScreenSpace().rects().size()); | 1858 EXPECT_EQ(0u, child2->occludedScreenSpace().rects().size()); |
1932 EXPECT_EQ_RECT(IntRect(), grandChild->occludedScreenSpace().bounds()); | 1859 EXPECT_EQ_RECT(IntRect(), grandChild->occludedScreenSpace().bounds()); |
1933 EXPECT_EQ(0u, grandChild->occludedScreenSpace().rects().size()); | 1860 EXPECT_EQ(0u, grandChild->occludedScreenSpace().rects().size()); |
1934 EXPECT_EQ_RECT(IntRect(30, 40, 170, 160), child->occludedScreenSpace().b
ounds()); | 1861 EXPECT_EQ_RECT(IntRect(30, 40, 170, 160), child->occludedScreenSpace().b
ounds()); |
1935 EXPECT_EQ(1u, child->occludedScreenSpace().rects().size()); | 1862 EXPECT_EQ(1u, child->occludedScreenSpace().rects().size()); |
1936 EXPECT_EQ_RECT(IntRect(10, 70, 190, 130), rootLayer->occludedScreenSpace
().bounds()); | 1863 EXPECT_EQ_RECT(IntRect(10, 70, 190, 130), rootLayer->occludedScreenSpace
().bounds()); |
1937 EXPECT_EQ(1u, rootLayer->occludedScreenSpace().rects().size()); | 1864 EXPECT_EQ(1u, rootLayer->occludedScreenSpace().rects().size()); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1979 | 1906 |
1980 for (int i = 1; i < numSurfaces; ++i) { | 1907 for (int i = 1; i < numSurfaces; ++i) { |
1981 children.append(TestLayerChromium::create()); | 1908 children.append(TestLayerChromium::create()); |
1982 setTestLayerPropertiesForTesting(children.last().get(), layers[i].ge
t(), identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(500, 500), fals
e); | 1909 setTestLayerPropertiesForTesting(children.last().get(), layers[i].ge
t(), identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(500, 500), fals
e); |
1983 } | 1910 } |
1984 | 1911 |
1985 m_layerTreeHost->setRootLayer(layers[0].get()); | 1912 m_layerTreeHost->setRootLayer(layers[0].get()); |
1986 m_layerTreeHost->setViewportSize(layers[0]->bounds()); | 1913 m_layerTreeHost->setViewportSize(layers[0]->bounds()); |
1987 ASSERT_TRUE(m_layerTreeHost->initializeLayerRendererIfNeeded()); | 1914 ASSERT_TRUE(m_layerTreeHost->initializeLayerRendererIfNeeded()); |
1988 CCTextureUpdater updater; | 1915 CCTextureUpdater updater; |
1989 m_layerTreeHost->updateLayers(updater); | 1916 m_layerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max(
)); |
1990 m_layerTreeHost->commitComplete(); | 1917 m_layerTreeHost->commitComplete(); |
1991 | 1918 |
1992 for (int i = 0; i < numSurfaces-1; ++i) { | 1919 for (int i = 0; i < numSurfaces-1; ++i) { |
1993 IntRect expectedOcclusion(i+1, i+1, 200-i-1, 200-i-1); | 1920 IntRect expectedOcclusion(i+1, i+1, 200-i-1, 200-i-1); |
1994 | 1921 |
1995 EXPECT_EQ_RECT(expectedOcclusion, layers[i]->occludedScreenSpace().b
ounds()); | 1922 EXPECT_EQ_RECT(expectedOcclusion, layers[i]->occludedScreenSpace().b
ounds()); |
1996 EXPECT_EQ(1u, layers[i]->occludedScreenSpace().rects().size()); | 1923 EXPECT_EQ(1u, layers[i]->occludedScreenSpace().rects().size()); |
1997 } | 1924 } |
1998 | 1925 |
1999 // Kill the layerTreeHost immediately. | 1926 // Kill the layerTreeHost immediately. |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2291 RefPtr<LayerChromium> m_childLayer; | 2218 RefPtr<LayerChromium> m_childLayer; |
2292 RefPtr<LayerChromium> m_rootScrollLayer; | 2219 RefPtr<LayerChromium> m_rootScrollLayer; |
2293 }; | 2220 }; |
2294 | 2221 |
2295 TEST_F(CCLayerTreeHostTestScrollChildLayer, runMultiThread) | 2222 TEST_F(CCLayerTreeHostTestScrollChildLayer, runMultiThread) |
2296 { | 2223 { |
2297 runTest(true); | 2224 runTest(true); |
2298 } | 2225 } |
2299 | 2226 |
2300 } // namespace | 2227 } // namespace |
OLD | NEW |