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

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

Issue 847393003: Remove the PaintInvalidation DocumentLifeCycle states. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
« 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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 // FIXME: It should be not possible to remove the FrameView from the frame/p age during layout 386 // FIXME: It should be not possible to remove the FrameView from the frame/p age during layout
387 // however m_inPerformLayout is not set for most of this function, so none o f our RELEASE_ASSERTS 387 // however m_inPerformLayout is not set for most of this function, so none o f our RELEASE_ASSERTS
388 // in LocalFrame/Page will fire. One of the post-layout tasks is disconnecti ng the LocalFrame from 388 // in LocalFrame/Page will fire. One of the post-layout tasks is disconnecti ng the LocalFrame from
389 // the page in fast/frames/crash-remove-iframe-during-object-beforeload-2.ht ml 389 // the page in fast/frames/crash-remove-iframe-during-object-beforeload-2.ht ml
390 // necessitating this check here. 390 // necessitating this check here.
391 // ASSERT(frame()->page()); 391 // ASSERT(frame()->page());
392 if (frame().page()) 392 if (frame().page())
393 frame().page()->chrome().client().layoutUpdated(m_frame.get()); 393 frame().page()->chrome().client().layoutUpdated(m_frame.get());
394 } 394 }
395 395
396 // FIXME(sky): Remove
397 void FrameView::invalidateTreeIfNeeded()
398 {
399 lifecycle().advanceTo(DocumentLifecycle::InPaintInvalidation);
400 lifecycle().advanceTo(DocumentLifecycle::PaintInvalidationClean);
401 }
402
403 DocumentLifecycle& FrameView::lifecycle() const 396 DocumentLifecycle& FrameView::lifecycle() const
404 { 397 {
405 return m_frame->document()->lifecycle(); 398 return m_frame->document()->lifecycle();
406 } 399 }
407 400
408 void FrameView::setMediaType(const AtomicString& mediaType) 401 void FrameView::setMediaType(const AtomicString& mediaType)
409 { 402 {
410 ASSERT(m_frame->document()); 403 ASSERT(m_frame->document());
411 m_frame->document()->mediaQueryAffectingValueChanged(); 404 m_frame->document()->mediaQueryAffectingValueChanged();
412 m_mediaType = mediaType; 405 m_mediaType = mediaType;
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 p->fillRect(rect, Color(0xFF, 0, 0)); 724 p->fillRect(rect, Color(0xFF, 0, 0));
732 #endif 725 #endif
733 726
734 RenderView* renderView = this->renderView(); 727 RenderView* renderView = this->renderView();
735 if (!renderView) { 728 if (!renderView) {
736 WTF_LOG_ERROR("called FrameView::paint with nil renderer"); 729 WTF_LOG_ERROR("called FrameView::paint with nil renderer");
737 return; 730 return;
738 } 731 }
739 732
740 RELEASE_ASSERT(!needsLayout()); 733 RELEASE_ASSERT(!needsLayout());
741 ASSERT(document->lifecycle().state() >= DocumentLifecycle::PaintInvalidation Clean); 734 ASSERT(document->lifecycle().state() >= DocumentLifecycle::StyleAndLayoutCle an);
742 735
743 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Paint", "data" , InspectorPaintEvent::data(renderView, rect)); 736 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Paint", "data" , InspectorPaintEvent::data(renderView, rect));
744 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), " CallStack", TRACE_EVENT_SCOPE_PROCESS, "stack", InspectorCallStackEvent::current CallStack()); 737 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), " CallStack", TRACE_EVENT_SCOPE_PROCESS, "stack", InspectorCallStackEvent::current CallStack());
745 738
746 bool isTopLevelPainter = !s_inPaintContents; 739 bool isTopLevelPainter = !s_inPaintContents;
747 s_inPaintContents = true; 740 s_inPaintContents = true;
748 741
749 FontCachePurgePreventer fontCachePurgePreventer; 742 FontCachePurgePreventer fontCachePurgePreventer;
750 document->markers().invalidateRenderedRectsForMarkersInRect(rect); 743 document->markers().invalidateRenderedRectsForMarkersInRect(rect);
751 744
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 } 781 }
789 782
790 void FrameView::updateLayoutAndStyleForPainting() 783 void FrameView::updateLayoutAndStyleForPainting()
791 { 784 {
792 // Updating layout can run script, which can tear down the FrameView. 785 // Updating layout can run script, which can tear down the FrameView.
793 RefPtr<FrameView> protector(this); 786 RefPtr<FrameView> protector(this);
794 787
795 updateLayoutAndStyleIfNeededRecursive(); 788 updateLayoutAndStyleIfNeededRecursive();
796 789
797 if (RenderView* view = renderView()) { 790 if (RenderView* view = renderView()) {
798 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "In validateTreeAndUpdateIframes", TRACE_EVENT_SCOPE_PROCESS, "frame", m_frame.get() ); 791 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "up dateIFramesAfterLayout", TRACE_EVENT_SCOPE_PROCESS, "frame", m_frame.get());
799 invalidateTreeIfNeeded();
800 view->updateIFramesAfterLayout(); 792 view->updateIFramesAfterLayout();
801 } 793 }
802 794
803 ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean); 795 // TODO(ojan): Get rid of this and just have the LayoutClean state.
796 lifecycle().advanceTo(DocumentLifecycle::StyleAndLayoutClean);
804 797
805 DocumentAnimations::startPendingAnimations(*m_frame->document()); 798 DocumentAnimations::startPendingAnimations(*m_frame->document());
806 } 799 }
807 800
808 void FrameView::updateLayoutAndStyleIfNeededRecursive() 801 void FrameView::updateLayoutAndStyleIfNeededRecursive()
809 { 802 {
810 // We have to crawl our entire tree looking for any FrameViews that need 803 // We have to crawl our entire tree looking for any FrameViews that need
811 // layout and make sure they are up to date. 804 // layout and make sure they are up to date.
812 // Mac actually tests for intersection with the dirty region and tries not t o 805 // Mac actually tests for intersection with the dirty region and tries not t o
813 // update layout for frames that are outside the dirty region. Not only doe s this seem 806 // update layout for frames that are outside the dirty region. Not only doe s this seem
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 totalObjects = 0; 915 totalObjects = 0;
923 916
924 for (RenderObject* o = root; o; o = o->nextInPreOrder(root)) { 917 for (RenderObject* o = root; o; o = o->nextInPreOrder(root)) {
925 ++totalObjects; 918 ++totalObjects;
926 if (o->needsLayout()) 919 if (o->needsLayout())
927 ++needsLayoutObjects; 920 ++needsLayoutObjects;
928 } 921 }
929 } 922 }
930 923
931 } // namespace blink 924 } // 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