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

Side by Side Diff: Source/core/platform/ScrollView.cpp

Issue 24130008: Rename ENABLE(RUBBER_BANDING) to USE(RUBBER_BANDING). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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 | « Source/core/page/FrameView.cpp ('k') | Source/core/platform/ScrollableArea.h » ('j') | 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) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple 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 916 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 if (!paintsEntireContents()) { 927 if (!paintsEntireContents()) {
928 context->translate(-scrollX(), -scrollY()); 928 context->translate(-scrollX(), -scrollY());
929 documentDirtyRect.moveBy(scrollPosition()); 929 documentDirtyRect.moveBy(scrollPosition());
930 930
931 context->clip(visibleContentRect()); 931 context->clip(visibleContentRect());
932 } 932 }
933 933
934 paintContents(context, documentDirtyRect); 934 paintContents(context, documentDirtyRect);
935 } 935 }
936 936
937 #if ENABLE(RUBBER_BANDING) 937 #if USE(RUBBER_BANDING)
938 if (!layerForOverhangAreas()) 938 if (!layerForOverhangAreas())
939 calculateAndPaintOverhangAreas(context, rect); 939 calculateAndPaintOverhangAreas(context, rect);
940 #else 940 #else
941 calculateAndPaintOverhangAreas(context, rect); 941 calculateAndPaintOverhangAreas(context, rect);
942 #endif 942 #endif
943 943
944 // Now paint the scrollbars. 944 // Now paint the scrollbars.
945 if (!m_scrollbarsSuppressed && (m_horizontalScrollbar || m_verticalScrollbar )) { 945 if (!m_scrollbarsSuppressed && (m_horizontalScrollbar || m_verticalScrollbar )) {
946 GraphicsContextStateSaver stateSaver(*context); 946 GraphicsContextStateSaver stateSaver(*context);
947 IntRect scrollViewDirtyRect = rect; 947 IntRect scrollViewDirtyRect = rect;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 1001
1002 void ScrollView::updateOverhangAreas() 1002 void ScrollView::updateOverhangAreas()
1003 { 1003 {
1004 HostWindow* window = hostWindow(); 1004 HostWindow* window = hostWindow();
1005 if (!window) 1005 if (!window)
1006 return; 1006 return;
1007 1007
1008 IntRect horizontalOverhangRect; 1008 IntRect horizontalOverhangRect;
1009 IntRect verticalOverhangRect; 1009 IntRect verticalOverhangRect;
1010 calculateOverhangAreasForPainting(horizontalOverhangRect, verticalOverhangRe ct); 1010 calculateOverhangAreasForPainting(horizontalOverhangRect, verticalOverhangRe ct);
1011 #if ENABLE(RUBBER_BANDING) 1011 #if USE(RUBBER_BANDING)
1012 if (GraphicsLayer* overhangLayer = layerForOverhangAreas()) { 1012 if (GraphicsLayer* overhangLayer = layerForOverhangAreas()) {
1013 bool hasOverhangArea = !horizontalOverhangRect.isEmpty() || !verticalOve rhangRect.isEmpty(); 1013 bool hasOverhangArea = !horizontalOverhangRect.isEmpty() || !verticalOve rhangRect.isEmpty();
1014 overhangLayer->setDrawsContent(hasOverhangArea); 1014 overhangLayer->setDrawsContent(hasOverhangArea);
1015 if (hasOverhangArea) 1015 if (hasOverhangArea)
1016 overhangLayer->setNeedsDisplay(); 1016 overhangLayer->setNeedsDisplay();
1017 } 1017 }
1018 #endif 1018 #endif
1019 if (!horizontalOverhangRect.isEmpty()) 1019 if (!horizontalOverhangRect.isEmpty())
1020 window->invalidateContentsAndRootView(horizontalOverhangRect); 1020 window->invalidateContentsAndRootView(horizontalOverhangRect);
1021 if (!verticalOverhangRect.isEmpty()) 1021 if (!verticalOverhangRect.isEmpty())
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 int ScrollView::pageStep(ScrollbarOrientation orientation) const 1192 int ScrollView::pageStep(ScrollbarOrientation orientation) const
1193 { 1193 {
1194 int length = (orientation == HorizontalScrollbar) ? visibleWidth() : visible Height(); 1194 int length = (orientation == HorizontalScrollbar) ? visibleWidth() : visible Height();
1195 int minPageStep = static_cast<float>(length) * minFractionToStepWhenPaging() ; 1195 int minPageStep = static_cast<float>(length) * minFractionToStepWhenPaging() ;
1196 int pageStep = std::max(minPageStep, length - maxOverlapBetweenPages()); 1196 int pageStep = std::max(minPageStep, length - maxOverlapBetweenPages());
1197 1197
1198 return std::max(pageStep, 1); 1198 return std::max(pageStep, 1);
1199 } 1199 }
1200 1200
1201 } // namespace WebCore 1201 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/FrameView.cpp ('k') | Source/core/platform/ScrollableArea.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698