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

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 RenderObject* view = renderView();
Julien - ping for review 2014/03/31 20:28:35 RenderView* view = renderView()!!!
dsinclair 2014/03/31 20:53:52 Done.
1049 view->repaintAfterLayoutIfNeeded(view->containerForRepaint(), true, view ->oldRepaintRect(), &(view->newRepaintRect()));
1050
1051 // Clear the invalidation flags for the render view and child renderers.
1052 for (RenderObject* renderer = view; renderer; renderer = renderer->nextI nPreOrder()) {
Julien - ping for review 2014/03/31 20:28:35 Shouldn't this be done on the |root|-rooted subtre
dsinclair 2014/03/31 20:53:52 Done. Keeping view as it's used 4 times on the rep
1053 renderer->clearRepaintState();
1054 }
1055 return;
1056 }
1057
Julien - ping for review 2014/03/31 20:28:35 How about adding an ASSERT here that we don't need
dsinclair 2014/03/31 20:53:52 Done.
1047 for (RenderObject* renderer = root; renderer; renderer = renderer->nextInPre Order()) { 1058 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) 1059 if ((renderer->onlyNeededPositionedMovementLayout() && renderer->composi tingState() != PaintsIntoOwnBacking)
1052 || (renderer->shouldDoFullRepaintIfSelfPaintingLayer() 1060 || (renderer->shouldDoFullRepaintIfSelfPaintingLayer()
1053 && renderer->hasLayer() 1061 && renderer->hasLayer()
1054 && toRenderLayerModelObject(renderer)->layer()->isSelfPaintingLa yer())) { 1062 && toRenderLayerModelObject(renderer)->layer()->isSelfPaintingLa yer())) {
1055 renderer->setShouldDoFullRepaintAfterLayout(true); 1063 renderer->setShouldDoFullRepaintAfterLayout(true);
1056 } 1064 }
1057 1065
1058 // FIXME: Currently renderers with layers will get repainted when we cal l updateLayerPositionsAfterLayout. 1066 // 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 1067 // That call should be broken apart to position the layers be done befor e
1060 // the repaintTree call so this will repaint everything. 1068 // the repaintTree call so this will repaint everything.
1061 bool didFullRepaint = false; 1069 bool didFullRepaint = false;
1062 if (!renderer->layoutDidGetCalled()) { 1070 if (!renderer->layoutDidGetCalled()) {
1063 if (renderer->shouldDoFullRepaintAfterLayout()) { 1071 if (renderer->shouldDoFullRepaintAfterLayout()) {
1064 renderer->repaint(); 1072 renderer->repaint();
1065 didFullRepaint = true; 1073 didFullRepaint = true;
1066 } 1074 }
1067 1075
1068 } else { 1076 } else {
1069 didFullRepaint = renderer->repaintAfterLayoutIfNeeded(renderer->cont ainerForRepaint(), 1077 didFullRepaint = renderer->repaintAfterLayoutIfNeeded(renderer->cont ainerForRepaint(),
1070 renderer->shouldDoFullRepaintAfterLayout(), oldRepaintRect, &new RepaintRect); 1078 renderer->shouldDoFullRepaintAfterLayout(), renderer->oldRepaint Rect(), &(renderer->newRepaintRect()));
1071 } 1079 }
1072 1080
1073 if (!didFullRepaint) 1081 if (!didFullRepaint)
1074 renderer->repaintOverflowIfNeeded(); 1082 renderer->repaintOverflowIfNeeded();
1075 1083
1076 // Repaint any scrollbars if there is a scrollable area for this rendere r. 1084 // Repaint any scrollbars if there is a scrollable area for this rendere r.
1077 if (RenderLayerScrollableArea* area = renderer->enclosingLayer()->scroll ableArea()) { 1085 if (RenderLayerScrollableArea* area = renderer->enclosingLayer()->scroll ableArea()) {
1078 if (area->hasVerticalBarDamage()) 1086 if (area->hasVerticalBarDamage())
1079 renderer->repaintRectangle(area->verticalBarDamage()); 1087 renderer->repaintRectangle(area->verticalBarDamage());
1080 if (area->hasHorizontalBarDamage()) 1088 if (area->hasHorizontalBarDamage())
(...skipping 2172 matching lines...) Expand 10 before | Expand all | Expand 10 after
3253 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o rientation) 3261 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o rientation)
3254 { 3262 {
3255 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); 3263 ScrollableArea::willRemoveScrollbar(scrollbar, orientation);
3256 if (AXObjectCache* cache = axObjectCache()) { 3264 if (AXObjectCache* cache = axObjectCache()) {
3257 cache->remove(scrollbar); 3265 cache->remove(scrollbar);
3258 cache->handleScrollbarUpdate(this); 3266 cache->handleScrollbarUpdate(this);
3259 } 3267 }
3260 } 3268 }
3261 3269
3262 } // namespace WebCore 3270 } // 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