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

Side by Side Diff: sky/engine/core/frame/FrameView.cpp

Issue 755843003: Remove compositing states from DocumentLifeCycle. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « sky/engine/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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 // in LocalFrame/Page will fire. One of the post-layout tasks is disconnecti ng the LocalFrame from 402 // in LocalFrame/Page will fire. One of the post-layout tasks is disconnecti ng the LocalFrame from
403 // the page in fast/frames/crash-remove-iframe-during-object-beforeload-2.ht ml 403 // the page in fast/frames/crash-remove-iframe-during-object-beforeload-2.ht ml
404 // necessitating this check here. 404 // necessitating this check here.
405 // ASSERT(frame()->page()); 405 // ASSERT(frame()->page());
406 if (frame().page()) 406 if (frame().page())
407 frame().page()->chrome().client().layoutUpdated(m_frame.get()); 407 frame().page()->chrome().client().layoutUpdated(m_frame.get());
408 } 408 }
409 409
410 void FrameView::invalidateTreeIfNeeded() 410 void FrameView::invalidateTreeIfNeeded()
411 { 411 {
412 lifecycle().advanceTo(DocumentLifecycle::InPaintInvalidation);
413
412 ASSERT(renderView()); 414 ASSERT(renderView());
413 RenderView& rootForPaintInvalidation = *renderView(); 415 RenderView& rootForPaintInvalidation = *renderView();
414 ASSERT(!rootForPaintInvalidation.needsLayout()); 416 ASSERT(!rootForPaintInvalidation.needsLayout());
415 417
416 TRACE_EVENT1("blink", "FrameView::invalidateTree", "root", rootForPaintInval idation.debugName().ascii().data()); 418 TRACE_EVENT1("blink", "FrameView::invalidateTree", "root", rootForPaintInval idation.debugName().ascii().data());
417 419
418 PaintInvalidationState rootPaintInvalidationState(rootForPaintInvalidation); 420 PaintInvalidationState rootPaintInvalidationState(rootForPaintInvalidation);
419 421
420 rootForPaintInvalidation.invalidateTreeIfNeeded(rootPaintInvalidationState); 422 rootForPaintInvalidation.invalidateTreeIfNeeded(rootPaintInvalidationState);
421 423
422 m_doFullPaintInvalidation = false; 424 m_doFullPaintInvalidation = false;
423 #ifndef NDEBUG 425 #ifndef NDEBUG
424 renderView()->assertSubtreeClearedPaintInvalidationState(); 426 renderView()->assertSubtreeClearedPaintInvalidationState();
425 #endif 427 #endif
426 428
427 if (m_frame->selection().isCaretBoundsDirty()) 429 if (m_frame->selection().isCaretBoundsDirty())
428 m_frame->selection().invalidateCaretRect(); 430 m_frame->selection().invalidateCaretRect();
431
432 lifecycle().advanceTo(DocumentLifecycle::PaintInvalidationClean);
429 } 433 }
430 434
431 DocumentLifecycle& FrameView::lifecycle() const 435 DocumentLifecycle& FrameView::lifecycle() const
432 { 436 {
433 return m_frame->document()->lifecycle(); 437 return m_frame->document()->lifecycle();
434 } 438 }
435 439
436 void FrameView::setMediaType(const AtomicString& mediaType) 440 void FrameView::setMediaType(const AtomicString& mediaType)
437 { 441 {
438 ASSERT(m_frame->document()); 442 ASSERT(m_frame->document());
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 p->fillRect(rect, Color(0xFF, 0, 0)); 795 p->fillRect(rect, Color(0xFF, 0, 0));
792 #endif 796 #endif
793 797
794 RenderView* renderView = this->renderView(); 798 RenderView* renderView = this->renderView();
795 if (!renderView) { 799 if (!renderView) {
796 WTF_LOG_ERROR("called FrameView::paint with nil renderer"); 800 WTF_LOG_ERROR("called FrameView::paint with nil renderer");
797 return; 801 return;
798 } 802 }
799 803
800 RELEASE_ASSERT(!needsLayout()); 804 RELEASE_ASSERT(!needsLayout());
801 ASSERT(document->lifecycle().state() >= DocumentLifecycle::CompositingClean) ; 805 ASSERT(document->lifecycle().state() >= DocumentLifecycle::PaintInvalidation Clean);
802 806
803 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Paint", "data" , InspectorPaintEvent::data(renderView, rect)); 807 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Paint", "data" , InspectorPaintEvent::data(renderView, rect));
804 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), " CallStack", TRACE_EVENT_SCOPE_PROCESS, "stack", InspectorCallStackEvent::current CallStack()); 808 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), " CallStack", TRACE_EVENT_SCOPE_PROCESS, "stack", InspectorCallStackEvent::current CallStack());
805 809
806 bool isTopLevelPainter = !s_inPaintContents; 810 bool isTopLevelPainter = !s_inPaintContents;
807 s_inPaintContents = true; 811 s_inPaintContents = true;
808 812
809 FontCachePurgePreventer fontCachePurgePreventer; 813 FontCachePurgePreventer fontCachePurgePreventer;
810 814
811 PaintBehavior oldPaintBehavior = m_paintBehavior; // FIXME(sky): is this nee ded? 815 PaintBehavior oldPaintBehavior = m_paintBehavior; // FIXME(sky): is this nee ded?
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 869
866 void FrameView::updateLayoutAndStyleForPainting() 870 void FrameView::updateLayoutAndStyleForPainting()
867 { 871 {
868 // Updating layout can run script, which can tear down the FrameView. 872 // Updating layout can run script, which can tear down the FrameView.
869 RefPtr<FrameView> protector(this); 873 RefPtr<FrameView> protector(this);
870 874
871 updateLayoutAndStyleIfNeededRecursive(); 875 updateLayoutAndStyleIfNeededRecursive();
872 876
873 if (RenderView* view = renderView()) { 877 if (RenderView* view = renderView()) {
874 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "In validateTreeAndUpdateIframes", TRACE_EVENT_SCOPE_PROCESS, "frame", m_frame.get() ); 878 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "In validateTreeAndUpdateIframes", TRACE_EVENT_SCOPE_PROCESS, "frame", m_frame.get() );
875 invalidateTreeIfNeededRecursive(); 879 invalidateTreeIfNeeded();
876 view->updateIFramesAfterLayout(); 880 view->updateIFramesAfterLayout();
877 } 881 }
878 882
879 ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean); 883 ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean);
880 } 884 }
881 885
882 void FrameView::updateLayoutAndStyleIfNeededRecursive() 886 void FrameView::updateLayoutAndStyleIfNeededRecursive()
883 { 887 {
884 // We have to crawl our entire tree looking for any FrameViews that need 888 // We have to crawl our entire tree looking for any FrameViews that need
885 // layout and make sure they are up to date. 889 // layout and make sure they are up to date.
(...skipping 11 matching lines...) Expand all
897 901
898 // These asserts ensure that parent frames are clean, when child frames fini shed updating layout and style. 902 // These asserts ensure that parent frames are clean, when child frames fini shed updating layout and style.
899 ASSERT(!needsLayout()); 903 ASSERT(!needsLayout());
900 904
901 #if ENABLE(ASSERT) 905 #if ENABLE(ASSERT)
902 m_frame->document()->renderView()->assertRendererLaidOut(); 906 m_frame->document()->renderView()->assertRendererLaidOut();
903 #endif 907 #endif
904 908
905 } 909 }
906 910
907 void FrameView::invalidateTreeIfNeededRecursive()
ojan 2014/12/02 17:16:42 This used to walk the frame tree. No need for this
908 {
909 // FIXME: We should be more aggressive at cutting tree traversals.
910 lifecycle().advanceTo(DocumentLifecycle::InPaintInvalidation);
911 invalidateTreeIfNeeded();
912 lifecycle().advanceTo(DocumentLifecycle::PaintInvalidationClean);
913 }
914
915 void FrameView::forceLayout(bool allowSubtree) 911 void FrameView::forceLayout(bool allowSubtree)
916 { 912 {
917 layout(allowSubtree); 913 layout(allowSubtree);
918 } 914 }
919 915
920 IntRect FrameView::convertFromRenderer(const RenderObject& renderer, const IntRe ct& rendererRect) const 916 IntRect FrameView::convertFromRenderer(const RenderObject& renderer, const IntRe ct& rendererRect) const
921 { 917 {
922 return pixelSnappedIntRect(enclosingLayoutRect(renderer.localToAbsoluteQuad( FloatRect(rendererRect)).boundingBox())); 918 return pixelSnappedIntRect(enclosingLayoutRect(renderer.localToAbsoluteQuad( FloatRect(rendererRect)).boundingBox()));
923 } 919 }
924 920
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 void FrameView::setLayoutSizeInternal(const IntSize& size) 1011 void FrameView::setLayoutSizeInternal(const IntSize& size)
1016 { 1012 {
1017 if (m_layoutSize == size) 1013 if (m_layoutSize == size)
1018 return; 1014 return;
1019 1015
1020 m_layoutSize = size; 1016 m_layoutSize = size;
1021 contentsResized(); 1017 contentsResized();
1022 } 1018 }
1023 1019
1024 } // namespace blink 1020 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/frame/FrameView.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698