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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutScrollbar.cpp

Issue 1456953003: Revert of Calculate paint invalidation rect for scrollbars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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) 2008, 2009 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008, 2009 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 newThickness = isHorizontal ? part->size().height() : part->size().width (); 194 newThickness = isHorizontal ? part->size().height() : part->size().width ();
195 } 195 }
196 196
197 if (newThickness != oldThickness) { 197 if (newThickness != oldThickness) {
198 setFrameRect(IntRect(location(), IntSize(isHorizontal ? width() : newThi ckness, isHorizontal ? newThickness : height()))); 198 setFrameRect(IntRect(location(), IntSize(isHorizontal ? width() : newThi ckness, isHorizontal ? newThickness : height())));
199 if (LayoutBox* box = owningLayoutObjectWithinFrame()) { 199 if (LayoutBox* box = owningLayoutObjectWithinFrame()) {
200 if (box->isLayoutBlock()) 200 if (box->isLayoutBlock())
201 toLayoutBlock(box)->notifyScrollbarThicknessChanged(); 201 toLayoutBlock(box)->notifyScrollbarThicknessChanged();
202 box->setChildNeedsLayout(); 202 box->setChildNeedsLayout();
203 if (m_scrollableArea) 203 if (m_scrollableArea)
204 m_scrollableArea->setScrollCornerNeedsPaintInvalidation(); 204 m_scrollableArea->invalidateScrollCorner(m_scrollableArea->scrol lCornerRect());
205 } 205 }
206 } 206 }
207 } 207 }
208 208
209 static PseudoId pseudoForScrollbarPart(ScrollbarPart part) 209 static PseudoId pseudoForScrollbarPart(ScrollbarPart part)
210 { 210 {
211 switch (part) { 211 switch (part) {
212 case BackButtonStartPart: 212 case BackButtonStartPart:
213 case ForwardButtonStartPart: 213 case ForwardButtonStartPart:
214 case BackButtonEndPart: 214 case BackButtonEndPart:
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 355
356 int LayoutScrollbar::minimumThumbLength() const 356 int LayoutScrollbar::minimumThumbLength() const
357 { 357 {
358 LayoutScrollbarPart* partLayoutObject = m_parts.get(ThumbPart); 358 LayoutScrollbarPart* partLayoutObject = m_parts.get(ThumbPart);
359 if (!partLayoutObject) 359 if (!partLayoutObject)
360 return 0; 360 return 0;
361 partLayoutObject->layout(); 361 partLayoutObject->layout();
362 return orientation() == HorizontalScrollbar ? partLayoutObject->size().width () : partLayoutObject->size().height(); 362 return orientation() == HorizontalScrollbar ? partLayoutObject->size().width () : partLayoutObject->size().height();
363 } 363 }
364 364
365 void LayoutScrollbar::invalidateDisplayItemClientsOfScrollbarParts(const LayoutB oxModelObject& paintInvalidationContainer, const LayoutRect& paintInvalidationRe ct) 365 void LayoutScrollbar::invalidateRect(const IntRect& rect)
366 { 366 {
367 for (auto& part : m_parts) 367 Scrollbar::invalidateRect(rect);
368 part.value->invalidateDisplayItemClientsIncludingNonCompositingDescendan ts(&paintInvalidationContainer, PaintInvalidationScroll, &paintInvalidationRect) ; 368
369 // FIXME: invalidate only the changed part.
370 if (LayoutBox* owningLayoutObject = this->owningLayoutObject()) {
371 for (auto& part : m_parts)
372 owningLayoutObject->invalidateDisplayItemClientForNonCompositingDesc endantsOf(*part.value);
373 }
369 } 374 }
370 375
371 } 376 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutScrollbar.h ('k') | third_party/WebKit/Source/core/layout/LayoutScrollbarPart.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698