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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp

Issue 1558493002: Reland: Make ScrollbarThemeAura selectively invalidate scrollbar parts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix ScrollableAreaTest.InvalidatesCompositedScrollbarsIfPartsNeedRepaint for Oilpan Created 4 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, Google Inc. All rights reserved.
3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 void ScrollableArea::scrollPositionChanged(const DoublePoint& position, ScrollTy pe scrollType) 237 void ScrollableArea::scrollPositionChanged(const DoublePoint& position, ScrollTy pe scrollType)
238 { 238 {
239 TRACE_EVENT0("blink", "ScrollableArea::scrollPositionChanged"); 239 TRACE_EVENT0("blink", "ScrollableArea::scrollPositionChanged");
240 240
241 DoublePoint oldPosition = scrollPositionDouble(); 241 DoublePoint oldPosition = scrollPositionDouble();
242 DoublePoint truncatedPosition = shouldUseIntegerScrollOffset() ? flooredIntP oint(position) : position; 242 DoublePoint truncatedPosition = shouldUseIntegerScrollOffset() ? flooredIntP oint(position) : position;
243 243
244 // Tell the derived class to scroll its contents. 244 // Tell the derived class to scroll its contents.
245 setScrollOffset(truncatedPosition, scrollType); 245 setScrollOffset(truncatedPosition, scrollType);
246 246
247 Scrollbar* verticalScrollbar = this->verticalScrollbar();
248
249 // Tell the scrollbars to update their thumb postions. 247 // Tell the scrollbars to update their thumb postions.
248 // If a scrollbar does not have its own layer, it must always be invalidated
249 // to reflect the new thumb position, even if the theme would not otherwise
250 // require invalidation of any part.
250 if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) { 251 if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) {
251 horizontalScrollbar->offsetDidChange(); 252 bool offsetChanged = horizontalScrollbar->offsetDidChange();
252 if (horizontalScrollbar->isOverlayScrollbar() && !hasLayerForHorizontalS crollbar()) 253 if (offsetChanged && !hasLayerForHorizontalScrollbar())
253 setScrollbarNeedsPaintInvalidation(HorizontalScrollbar); 254 setScrollbarNeedsPaintInvalidation(HorizontalScrollbar);
254 } 255 }
255 if (verticalScrollbar) { 256 if (Scrollbar* verticalScrollbar = this->verticalScrollbar()) {
256 verticalScrollbar->offsetDidChange(); 257 bool offsetChanged = verticalScrollbar->offsetDidChange();
257 if (verticalScrollbar->isOverlayScrollbar() && !hasLayerForVerticalScrol lbar()) 258 if (offsetChanged && !hasLayerForVerticalScrollbar())
258 setScrollbarNeedsPaintInvalidation(VerticalScrollbar); 259 setScrollbarNeedsPaintInvalidation(VerticalScrollbar);
259 } 260 }
260 261
261 if (scrollPositionDouble() != oldPosition) { 262 if (scrollPositionDouble() != oldPosition) {
262 // FIXME: Pass in DoubleSize. crbug.com/414283. 263 // FIXME: Pass in DoubleSize. crbug.com/414283.
263 scrollAnimator().notifyContentAreaScrolled(toFloatSize(scrollPositionDou ble() - oldPosition)); 264 scrollAnimator().notifyContentAreaScrolled(toFloatSize(scrollPositionDou ble() - oldPosition));
264 } 265 }
265 266
266 scrollAnimator().setCurrentPosition(toFloatPoint(position)); 267 scrollAnimator().setCurrentPosition(toFloatPoint(position));
267 } 268 }
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 std::max(0, size.height() - horizontalScrollbarHeight)); 586 std::max(0, size.height() - horizontalScrollbarHeight));
586 } 587 }
587 588
588 DEFINE_TRACE(ScrollableArea) 589 DEFINE_TRACE(ScrollableArea)
589 { 590 {
590 visitor->trace(m_scrollAnimator); 591 visitor->trace(m_scrollAnimator);
591 visitor->trace(m_programmaticScrollAnimator); 592 visitor->trace(m_programmaticScrollAnimator);
592 } 593 }
593 594
594 } // namespace blink 595 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698