OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/layer_tree_host.h" | 5 #include "cc/layer_tree_host.h" |
6 | 6 |
7 #include "base/synchronization/lock.h" | 7 #include "base/synchronization/lock.h" |
8 #include "cc/content_layer.h" | 8 #include "cc/content_layer.h" |
9 #include "cc/content_layer_client.h" | 9 #include "cc/content_layer_client.h" |
10 #include "cc/frame_rate_controller.h" | 10 #include "cc/frame_rate_controller.h" |
(...skipping 1791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1802 scoped_refptr<Layer> m_contentLayer; | 1802 scoped_refptr<Layer> m_contentLayer; |
1803 int m_numCommitComplete; | 1803 int m_numCommitComplete; |
1804 int m_numDrawLayers; | 1804 int m_numDrawLayers; |
1805 }; | 1805 }; |
1806 | 1806 |
1807 TEST_F(LayerTreeHostTestContinuousInvalidate, runMultiThread) | 1807 TEST_F(LayerTreeHostTestContinuousInvalidate, runMultiThread) |
1808 { | 1808 { |
1809 runTest(true); | 1809 runTest(true); |
1810 } | 1810 } |
1811 | 1811 |
1812 class LayerTreeHostTestAdjustPointForZoom : public LayerTreeHostTest { | |
1813 public: | |
1814 LayerTreeHostTestAdjustPointForZoom() | |
1815 { | |
1816 } | |
1817 | |
1818 virtual void beginTest() OVERRIDE | |
1819 { | |
1820 gfx::Transform m; | |
1821 m.Translate(250, 360); | |
1822 m.Scale(2, 2); | |
1823 | |
1824 gfx::Point point(400, 550); | |
1825 gfx::Point transformedPoint; | |
1826 | |
1827 // Unit transform, no change expected. | |
1828 m_layerTreeHost->setImplTransform(gfx::Transform()); | |
1829 transformedPoint = gfx::ToRoundedPoint(m_layerTreeHost->adjustEventPoint
ForPinchZoom(point)); | |
1830 EXPECT_EQ(point.x(), transformedPoint.x()); | |
1831 EXPECT_EQ(point.y(), transformedPoint.y()); | |
1832 | |
1833 m_layerTreeHost->setImplTransform(m); | |
1834 | |
1835 // Apply m^(-1): 75 = (400 - 250) / 2; 95 = (550 - 360) / 2. | |
1836 transformedPoint = gfx::ToRoundedPoint(m_layerTreeHost->adjustEventPoint
ForPinchZoom(point)); | |
1837 EXPECT_EQ(75, transformedPoint.x()); | |
1838 EXPECT_EQ(95, transformedPoint.y()); | |
1839 endTest(); | |
1840 } | |
1841 | |
1842 virtual void afterTest() OVERRIDE | |
1843 { | |
1844 } | |
1845 }; | |
1846 | |
1847 TEST_F(LayerTreeHostTestAdjustPointForZoom, runMultiThread) | |
1848 { | |
1849 runTest(true); | |
1850 } | |
1851 | |
1852 class LayerTreeHostTestDeferCommits : public LayerTreeHostTest { | 1812 class LayerTreeHostTestDeferCommits : public LayerTreeHostTest { |
1853 public: | 1813 public: |
1854 LayerTreeHostTestDeferCommits() | 1814 LayerTreeHostTestDeferCommits() |
1855 : m_numCommitsDeferred(0) | 1815 : m_numCommitsDeferred(0) |
1856 , m_numCompleteCommits(0) | 1816 , m_numCompleteCommits(0) |
1857 { | 1817 { |
1858 } | 1818 } |
1859 | 1819 |
1860 virtual void beginTest() OVERRIDE | 1820 virtual void beginTest() OVERRIDE |
1861 { | 1821 { |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2136 } | 2096 } |
2137 | 2097 |
2138 TEST_F(LayerTreeHostTestMaxPendingFrames, GLRenderer) | 2098 TEST_F(LayerTreeHostTestMaxPendingFrames, GLRenderer) |
2139 { | 2099 { |
2140 m_delegatingRenderer = false; | 2100 m_delegatingRenderer = false; |
2141 runTest(true); | 2101 runTest(true); |
2142 } | 2102 } |
2143 | 2103 |
2144 } // namespace | 2104 } // namespace |
2145 } // namespace cc | 2105 } // namespace cc |
OLD | NEW |