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

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

Issue 1591953005: Make ScrollbarThemeAura selectively invalidate scrollbar parts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge with master; remove blank line 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) 2004, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 } 132 }
133 133
134 void Scrollbar::offsetDidChange() 134 void Scrollbar::offsetDidChange()
135 { 135 {
136 ASSERT(m_scrollableArea); 136 ASSERT(m_scrollableArea);
137 137
138 float position = scrollableAreaCurrentPos(); 138 float position = scrollableAreaCurrentPos();
139 if (position == m_currentPos) 139 if (position == m_currentPos)
140 return; 140 return;
141 141
142 float oldPosition = m_currentPos;
142 int oldThumbPosition = theme().thumbPosition(*this); 143 int oldThumbPosition = theme().thumbPosition(*this);
143 m_currentPos = position; 144 m_currentPos = position;
144 // TODO(jbroman): The theme should provide the parts to invalidate. 145
145 // At the moment, the only theme that doesn't invalidate everything is Mac, 146 ScrollbarPart invalidParts = theme().invalidateOnThumbPositionChange(
146 // which invalidates this as needed in ScrollAnimatorMac. 147 *this, oldPosition, position);
147 setNeedsPaintInvalidation(NoPart); 148 setNeedsPaintInvalidation(invalidParts);
149
148 if (m_pressedPart == ThumbPart) 150 if (m_pressedPart == ThumbPart)
149 setPressedPos(m_pressedPos + theme().thumbPosition(*this) - oldThumbPosi tion); 151 setPressedPos(m_pressedPos + theme().thumbPosition(*this) - oldThumbPosi tion);
150 } 152 }
151 153
152 void Scrollbar::disconnectFromScrollableArea() 154 void Scrollbar::disconnectFromScrollableArea()
153 { 155 {
154 m_scrollableArea = nullptr; 156 m_scrollableArea = nullptr;
155 } 157 }
156 158
157 void Scrollbar::setProportion(int visibleSize, int totalSize) 159 void Scrollbar::setProportion(int visibleSize, int totalSize)
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 invalidParts = AllParts; 568 invalidParts = AllParts;
567 if (invalidParts & ~ThumbPart) 569 if (invalidParts & ~ThumbPart)
568 m_trackNeedsRepaint = true; 570 m_trackNeedsRepaint = true;
569 if (invalidParts & ThumbPart) 571 if (invalidParts & ThumbPart)
570 m_thumbNeedsRepaint = true; 572 m_thumbNeedsRepaint = true;
571 if (m_scrollableArea) 573 if (m_scrollableArea)
572 m_scrollableArea->setScrollbarNeedsPaintInvalidation(orientation()); 574 m_scrollableArea->setScrollbarNeedsPaintInvalidation(orientation());
573 } 575 }
574 576
575 } // namespace blink 577 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/Scrollbar.h ('k') | third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698