Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(815)

Side by Side Diff: Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp

Issue 10702135: Merge 120858 - [chromium] Separate LayerRenderer initialization from updateLayers (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1669 matching lines...) Expand 10 before | Expand all | Expand 10 after
1680 // See CCLayerTreeHostCommonTest.layerAddsSelfToOccludedRegionWithRotate dSurface for a nice visual of these layers and how they end up 1680 // See CCLayerTreeHostCommonTest.layerAddsSelfToOccludedRegionWithRotate dSurface for a nice visual of these layers and how they end up
1681 // positioned on the screen. 1681 // positioned on the screen.
1682 1682
1683 // The child layer is rotated and the grandChild is opaque, but clipped to the child and rootLayer 1683 // 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); 1684 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); 1685 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); 1686 setTestLayerPropertiesForTesting(grandChild.get(), child.get(), identity Matrix, FloatPoint(0, 0), FloatPoint(10, 10), IntSize(500, 500), true);
1687 1687
1688 m_layerTreeHost->setRootLayer(rootLayer); 1688 m_layerTreeHost->setRootLayer(rootLayer);
1689 m_layerTreeHost->setViewportSize(rootLayer->bounds()); 1689 m_layerTreeHost->setViewportSize(rootLayer->bounds());
1690 ASSERT_TRUE(m_layerTreeHost->initializeLayerRendererIfNeeded());
1690 CCTextureUpdater updater; 1691 CCTextureUpdater updater;
1691 m_layerTreeHost->updateLayers(updater); 1692 m_layerTreeHost->updateLayers(updater);
1692 m_layerTreeHost->commitComplete(); 1693 m_layerTreeHost->commitComplete();
1693 1694
1694 EXPECT_EQ_RECT(IntRect(), grandChild->occludedScreenSpace().bounds()); 1695 EXPECT_EQ_RECT(IntRect(), grandChild->occludedScreenSpace().bounds());
1695 EXPECT_EQ(0u, grandChild->occludedScreenSpace().rects().size()); 1696 EXPECT_EQ(0u, grandChild->occludedScreenSpace().rects().size());
1696 EXPECT_EQ_RECT(IntRect(30, 40, 170, 160), child->occludedScreenSpace().b ounds()); 1697 EXPECT_EQ_RECT(IntRect(30, 40, 170, 160), child->occludedScreenSpace().b ounds());
1697 EXPECT_EQ(1u, child->occludedScreenSpace().rects().size()); 1698 EXPECT_EQ(1u, child->occludedScreenSpace().rects().size());
1698 EXPECT_EQ_RECT(IntRect(30, 40, 170, 160), rootLayer->occludedScreenSpace ().bounds()); 1699 EXPECT_EQ_RECT(IntRect(30, 40, 170, 160), rootLayer->occludedScreenSpace ().bounds());
1699 EXPECT_EQ(1u, rootLayer->occludedScreenSpace().rects().size()); 1700 EXPECT_EQ(1u, rootLayer->occludedScreenSpace().rects().size());
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1887 setTestLayerPropertiesForTesting(child2.get(), rootLayer.get(), identity Matrix, FloatPoint(0, 0), FloatPoint(10, 70), IntSize(500, 500), true); 1888 setTestLayerPropertiesForTesting(child2.get(), rootLayer.get(), identity Matrix, FloatPoint(0, 0), FloatPoint(10, 70), IntSize(500, 500), true);
1888 1889
1889 { 1890 {
1890 WebFilterOperations filters; 1891 WebFilterOperations filters;
1891 filters.append(WebFilterOperation::createOpacityFilter(0.5)); 1892 filters.append(WebFilterOperation::createOpacityFilter(0.5));
1892 child->setFilters(filters); 1893 child->setFilters(filters);
1893 } 1894 }
1894 1895
1895 m_layerTreeHost->setRootLayer(rootLayer); 1896 m_layerTreeHost->setRootLayer(rootLayer);
1896 m_layerTreeHost->setViewportSize(rootLayer->bounds()); 1897 m_layerTreeHost->setViewportSize(rootLayer->bounds());
1898 ASSERT_TRUE(m_layerTreeHost->initializeLayerRendererIfNeeded());
1897 CCTextureUpdater updater; 1899 CCTextureUpdater updater;
1898 m_layerTreeHost->updateLayers(updater); 1900 m_layerTreeHost->updateLayers(updater);
1899 m_layerTreeHost->commitComplete(); 1901 m_layerTreeHost->commitComplete();
1900 1902
1901 EXPECT_EQ_RECT(IntRect(), child2->occludedScreenSpace().bounds()); 1903 EXPECT_EQ_RECT(IntRect(), child2->occludedScreenSpace().bounds());
1902 EXPECT_EQ(0u, child2->occludedScreenSpace().rects().size()); 1904 EXPECT_EQ(0u, child2->occludedScreenSpace().rects().size());
1903 EXPECT_EQ_RECT(IntRect(10, 70, 190, 130), grandChild->occludedScreenSpac e().bounds()); 1905 EXPECT_EQ_RECT(IntRect(10, 70, 190, 130), grandChild->occludedScreenSpac e().bounds());
1904 EXPECT_EQ(1u, grandChild->occludedScreenSpace().rects().size()); 1906 EXPECT_EQ(1u, grandChild->occludedScreenSpace().rects().size());
1905 EXPECT_EQ_RECT(IntRect(10, 40, 190, 160), child->occludedScreenSpace().b ounds()); 1907 EXPECT_EQ_RECT(IntRect(10, 40, 190, 160), child->occludedScreenSpace().b ounds());
1906 EXPECT_EQ(2u, child->occludedScreenSpace().rects().size()); 1908 EXPECT_EQ(2u, child->occludedScreenSpace().rects().size());
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1975 } 1977 }
1976 } 1978 }
1977 1979
1978 for (int i = 1; i < numSurfaces; ++i) { 1980 for (int i = 1; i < numSurfaces; ++i) {
1979 children.append(TestLayerChromium::create()); 1981 children.append(TestLayerChromium::create());
1980 setTestLayerPropertiesForTesting(children.last().get(), layers[i].ge t(), identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(500, 500), fals e); 1982 setTestLayerPropertiesForTesting(children.last().get(), layers[i].ge t(), identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(500, 500), fals e);
1981 } 1983 }
1982 1984
1983 m_layerTreeHost->setRootLayer(layers[0].get()); 1985 m_layerTreeHost->setRootLayer(layers[0].get());
1984 m_layerTreeHost->setViewportSize(layers[0]->bounds()); 1986 m_layerTreeHost->setViewportSize(layers[0]->bounds());
1987 ASSERT_TRUE(m_layerTreeHost->initializeLayerRendererIfNeeded());
1985 CCTextureUpdater updater; 1988 CCTextureUpdater updater;
1986 m_layerTreeHost->updateLayers(updater); 1989 m_layerTreeHost->updateLayers(updater);
1987 m_layerTreeHost->commitComplete(); 1990 m_layerTreeHost->commitComplete();
1988 1991
1989 for (int i = 0; i < numSurfaces-1; ++i) { 1992 for (int i = 0; i < numSurfaces-1; ++i) {
1990 IntRect expectedOcclusion(i+1, i+1, 200-i-1, 200-i-1); 1993 IntRect expectedOcclusion(i+1, i+1, 200-i-1, 200-i-1);
1991 1994
1992 EXPECT_EQ_RECT(expectedOcclusion, layers[i]->occludedScreenSpace().b ounds()); 1995 EXPECT_EQ_RECT(expectedOcclusion, layers[i]->occludedScreenSpace().b ounds());
1993 EXPECT_EQ(1u, layers[i]->occludedScreenSpace().rects().size()); 1996 EXPECT_EQ(1u, layers[i]->occludedScreenSpace().rects().size());
1994 } 1997 }
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
2288 RefPtr<LayerChromium> m_childLayer; 2291 RefPtr<LayerChromium> m_childLayer;
2289 RefPtr<LayerChromium> m_rootScrollLayer; 2292 RefPtr<LayerChromium> m_rootScrollLayer;
2290 }; 2293 };
2291 2294
2292 TEST_F(CCLayerTreeHostTestScrollChildLayer, runMultiThread) 2295 TEST_F(CCLayerTreeHostTestScrollChildLayer, runMultiThread)
2293 { 2296 {
2294 runTest(true); 2297 runTest(true);
2295 } 2298 }
2296 2299
2297 } // namespace 2300 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698