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

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

Issue 369483004: Revert of Move paint invalidation after compositing update (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | « Source/core/frame/FrameView.h ('k') | 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 934 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 // We need to set m_doFullPaintInvalidation before triggering layout as RenderObject::checkForPaintInvalidation 945 // We need to set m_doFullPaintInvalidation before triggering layout as RenderObject::checkForPaintInvalidation
946 // checks the boolean to disable local paint invalidations. 946 // checks the boolean to disable local paint invalidations.
947 m_doFullPaintInvalidation |= renderView()->shouldDoFullRepaintForNex tLayout(); 947 m_doFullPaintInvalidation |= renderView()->shouldDoFullRepaintForNex tLayout();
948 } 948 }
949 949
950 layer = rootForThisLayout->enclosingLayer(); 950 layer = rootForThisLayout->enclosingLayer();
951 951
952 performLayout(rootForThisLayout, inSubtreeLayout); 952 performLayout(rootForThisLayout, inSubtreeLayout);
953 953
954 m_layoutSubtreeRoot = 0; 954 m_layoutSubtreeRoot = 0;
955 // The following loop ensures that we mark up all renderers up to the Re nderView
956 // for paint invalidation. This simplifies our code as we just always do a full
957 // tree walk. FIXME: This loop will probably make us over-mark as we don 't skip
958 // containers and we can't use containingBlock as it skips some cases (s ee markContainingBlocksForLayout).
959 if (RenderObject* container = rootForThisLayout->container())
960 container->setMayNeedPaintInvalidation(true);
961 } // Reset m_layoutSchedulingEnabled to its previous value. 955 } // Reset m_layoutSchedulingEnabled to its previous value.
962 956
963 if (!inSubtreeLayout && !toRenderView(rootForThisLayout)->document().printin g()) 957 if (!inSubtreeLayout && !toRenderView(rootForThisLayout)->document().printin g())
964 adjustViewSize(); 958 adjustViewSize();
965 959
966 layer->updateLayerPositionsAfterLayout(renderView()->layer(), updateLayerPos itionFlags(layer, inSubtreeLayout, m_doFullPaintInvalidation)); 960 layer->updateLayerPositionsAfterLayout(renderView()->layer(), updateLayerPos itionFlags(layer, inSubtreeLayout, m_doFullPaintInvalidation));
967 renderView()->compositor()->didLayout(); 961 renderView()->compositor()->didLayout();
968 962
969 m_layoutCount++; 963 m_layoutCount++;
970 964
(...skipping 12 matching lines...) Expand all
983 scheduleOrPerformPostLayoutTasks(); 977 scheduleOrPerformPostLayoutTasks();
984 978
985 TRACE_EVENT_END1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Layout", " endData", InspectorLayoutEvent::endData(rootForThisLayout)); 979 TRACE_EVENT_END1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Layout", " endData", InspectorLayoutEvent::endData(rootForThisLayout));
986 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli ne migrates to tracing. 980 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeli ne migrates to tracing.
987 InspectorInstrumentation::didLayout(cookie, rootForThisLayout); 981 InspectorInstrumentation::didLayout(cookie, rootForThisLayout);
988 982
989 m_nestedLayoutCount--; 983 m_nestedLayoutCount--;
990 if (m_nestedLayoutCount) 984 if (m_nestedLayoutCount)
991 return; 985 return;
992 986
987 invalidateTree(rootForThisLayout);
988
989 m_doFullPaintInvalidation = false;
990
993 #ifndef NDEBUG 991 #ifndef NDEBUG
994 // Post-layout assert that nobody was re-marked as needing layout during lay out. 992 // Post-layout assert that nobody was re-marked as needing layout during lay out.
995 document->renderView()->assertSubtreeIsLaidOut(); 993 document->renderView()->assertSubtreeIsLaidOut();
996 #endif 994 #endif
997 995
998 // FIXME: It should be not possible to remove the FrameView from the frame/p age during layout 996 // FIXME: It should be not possible to remove the FrameView from the frame/p age during layout
999 // however m_inPerformLayout is not set for most of this function, so none o f our RELEASE_ASSERTS 997 // however m_inPerformLayout is not set for most of this function, so none o f our RELEASE_ASSERTS
1000 // in LocalFrame/Page will fire. One of the post-layout tasks is disconnecti ng the LocalFrame from 998 // in LocalFrame/Page will fire. One of the post-layout tasks is disconnecti ng the LocalFrame from
1001 // the page in fast/frames/crash-remove-iframe-during-object-beforeload-2.ht ml 999 // the page in fast/frames/crash-remove-iframe-during-object-beforeload-2.ht ml
1002 // necessitating this check here. 1000 // necessitating this check here.
1003 // ASSERT(frame()->page()); 1001 // ASSERT(frame()->page());
1004 if (frame().page()) 1002 if (frame().page())
1005 frame().page()->chrome().client().layoutUpdated(m_frame.get()); 1003 frame().page()->chrome().client().layoutUpdated(m_frame.get());
1006 } 1004 }
1007 1005
1008 // The plan is to move to compositor-queried paint invalidation, in which case t his 1006 // The plan is to move to compositor-queried paint invalidation, in which case t his
1009 // method would setNeedsRedraw on the GraphicsLayers with invalidations and 1007 // method would setNeedsRedraw on the GraphicsLayers with invalidations and
1010 // let the compositor pick which to actually draw. 1008 // let the compositor pick which to actually draw.
1011 // See http://crbug.com/306706 1009 // See http://crbug.com/306706
1012 void FrameView::invalidateTreeIfNeeded() 1010 void FrameView::invalidateTree(RenderObject* root)
1013 { 1011 {
1014 RenderObject* rootForPaintInvalidation = renderView(); 1012 ASSERT(!root->needsLayout());
1015 ASSERT(!rootForPaintInvalidation->needsLayout()); 1013 // We should only invalidate paints for the outer most layout. This works as
1014 // we continue to track paint invalidation rects until this function is call ed.
1015 ASSERT(!m_nestedLayoutCount);
1016 1016
1017 TRACE_EVENT1("blink", "FrameView::invalidateTree", "root", rootForPaintInval idation->debugName().ascii()); 1017 TRACE_EVENT1("blink", "FrameView::invalidateTree", "root", root->debugName() .ascii());
1018 1018
1019 LayoutState rootLayoutState(*rootForPaintInvalidation); 1019 // FIXME: really, we're in the paint invalidation phase here, and the compos iting queries are legal.
1020 // Until those states are fully fledged, I'll just disable the ASSERTS.
1021 DisableCompositingQueryAsserts compositingQueryAssertsDisabler;
1020 1022
1021 rootForPaintInvalidation->invalidateTreeAfterLayout(*rootForPaintInvalidatio n->containerForPaintInvalidation()); 1023 LayoutState rootLayoutState(*root);
1024
1025 root->invalidateTreeAfterLayout(*root->containerForPaintInvalidation());
1022 1026
1023 // Invalidate the paint of the frameviews scrollbars if needed 1027 // Invalidate the paint of the frameviews scrollbars if needed
1024 if (hasVerticalBarDamage()) 1028 if (hasVerticalBarDamage())
1025 invalidateRect(verticalBarDamage()); 1029 invalidateRect(verticalBarDamage());
1026 if (hasHorizontalBarDamage()) 1030 if (hasHorizontalBarDamage())
1027 invalidateRect(horizontalBarDamage()); 1031 invalidateRect(horizontalBarDamage());
1028 resetScrollbarDamage(); 1032 resetScrollbarDamage();
1029
1030 m_doFullPaintInvalidation = false;
1031 } 1033 }
1032 1034
1033 DocumentLifecycle& FrameView::lifecycle() const 1035 DocumentLifecycle& FrameView::lifecycle() const
1034 { 1036 {
1035 return m_frame->document()->lifecycle(); 1037 return m_frame->document()->lifecycle();
1036 } 1038 }
1037 1039
1038 void FrameView::gatherDebugLayoutRects(RenderObject* layoutRoot) 1040 void FrameView::gatherDebugLayoutRects(RenderObject* layoutRoot)
1039 { 1041 {
1040 bool isTracing; 1042 bool isTracing;
(...skipping 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after
2811 2813
2812 if (RenderView* view = renderView()) { 2814 if (RenderView* view = renderView()) {
2813 InspectorInstrumentation::willUpdateLayerTree(view->frame()); 2815 InspectorInstrumentation::willUpdateLayerTree(view->frame());
2814 2816
2815 view->compositor()->updateIfNeededRecursive(); 2817 view->compositor()->updateIfNeededRecursive();
2816 2818
2817 if (view->compositor()->inCompositingMode() && m_frame->isMainFrame()) 2819 if (view->compositor()->inCompositingMode() && m_frame->isMainFrame())
2818 m_frame->page()->scrollingCoordinator()->updateAfterCompositingChang eIfNeeded(); 2820 m_frame->page()->scrollingCoordinator()->updateAfterCompositingChang eIfNeeded();
2819 2821
2820 InspectorInstrumentation::didUpdateLayerTree(view->frame()); 2822 InspectorInstrumentation::didUpdateLayerTree(view->frame());
2821
2822 invalidateTreeIfNeededRecursive();
2823 } 2823 }
2824 2824
2825 scrollContentsIfNeededRecursive(); 2825 scrollContentsIfNeededRecursive();
2826 } 2826 }
2827 2827
2828 void FrameView::updateLayoutAndStyleIfNeededRecursive() 2828 void FrameView::updateLayoutAndStyleIfNeededRecursive()
2829 { 2829 {
2830 // We have to crawl our entire tree looking for any FrameViews that need 2830 // We have to crawl our entire tree looking for any FrameViews that need
2831 // layout and make sure they are up to date. 2831 // layout and make sure they are up to date.
2832 // Mac actually tests for intersection with the dirty region and tries not t o 2832 // Mac actually tests for intersection with the dirty region and tries not t o
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
2868 2868
2869 // These asserts ensure that parent frames are clean, when child frames fini shed updating layout and style. 2869 // These asserts ensure that parent frames are clean, when child frames fini shed updating layout and style.
2870 ASSERT(!needsLayout()); 2870 ASSERT(!needsLayout());
2871 ASSERT(!m_frame->document()->hasSVGFilterElementsRequiringLayerUpdate()); 2871 ASSERT(!m_frame->document()->hasSVGFilterElementsRequiringLayerUpdate());
2872 #ifndef NDEBUG 2872 #ifndef NDEBUG
2873 m_frame->document()->renderView()->assertRendererLaidOut(); 2873 m_frame->document()->renderView()->assertRendererLaidOut();
2874 #endif 2874 #endif
2875 2875
2876 } 2876 }
2877 2877
2878 void FrameView::invalidateTreeIfNeededRecursive()
2879 {
2880 // FIXME: We should be more aggressive at cutting tree traversals.
2881 invalidateTreeIfNeeded();
2882
2883 for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree ().nextSibling()) {
2884 if (!child->isLocalFrame())
2885 continue;
2886
2887 toLocalFrame(child)->view()->invalidateTreeIfNeededRecursive();
2888 }
2889 }
2890
2891 void FrameView::enableAutoSizeMode(bool enable, const IntSize& minSize, const In tSize& maxSize) 2878 void FrameView::enableAutoSizeMode(bool enable, const IntSize& minSize, const In tSize& maxSize)
2892 { 2879 {
2893 ASSERT(!enable || !minSize.isEmpty()); 2880 ASSERT(!enable || !minSize.isEmpty());
2894 ASSERT(minSize.width() <= maxSize.width()); 2881 ASSERT(minSize.width() <= maxSize.width());
2895 ASSERT(minSize.height() <= maxSize.height()); 2882 ASSERT(minSize.height() <= maxSize.height());
2896 2883
2897 if (m_shouldAutoSize == enable && m_minAutoSize == minSize && m_maxAutoSize == maxSize) 2884 if (m_shouldAutoSize == enable && m_minAutoSize == minSize && m_maxAutoSize == maxSize)
2898 return; 2885 return;
2899 2886
2900 2887
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
3272 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o rientation) 3259 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o rientation)
3273 { 3260 {
3274 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); 3261 ScrollableArea::willRemoveScrollbar(scrollbar, orientation);
3275 if (AXObjectCache* cache = axObjectCache()) { 3262 if (AXObjectCache* cache = axObjectCache()) {
3276 cache->remove(scrollbar); 3263 cache->remove(scrollbar);
3277 cache->handleScrollbarUpdate(this); 3264 cache->handleScrollbarUpdate(this);
3278 } 3265 }
3279 } 3266 }
3280 3267
3281 } // namespace WebCore 3268 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698