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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 1416053003: Let synchronized painting generate correct paint invalidation rects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: For landing Created 5 years, 2 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) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 return; 213 return;
214 214
215 if (scrollbar == verticalScrollbar()) 215 if (scrollbar == verticalScrollbar())
216 scrollRect.move(verticalScrollbarStart(0, box().size().width()), box().b orderTop()); 216 scrollRect.move(verticalScrollbarStart(0, box().size().width()), box().b orderTop());
217 else 217 else
218 scrollRect.move(horizontalScrollbarStart(0), box().size().height() - box ().borderBottom() - scrollbar->height()); 218 scrollRect.move(horizontalScrollbarStart(0), box().size().height() - box ().borderBottom() - scrollbar->height());
219 219
220 if (scrollRect.isEmpty()) 220 if (scrollRect.isEmpty())
221 return; 221 return;
222 222
223 box().invalidateDisplayItemClient(*scrollbar);
224
225 LayoutRect paintInvalidationRect = LayoutRect(scrollRect); 223 LayoutRect paintInvalidationRect = LayoutRect(scrollRect);
226 box().flipForWritingMode(paintInvalidationRect); 224 box().flipForWritingMode(paintInvalidationRect);
227 225
228 IntRect intRect = pixelSnappedIntRect(paintInvalidationRect); 226 IntRect intRect = pixelSnappedIntRect(paintInvalidationRect);
229 227
230 if (box().frameView()->isInPerformLayout()) { 228 if (box().frameView()->isInPerformLayout()) {
231 addScrollbarDamage(scrollbar, intRect); 229 addScrollbarDamage(scrollbar, intRect);
232 } else { 230 } else {
233 // FIXME: We should not allow paint invalidation out of paint invalidati on state. crbug.com/457415 231 // FIXME: We should not allow paint invalidation out of paint invalidati on state. crbug.com/457415
234 DisablePaintInvalidationStateAsserts disabler; 232 DisablePaintInvalidationStateAsserts disabler;
235 // We have invalidated the displayItemClient of the scrollbar, but for n ow we still need to 233 // We have invalidated the displayItemClient of the scrollbar, but for n ow we still need to
236 // invalidate the rectangles to trigger repaints. 234 // invalidate the rectangles to trigger repaints.
237 box().invalidatePaintRectangleNotInvalidatingDisplayItemClients(LayoutRe ct(intRect)); 235 box().invalidatePaintRectangleNotInvalidatingDisplayItemClients(LayoutRe ct(intRect));
236 box().invalidateDisplayItemClient(*scrollbar);
238 } 237 }
239 } 238 }
240 239
241 void PaintLayerScrollableArea::invalidateScrollCornerRect(const IntRect& rect) 240 void PaintLayerScrollableArea::invalidateScrollCornerRect(const IntRect& rect)
242 { 241 {
243 ASSERT(!layerForScrollCorner()); 242 ASSERT(!layerForScrollCorner());
244 243
245 if (m_scrollCorner) { 244 if (m_scrollCorner) {
246 // FIXME: We should not allow paint invalidation out of paint invalidati on state. crbug.com/457415 245 // FIXME: We should not allow paint invalidation out of paint invalidati on state. crbug.com/457415
247 DisablePaintInvalidationStateAsserts disabler; 246 DisablePaintInvalidationStateAsserts disabler;
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1560 return widget.release(); 1559 return widget.release();
1561 } 1560 }
1562 1561
1563 void PaintLayerScrollableArea::ScrollbarManager::destroyScrollbar(ScrollbarOrien tation orientation, bool invalidate) 1562 void PaintLayerScrollableArea::ScrollbarManager::destroyScrollbar(ScrollbarOrien tation orientation, bool invalidate)
1564 { 1563 {
1565 RefPtrWillBeMember<Scrollbar>& scrollbar = orientation == HorizontalScrollba r ? m_hBar : m_vBar; 1564 RefPtrWillBeMember<Scrollbar>& scrollbar = orientation == HorizontalScrollba r ? m_hBar : m_vBar;
1566 ASSERT(orientation == HorizontalScrollbar ? !m_hBarIsAttached: !m_vBarIsAtta ched); 1565 ASSERT(orientation == HorizontalScrollbar ? !m_hBarIsAttached: !m_vBarIsAtta ched);
1567 if (!scrollbar) 1566 if (!scrollbar)
1568 return; 1567 return;
1569 1568
1570 if (invalidate) 1569 if (invalidate) {
1570 m_scrollableArea->box().invalidateDisplayItemClient(*scrollbar);
1571 scrollbar->invalidate(); 1571 scrollbar->invalidate();
1572 }
1572 if (!scrollbar->isCustomScrollbar()) 1573 if (!scrollbar->isCustomScrollbar())
1573 m_scrollableArea->willRemoveScrollbar(scrollbar.get(), orientation); 1574 m_scrollableArea->willRemoveScrollbar(scrollbar.get(), orientation);
1574 1575
1575 toFrameView(scrollbar->parent())->removeChild(scrollbar.get()); 1576 toFrameView(scrollbar->parent())->removeChild(scrollbar.get());
1576 scrollbar->disconnectFromScrollableArea(); 1577 scrollbar->disconnectFromScrollableArea();
1577 scrollbar = nullptr; 1578 scrollbar = nullptr;
1578 } 1579 }
1579 1580
1580 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager) 1581 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager)
1581 { 1582 {
1582 visitor->trace(m_scrollableArea); 1583 visitor->trace(m_scrollableArea);
1583 visitor->trace(m_hBar); 1584 visitor->trace(m_hBar);
1584 visitor->trace(m_vBar); 1585 visitor->trace(m_vBar);
1585 } 1586 }
1586 1587
1587 } // namespace blink 1588 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.cpp ('k') | third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698