diff options
Diffstat (limited to 'WebCore/platform/graphics/android/ScrollableLayerAndroid.cpp')
-rw-r--r-- | WebCore/platform/graphics/android/ScrollableLayerAndroid.cpp | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/WebCore/platform/graphics/android/ScrollableLayerAndroid.cpp b/WebCore/platform/graphics/android/ScrollableLayerAndroid.cpp deleted file mode 100644 index ca8f03c..0000000 --- a/WebCore/platform/graphics/android/ScrollableLayerAndroid.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include "config.h" -#include "ScrollableLayerAndroid.h" - -#if USE(ACCELERATED_COMPOSITING) - -namespace WebCore { - -bool ScrollableLayerAndroid::scrollTo(int x, int y) -{ - SkIRect scrollBounds; - getScrollRect(&scrollBounds); - if (!scrollBounds.fRight && !scrollBounds.fBottom) - return false; - - SkScalar newX = SkScalarPin(x, 0, scrollBounds.fRight); - SkScalar newY = SkScalarPin(y, 0, scrollBounds.fBottom); - // Check for no change. - if (newX == scrollBounds.fLeft && newY == scrollBounds.fTop) - return false; - - SkScalar diffX = newX - scrollBounds.fLeft; - SkScalar diffY = newY - scrollBounds.fTop; - const SkPoint& pos = getPosition(); - setPosition(pos.fX - diffX, pos.fY - diffY); - return true; -} - -void ScrollableLayerAndroid::getScrollRect(SkIRect* out) const -{ - const SkPoint& pos = getPosition(); - out->fLeft = m_scrollLimits.fLeft - pos.fX; - out->fTop = m_scrollLimits.fTop - pos.fY; - out->fRight = getSize().width() - m_scrollLimits.width(); - out->fBottom = getSize().height() - m_scrollLimits.height(); -} - -} // namespace WebCore - -#endif // USE(ACCELERATED_COMPOSITING) |