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

Side by Side Diff: Source/WebCore/platform/ScrollAnimator.cpp

Issue 10693166: Merge 122382 - [chromium] [regression] Don't use ScrollByPrecisePixels on Chromium Mac. (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
« 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 /* 1 /*
2 * Copyright (c) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 Scrollbar* horizontalScrollbar = m_scrollableArea->horizontalScrollbar(); 84 Scrollbar* horizontalScrollbar = m_scrollableArea->horizontalScrollbar();
85 Scrollbar* verticalScrollbar = m_scrollableArea->verticalScrollbar(); 85 Scrollbar* verticalScrollbar = m_scrollableArea->verticalScrollbar();
86 86
87 // Accept the event if we have a scrollbar in that direction and can still 87 // Accept the event if we have a scrollbar in that direction and can still
88 // scroll any further. 88 // scroll any further.
89 float deltaX = horizontalScrollbar ? e.deltaX() : 0; 89 float deltaX = horizontalScrollbar ? e.deltaX() : 0;
90 float deltaY = verticalScrollbar ? e.deltaY() : 0; 90 float deltaY = verticalScrollbar ? e.deltaY() : 0;
91 91
92 bool handled = false; 92 bool handled = false;
93 93
94 #if PLATFORM(CHROMIUM) 94 #if PLATFORM(CHROMIUM) && !OS(DARWIN)
95 ScrollGranularity granularity = e.hasPreciseScrollingDeltas() ? ScrollByPrec isePixel : ScrollByPixel; 95 ScrollGranularity granularity = e.hasPreciseScrollingDeltas() ? ScrollByPrec isePixel : ScrollByPixel;
96 #else 96 #else
97 ScrollGranularity granularity = ScrollByPixel; 97 ScrollGranularity granularity = ScrollByPixel;
98 #endif 98 #endif
99 99
100 IntSize maxForwardScrollDelta = m_scrollableArea->maximumScrollPosition() - m_scrollableArea->scrollPosition(); 100 IntSize maxForwardScrollDelta = m_scrollableArea->maximumScrollPosition() - m_scrollableArea->scrollPosition();
101 IntSize maxBackwardScrollDelta = m_scrollableArea->scrollPosition() - m_scro llableArea->minimumScrollPosition(); 101 IntSize maxBackwardScrollDelta = m_scrollableArea->scrollPosition() - m_scro llableArea->minimumScrollPosition();
102 if ((deltaX < 0 && maxForwardScrollDelta.width() > 0) 102 if ((deltaX < 0 && maxForwardScrollDelta.width() > 0)
103 || (deltaX > 0 && maxBackwardScrollDelta.width() > 0) 103 || (deltaX > 0 && maxBackwardScrollDelta.width() > 0)
104 || (deltaY < 0 && maxForwardScrollDelta.height() > 0) 104 || (deltaY < 0 && maxForwardScrollDelta.height() > 0)
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 { 143 {
144 return FloatPoint(m_currentPosX, m_currentPosY); 144 return FloatPoint(m_currentPosX, m_currentPosY);
145 } 145 }
146 146
147 void ScrollAnimator::notifyPositionChanged() 147 void ScrollAnimator::notifyPositionChanged()
148 { 148 {
149 m_scrollableArea->setScrollOffsetFromAnimation(IntPoint(m_currentPosX, m_cur rentPosY)); 149 m_scrollableArea->setScrollOffsetFromAnimation(IntPoint(m_currentPosX, m_cur rentPosY));
150 } 150 }
151 151
152 } // namespace WebCore 152 } // namespace WebCore
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