Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1037 ASSERT(RuntimeEnabledFeatures::repaintAfterLayoutEnabled()); | 1037 ASSERT(RuntimeEnabledFeatures::repaintAfterLayoutEnabled()); |
| 1038 ASSERT(!root->needsLayout()); | 1038 ASSERT(!root->needsLayout()); |
| 1039 // We should only repaint for the outer most layout. This works as | 1039 // We should only repaint for the outer most layout. This works as |
| 1040 // we continue to track repaint rects until this function is called. | 1040 // we continue to track repaint rects until this function is called. |
| 1041 ASSERT(!m_nestedLayoutCount); | 1041 ASSERT(!m_nestedLayoutCount); |
| 1042 | 1042 |
| 1043 // FIXME: really, we're in the repaint phase here, and the compositing queri es are legal. | 1043 // FIXME: really, we're in the repaint phase here, and the compositing queri es are legal. |
| 1044 // Until those states are fully fledged, I'll just disable the ASSERTS. | 1044 // Until those states are fully fledged, I'll just disable the ASSERTS. |
| 1045 DisableCompositingQueryAsserts disabler; | 1045 DisableCompositingQueryAsserts disabler; |
| 1046 | 1046 |
| 1047 // If the RenderView did a full invalidation, skip issuing invalidations for | |
| 1048 // the child RenderObjects as they will be covered by the RenderView invalid ation. | |
| 1049 if (root->isRenderView() && root->shouldDoFullRepaintAfterLayout()) { | |
|
Julien - ping for review
2014/03/31 20:00:56
I think we could simplify even further here as we
dsinclair
2014/03/31 20:10:24
Done.
| |
| 1050 root->repaintAfterLayoutIfNeeded(root->containerForRepaint(), | |
| 1051 root->shouldDoFullRepaintAfterLayout(), root->oldRepaintRect(), &(ro ot->newRepaintRect())); | |
| 1052 | |
| 1053 // Clear the invalidation flags for the root and child renderers. | |
| 1054 for (RenderObject* renderer = root; renderer; renderer = renderer->nextI nPreOrder()) { | |
| 1055 renderer->clearRepaintState(); | |
| 1056 } | |
| 1057 return; | |
| 1058 } | |
| 1059 | |
| 1047 for (RenderObject* renderer = root; renderer; renderer = renderer->nextInPre Order()) { | 1060 for (RenderObject* renderer = root; renderer; renderer = renderer->nextInPre Order()) { |
| 1048 const LayoutRect& oldRepaintRect = renderer->oldRepaintRect(); | 1061 renderer->updateShouldDoFullRepaintAfterLayout(); |
|
Julien - ping for review
2014/03/31 20:00:56
I find that this function obfuscate the code as 'u
dsinclair
2014/03/31 20:10:24
Done.
| |
| 1049 const LayoutRect& newRepaintRect = renderer->newRepaintRect(); | |
| 1050 | |
| 1051 if ((renderer->onlyNeededPositionedMovementLayout() && renderer->composi tingState() != PaintsIntoOwnBacking) | |
| 1052 || (renderer->shouldDoFullRepaintIfSelfPaintingLayer() | |
| 1053 && renderer->hasLayer() | |
| 1054 && toRenderLayerModelObject(renderer)->layer()->isSelfPaintingLa yer())) { | |
| 1055 renderer->setShouldDoFullRepaintAfterLayout(true); | |
| 1056 } | |
| 1057 | 1062 |
| 1058 // FIXME: Currently renderers with layers will get repainted when we cal l updateLayerPositionsAfterLayout. | 1063 // FIXME: Currently renderers with layers will get repainted when we cal l updateLayerPositionsAfterLayout. |
| 1059 // That call should be broken apart to position the layers be done befor e | 1064 // That call should be broken apart to position the layers be done befor e |
| 1060 // the repaintTree call so this will repaint everything. | 1065 // the repaintTree call so this will repaint everything. |
| 1061 bool didFullRepaint = false; | 1066 bool didFullRepaint = false; |
| 1062 if (!renderer->layoutDidGetCalled()) { | 1067 if (!renderer->layoutDidGetCalled()) { |
| 1063 if (renderer->shouldDoFullRepaintAfterLayout()) { | 1068 if (renderer->shouldDoFullRepaintAfterLayout()) { |
| 1064 renderer->repaint(); | 1069 renderer->repaint(); |
| 1065 didFullRepaint = true; | 1070 didFullRepaint = true; |
| 1066 } | 1071 } |
| 1067 | 1072 |
| 1068 } else { | 1073 } else { |
| 1069 didFullRepaint = renderer->repaintAfterLayoutIfNeeded(renderer->cont ainerForRepaint(), | 1074 didFullRepaint = renderer->repaintAfterLayoutIfNeeded(renderer->cont ainerForRepaint(), |
| 1070 renderer->shouldDoFullRepaintAfterLayout(), oldRepaintRect, &new RepaintRect); | 1075 renderer->shouldDoFullRepaintAfterLayout(), renderer->oldRepaint Rect(), &(renderer->newRepaintRect())); |
| 1071 } | 1076 } |
| 1072 | 1077 |
| 1073 if (!didFullRepaint) | 1078 if (!didFullRepaint) |
| 1074 renderer->repaintOverflowIfNeeded(); | 1079 renderer->repaintOverflowIfNeeded(); |
| 1075 | 1080 |
| 1076 // Repaint any scrollbars if there is a scrollable area for this rendere r. | 1081 // Repaint any scrollbars if there is a scrollable area for this rendere r. |
| 1077 if (RenderLayerScrollableArea* area = renderer->enclosingLayer()->scroll ableArea()) { | 1082 if (RenderLayerScrollableArea* area = renderer->enclosingLayer()->scroll ableArea()) { |
| 1078 if (area->hasVerticalBarDamage()) | 1083 if (area->hasVerticalBarDamage()) |
| 1079 renderer->repaintRectangle(area->verticalBarDamage()); | 1084 renderer->repaintRectangle(area->verticalBarDamage()); |
| 1080 if (area->hasHorizontalBarDamage()) | 1085 if (area->hasHorizontalBarDamage()) |
| (...skipping 2172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3253 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o rientation) | 3258 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o rientation) |
| 3254 { | 3259 { |
| 3255 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); | 3260 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); |
| 3256 if (AXObjectCache* cache = axObjectCache()) { | 3261 if (AXObjectCache* cache = axObjectCache()) { |
| 3257 cache->remove(scrollbar); | 3262 cache->remove(scrollbar); |
| 3258 cache->handleScrollbarUpdate(this); | 3263 cache->handleScrollbarUpdate(this); |
| 3259 } | 3264 } |
| 3260 } | 3265 } |
| 3261 | 3266 |
| 3262 } // namespace WebCore | 3267 } // namespace WebCore |
| OLD | NEW |