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

Side by Side Diff: cc/layer_tree_host_impl.cc

Issue 11447024: Disable pinch zoom viewport for non-compositor scaling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use NULL instead of 0 Created 8 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_impl.h" 5 #include "cc/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1291 if (!m_currentlyScrollingLayerImpl) 1291 if (!m_currentlyScrollingLayerImpl)
1292 return false; 1292 return false;
1293 1293
1294 gfx::Vector2dF pendingDelta = scrollDelta; 1294 gfx::Vector2dF pendingDelta = scrollDelta;
1295 bool didScroll = false; 1295 bool didScroll = false;
1296 1296
1297 for (LayerImpl* layerImpl = m_currentlyScrollingLayerImpl; layerImpl; layerI mpl = layerImpl->parent()) { 1297 for (LayerImpl* layerImpl = m_currentlyScrollingLayerImpl; layerImpl; layerI mpl = layerImpl->parent()) {
1298 if (!layerImpl->scrollable()) 1298 if (!layerImpl->scrollable())
1299 continue; 1299 continue;
1300 1300
1301 PinchZoomViewport* viewport = layerImpl == m_rootScrollLayerImpl ? &m_pi nchZoomViewport : 0; 1301 PinchZoomViewport* viewport = NULL;
1302 if (m_settings.pageScalePinchZoomEnabled && layerImpl == m_rootScrollLay erImpl)
1303 viewport = &m_pinchZoomViewport;
1302 gfx::Vector2dF appliedDelta; 1304 gfx::Vector2dF appliedDelta;
1303 if (m_scrollDeltaIsInViewportSpace) { 1305 if (m_scrollDeltaIsInViewportSpace) {
1304 float scaleFromViewportToScreenSpace = m_deviceScaleFactor; 1306 float scaleFromViewportToScreenSpace = m_deviceScaleFactor;
1305 appliedDelta = scrollLayerWithViewportSpaceDelta(viewport, *layerImp l, scaleFromViewportToScreenSpace, viewportPoint, pendingDelta); 1307 appliedDelta = scrollLayerWithViewportSpaceDelta(viewport, *layerImp l, scaleFromViewportToScreenSpace, viewportPoint, pendingDelta);
1306 } else 1308 } else
1307 appliedDelta = scrollLayerWithLocalDelta(*layerImpl, pendingDelta); 1309 appliedDelta = scrollLayerWithLocalDelta(*layerImpl, pendingDelta);
1308 1310
1309 // If the layer wasn't able to move, try the next one in the hierarchy. 1311 // If the layer wasn't able to move, try the next one in the hierarchy.
1310 float moveThresholdSquared = 0.1f * 0.1f; 1312 float moveThresholdSquared = 0.1f * 0.1f;
1311 if (appliedDelta.LengthSquared() < moveThresholdSquared) 1313 if (appliedDelta.LengthSquared() < moveThresholdSquared)
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
1632 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio nController(); 1634 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio nController();
1633 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); 1635 double monotonicTime = (time - base::TimeTicks()).InSecondsF();
1634 if (scrollbarController && scrollbarController->animate(monotonicTime)) 1636 if (scrollbarController && scrollbarController->animate(monotonicTime))
1635 m_client->setNeedsRedrawOnImplThread(); 1637 m_client->setNeedsRedrawOnImplThread();
1636 1638
1637 for (size_t i = 0; i < layer->children().size(); ++i) 1639 for (size_t i = 0; i < layer->children().size(); ++i)
1638 animateScrollbarsRecursive(layer->children()[i], time); 1640 animateScrollbarsRecursive(layer->children()[i], time);
1639 } 1641 }
1640 1642
1641 } // namespace cc 1643 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698