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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "CCLayerTreeHostImpl.h" | 7 #include "CCLayerTreeHostImpl.h" |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "CCAppendQuadsData.h" | 10 #include "CCAppendQuadsData.h" |
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1291 scroll.layerId = layerImpl->id(); | 1291 scroll.layerId = layerImpl->id(); |
1292 scroll.scrollDelta = scrollDelta; | 1292 scroll.scrollDelta = scrollDelta; |
1293 scrollInfo->scrolls.append(scroll); | 1293 scrollInfo->scrolls.append(scroll); |
1294 layerImpl->setSentScrollDelta(scrollDelta); | 1294 layerImpl->setSentScrollDelta(scrollDelta); |
1295 } | 1295 } |
1296 | 1296 |
1297 for (size_t i = 0; i < layerImpl->children().size(); ++i) | 1297 for (size_t i = 0; i < layerImpl->children().size(); ++i) |
1298 collectScrollDeltas(scrollInfo, layerImpl->children()[i]); | 1298 collectScrollDeltas(scrollInfo, layerImpl->children()[i]); |
1299 } | 1299 } |
1300 | 1300 |
1301 PassOwnPtr<CCScrollAndScaleSet> CCLayerTreeHostImpl::processScrollDeltas() | 1301 scoped_ptr<CCScrollAndScaleSet> CCLayerTreeHostImpl::processScrollDeltas() |
1302 { | 1302 { |
1303 OwnPtr<CCScrollAndScaleSet> scrollInfo = adoptPtr(new CCScrollAndScaleSet())
; | 1303 scoped_ptr<CCScrollAndScaleSet> scrollInfo(new CCScrollAndScaleSet()); |
1304 | 1304 |
1305 if (m_pinchGestureActive || m_pageScaleAnimation) { | 1305 if (m_pinchGestureActive || m_pageScaleAnimation) { |
1306 scrollInfo->pageScaleDelta = 1; | 1306 scrollInfo->pageScaleDelta = 1; |
1307 m_pinchZoomViewport.setSentPageScaleDelta(1); | 1307 m_pinchZoomViewport.setSentPageScaleDelta(1); |
1308 // FIXME(aelias): Make these painting optimizations compatible with | 1308 // FIXME(aelias): Make these painting optimizations compatible with |
1309 // compositor-side scaling. | 1309 // compositor-side scaling. |
1310 if (!CCSettings::pageScalePinchZoomEnabled()) { | 1310 if (!CCSettings::pageScalePinchZoomEnabled()) { |
1311 if (m_pinchGestureActive) | 1311 if (m_pinchGestureActive) |
1312 computePinchZoomDeltas(scrollInfo.get()); | 1312 computePinchZoomDeltas(scrollInfo.get()); |
1313 else if (m_pageScaleAnimation.get()) | 1313 else if (m_pageScaleAnimation.get()) |
1314 computeDoubleTapZoomDeltas(scrollInfo.get()); | 1314 computeDoubleTapZoomDeltas(scrollInfo.get()); |
1315 } | 1315 } |
1316 return scrollInfo.release(); | 1316 return scrollInfo.Pass(); |
1317 } | 1317 } |
1318 | 1318 |
1319 collectScrollDeltas(scrollInfo.get(), m_rootLayerImpl.get()); | 1319 collectScrollDeltas(scrollInfo.get(), m_rootLayerImpl.get()); |
1320 scrollInfo->pageScaleDelta = m_pinchZoomViewport.pageScaleDelta(); | 1320 scrollInfo->pageScaleDelta = m_pinchZoomViewport.pageScaleDelta(); |
1321 m_pinchZoomViewport.setSentPageScaleDelta(scrollInfo->pageScaleDelta); | 1321 m_pinchZoomViewport.setSentPageScaleDelta(scrollInfo->pageScaleDelta); |
1322 | 1322 |
1323 return scrollInfo.release(); | 1323 return scrollInfo.Pass(); |
1324 } | 1324 } |
1325 | 1325 |
1326 WebTransformationMatrix CCLayerTreeHostImpl::implTransform() const | 1326 WebTransformationMatrix CCLayerTreeHostImpl::implTransform() const |
1327 { | 1327 { |
1328 return m_pinchZoomViewport.implTransform(); | 1328 return m_pinchZoomViewport.implTransform(); |
1329 } | 1329 } |
1330 | 1330 |
1331 void CCLayerTreeHostImpl::setFullRootLayerDamage() | 1331 void CCLayerTreeHostImpl::setFullRootLayerDamage() |
1332 { | 1332 { |
1333 if (m_rootLayerImpl) { | 1333 if (m_rootLayerImpl) { |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1453 | 1453 |
1454 CCScrollbarAnimationController* scrollbarController = layer->scrollbarAnimat
ionController(); | 1454 CCScrollbarAnimationController* scrollbarController = layer->scrollbarAnimat
ionController(); |
1455 if (scrollbarController && scrollbarController->animate(monotonicTime)) | 1455 if (scrollbarController && scrollbarController->animate(monotonicTime)) |
1456 m_client->setNeedsRedrawOnImplThread(); | 1456 m_client->setNeedsRedrawOnImplThread(); |
1457 | 1457 |
1458 for (size_t i = 0; i < layer->children().size(); ++i) | 1458 for (size_t i = 0; i < layer->children().size(); ++i) |
1459 animateScrollbarsRecursive(layer->children()[i], monotonicTime); | 1459 animateScrollbarsRecursive(layer->children()[i], monotonicTime); |
1460 } | 1460 } |
1461 | 1461 |
1462 } // namespace cc | 1462 } // namespace cc |
OLD | NEW |