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

Side by Side Diff: Source/core/frame/FrameView.cpp

Issue 212553004: [repaint-after-layout] Skip invalidations if our RenderView did a full invalidation. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 981 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 992
993 scheduleOrPerformPostLayoutTasks(); 993 scheduleOrPerformPostLayoutTasks();
994 994
995 InspectorInstrumentation::didLayout(cookie, rootForThisLayout); 995 InspectorInstrumentation::didLayout(cookie, rootForThisLayout);
996 996
997 m_nestedLayoutCount--; 997 m_nestedLayoutCount--;
998 if (m_nestedLayoutCount) 998 if (m_nestedLayoutCount)
999 return; 999 return;
1000 1000
1001 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) { 1001 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) {
1002 if (m_doFullRepaint)
1003 renderView()->setShouldDoFullRepaintAfterLayout(true);
1004
1005 repaintTree(rootForThisLayout); 1002 repaintTree(rootForThisLayout);
1006 1003
1007 } else if (m_doFullRepaint) { 1004 } else if (m_doFullRepaint) {
1008 // FIXME: This isn't really right, since the RenderView doesn't fully en compass 1005 // FIXME: This isn't really right, since the RenderView doesn't fully en compass
1009 // the visibleContentRect(). It just happens to work out most of the tim e, 1006 // the visibleContentRect(). It just happens to work out most of the tim e,
1010 // since first layouts and printing don't have you scrolled anywhere. 1007 // since first layouts and printing don't have you scrolled anywhere.
1011 renderView()->repaint(); 1008 renderView()->repaint();
1012 } 1009 }
1013 1010
1014 m_doFullRepaint = false; 1011 m_doFullRepaint = false;
(...skipping 22 matching lines...) Expand all
1037 ASSERT(RuntimeEnabledFeatures::repaintAfterLayoutEnabled()); 1034 ASSERT(RuntimeEnabledFeatures::repaintAfterLayoutEnabled());
1038 ASSERT(!root->needsLayout()); 1035 ASSERT(!root->needsLayout());
1039 // We should only repaint for the outer most layout. This works as 1036 // We should only repaint for the outer most layout. This works as
1040 // we continue to track repaint rects until this function is called. 1037 // we continue to track repaint rects until this function is called.
1041 ASSERT(!m_nestedLayoutCount); 1038 ASSERT(!m_nestedLayoutCount);
1042 1039
1043 // FIXME: really, we're in the repaint phase here, and the compositing queri es are legal. 1040 // 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. 1041 // Until those states are fully fledged, I'll just disable the ASSERTS.
1045 DisableCompositingQueryAsserts disabler; 1042 DisableCompositingQueryAsserts disabler;
1046 1043
1044 // If we are set to do a full repaint that means the RenderView will be
1045 // invalidated. We can then skip issuing of invalidations for the child
1046 // renderers as they'll be covered by the RenderView.
1047 if (m_doFullRepaint) {
1048 RenderView* view = renderView();
1049 view->repaintAfterLayoutIfNeeded(view->containerForRepaint(), true, view ->oldRepaintRect(), &(view->newRepaintRect()));
1050
1051 // Clear the invalidation flags for the root and child renderers.
1052 for (RenderObject* renderer = root; renderer; renderer = renderer->nextI nPreOrder()) {
1053 renderer->clearRepaintState();
1054 }
1055 return;
1056 }
1057
1058 ASSERT(!m_doFullRepaint);
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();
1049 const LayoutRect& newRepaintRect = renderer->newRepaintRect();
1050
1051 if ((renderer->onlyNeededPositionedMovementLayout() && renderer->composi tingState() != PaintsIntoOwnBacking) 1061 if ((renderer->onlyNeededPositionedMovementLayout() && renderer->composi tingState() != PaintsIntoOwnBacking)
1052 || (renderer->shouldDoFullRepaintIfSelfPaintingLayer() 1062 || (renderer->shouldDoFullRepaintIfSelfPaintingLayer()
1053 && renderer->hasLayer() 1063 && renderer->hasLayer()
1054 && toRenderLayerModelObject(renderer)->layer()->isSelfPaintingLa yer())) { 1064 && toRenderLayerModelObject(renderer)->layer()->isSelfPaintingLa yer())) {
1055 renderer->setShouldDoFullRepaintAfterLayout(true); 1065 renderer->setShouldDoFullRepaintAfterLayout(true);
1056 } 1066 }
1057 1067
1058 // FIXME: Currently renderers with layers will get repainted when we cal l updateLayerPositionsAfterLayout. 1068 // 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 1069 // That call should be broken apart to position the layers be done befor e
1060 // the repaintTree call so this will repaint everything. 1070 // the repaintTree call so this will repaint everything.
1061 bool didFullRepaint = false; 1071 bool didFullRepaint = false;
1062 if (!renderer->layoutDidGetCalled()) { 1072 if (!renderer->layoutDidGetCalled()) {
1063 if (renderer->shouldDoFullRepaintAfterLayout()) { 1073 if (renderer->shouldDoFullRepaintAfterLayout()) {
1064 renderer->repaint(); 1074 renderer->repaint();
1065 didFullRepaint = true; 1075 didFullRepaint = true;
1066 } 1076 }
1067 1077
1068 } else { 1078 } else {
1069 didFullRepaint = renderer->repaintAfterLayoutIfNeeded(renderer->cont ainerForRepaint(), 1079 didFullRepaint = renderer->repaintAfterLayoutIfNeeded(renderer->cont ainerForRepaint(),
1070 renderer->shouldDoFullRepaintAfterLayout(), oldRepaintRect, &new RepaintRect); 1080 renderer->shouldDoFullRepaintAfterLayout(), renderer->oldRepaint Rect(), &(renderer->newRepaintRect()));
1071 } 1081 }
1072 1082
1073 if (!didFullRepaint) 1083 if (!didFullRepaint)
1074 renderer->repaintOverflowIfNeeded(); 1084 renderer->repaintOverflowIfNeeded();
1075 1085
1076 // Repaint any scrollbars if there is a scrollable area for this rendere r. 1086 // Repaint any scrollbars if there is a scrollable area for this rendere r.
1077 if (RenderLayerScrollableArea* area = renderer->enclosingLayer()->scroll ableArea()) { 1087 if (RenderLayerScrollableArea* area = renderer->enclosingLayer()->scroll ableArea()) {
1078 if (area->hasVerticalBarDamage()) 1088 if (area->hasVerticalBarDamage())
1079 renderer->repaintRectangle(area->verticalBarDamage()); 1089 renderer->repaintRectangle(area->verticalBarDamage());
1080 if (area->hasHorizontalBarDamage()) 1090 if (area->hasHorizontalBarDamage())
(...skipping 2172 matching lines...) Expand 10 before | Expand all | Expand 10 after
3253 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o rientation) 3263 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o rientation)
3254 { 3264 {
3255 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); 3265 ScrollableArea::willRemoveScrollbar(scrollbar, orientation);
3256 if (AXObjectCache* cache = axObjectCache()) { 3266 if (AXObjectCache* cache = axObjectCache()) {
3257 cache->remove(scrollbar); 3267 cache->remove(scrollbar);
3258 cache->handleScrollbarUpdate(this); 3268 cache->handleScrollbarUpdate(this);
3259 } 3269 }
3260 } 3270 }
3261 3271
3262 } // namespace WebCore 3272 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698