| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 GraphicsLayerTest() | 62 GraphicsLayerTest() |
| 63 { | 63 { |
| 64 m_clipLayer = adoptPtr(new GraphicsLayerForTesting(&m_client)); | 64 m_clipLayer = adoptPtr(new GraphicsLayerForTesting(&m_client)); |
| 65 m_scrollElasticityLayer = adoptPtr(new GraphicsLayerForTesting(&m_client
)); | 65 m_scrollElasticityLayer = adoptPtr(new GraphicsLayerForTesting(&m_client
)); |
| 66 m_graphicsLayer = adoptPtr(new GraphicsLayerForTesting(&m_client)); | 66 m_graphicsLayer = adoptPtr(new GraphicsLayerForTesting(&m_client)); |
| 67 m_clipLayer->addChild(m_scrollElasticityLayer.get()); | 67 m_clipLayer->addChild(m_scrollElasticityLayer.get()); |
| 68 m_scrollElasticityLayer->addChild(m_graphicsLayer.get()); | 68 m_scrollElasticityLayer->addChild(m_graphicsLayer.get()); |
| 69 m_graphicsLayer->platformLayer()->setScrollClipLayer( | 69 m_graphicsLayer->platformLayer()->setScrollClipLayer( |
| 70 m_clipLayer->platformLayer()); | 70 m_clipLayer->platformLayer()); |
| 71 m_platformLayer = m_graphicsLayer->platformLayer(); | 71 m_platformLayer = m_graphicsLayer->platformLayer(); |
| 72 m_layerTreeView = adoptPtr(Platform::current()->unitTestSupport()->creat
eLayerTreeViewForTesting()); | 72 m_layerTreeView = adoptPtr(Platform::current()->unitTestSupport()->creat
eLayerTreeViewForTesting(false)); |
| 73 ASSERT(m_layerTreeView); | 73 ASSERT(m_layerTreeView); |
| 74 m_layerTreeView->setRootLayer(*m_clipLayer->platformLayer()); | 74 m_layerTreeView->setRootLayer(*m_clipLayer->platformLayer()); |
| 75 m_layerTreeView->registerViewportLayers( | 75 m_layerTreeView->registerViewportLayers( |
| 76 m_scrollElasticityLayer->platformLayer(), m_clipLayer->platformLayer
(), m_graphicsLayer->platformLayer(), 0); | 76 m_scrollElasticityLayer->platformLayer(), m_clipLayer->platformLayer
(), m_graphicsLayer->platformLayer(), 0); |
| 77 m_layerTreeView->setViewportSize(WebSize(1, 1)); | 77 m_layerTreeView->setViewportSize(WebSize(1, 1)); |
| 78 } | 78 } |
| 79 | 79 |
| 80 ~GraphicsLayerTest() override | 80 ~GraphicsLayerTest() override |
| 81 { | 81 { |
| 82 m_graphicsLayer.clear(); | 82 m_graphicsLayer.clear(); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 172 |
| 173 WebDoublePoint scrollPosition(7, 9); | 173 WebDoublePoint scrollPosition(7, 9); |
| 174 m_platformLayer->setScrollPositionDouble(scrollPosition); | 174 m_platformLayer->setScrollPositionDouble(scrollPosition); |
| 175 m_graphicsLayer->didScroll(); | 175 m_graphicsLayer->didScroll(); |
| 176 | 176 |
| 177 EXPECT_FLOAT_EQ(scrollPosition.x, scrollableArea->scrollPositionDouble().x()
); | 177 EXPECT_FLOAT_EQ(scrollPosition.x, scrollableArea->scrollPositionDouble().x()
); |
| 178 EXPECT_FLOAT_EQ(scrollPosition.y, scrollableArea->scrollPositionDouble().y()
); | 178 EXPECT_FLOAT_EQ(scrollPosition.y, scrollableArea->scrollPositionDouble().y()
); |
| 179 } | 179 } |
| 180 | 180 |
| 181 } // namespace blink | 181 } // namespace blink |
| OLD | NEW |