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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 1526093006: Fix paint code so that overlays and views paint their own layers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « third_party/WebKit/Source/web/InspectorOverlay.cpp ('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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1980 matching lines...) Expand 10 before | Expand all | Expand 10 after
1991 1991
1992 PageWidgetDelegate::animate(*m_page, lastFrameTimeMonotonic); 1992 PageWidgetDelegate::animate(*m_page, lastFrameTimeMonotonic);
1993 } 1993 }
1994 1994
1995 void WebViewImpl::updateAllLifecyclePhases() 1995 void WebViewImpl::updateAllLifecyclePhases()
1996 { 1996 {
1997 TRACE_EVENT0("blink", "WebViewImpl::updateAllLifecyclePhases"); 1997 TRACE_EVENT0("blink", "WebViewImpl::updateAllLifecyclePhases");
1998 if (!mainFrameImpl()) 1998 if (!mainFrameImpl())
1999 return; 1999 return;
2000 2000
2001 if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled())
2002 PageWidgetDelegate::updateLifecycleToCompositingCleanPlusScrolling(*m_pa ge, *mainFrameImpl()->frame());
2003 else
2004 PageWidgetDelegate::updateAllLifecyclePhases(*m_page, *mainFrameImpl()-> frame());
2005
2006 updateLayerTreeBackgroundColor(); 2001 updateLayerTreeBackgroundColor();
2007 2002
2008 // TODO(wangxianzhu): Refactor overlay and link highlights updating and pain ting to make clearer 2003 PageWidgetDelegate::updateAllLifecyclePhases(*m_page, *mainFrameImpl()->fram e());
2009 // dependency between web/ and core/ in synchronized painting mode. 2004
2010 if (InspectorOverlay* overlay = inspectorOverlay()) 2005 if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) {
2011 overlay->layout(); 2006 if (InspectorOverlay* overlay = inspectorOverlay()) {
2007 overlay->updateAllLifecyclePhases();
2008 // TODO(chrishtr): integrate paint into the overlay's lifecycle.
2009 if (overlay->pageOverlay() && overlay->pageOverlay()->graphicsLayer( ))
2010 overlay->pageOverlay()->graphicsLayer()->paint(nullptr);
2011 }
2012 if (m_pageColorOverlay)
2013 m_pageColorOverlay->graphicsLayer()->paint(nullptr);
2014 }
2015
2016 // TODO(chrishtr): link highlight's don't currently paint themselves, it's s till driven by cc.
2017 // Fix this.
2012 for (size_t i = 0; i < m_linkHighlights.size(); ++i) 2018 for (size_t i = 0; i < m_linkHighlights.size(); ++i)
2013 m_linkHighlights[i]->updateGeometry(); 2019 m_linkHighlights[i]->updateGeometry();
2014 2020
2015 if (FrameView* view = mainFrameImpl()->frameView()) { 2021 if (FrameView* view = mainFrameImpl()->frameView()) {
2016 LocalFrame* frame = mainFrameImpl()->frame(); 2022 LocalFrame* frame = mainFrameImpl()->frame();
2017 2023
2018 if (m_shouldDispatchFirstVisuallyNonEmptyLayout && view->isVisuallyNonEm pty()) { 2024 if (m_shouldDispatchFirstVisuallyNonEmptyLayout && view->isVisuallyNonEm pty()) {
2019 m_shouldDispatchFirstVisuallyNonEmptyLayout = false; 2025 m_shouldDispatchFirstVisuallyNonEmptyLayout = false;
2020 // TODO(esprehn): Move users of this callback to something 2026 // TODO(esprehn): Move users of this callback to something
2021 // better, the heuristic for "visually non-empty" is bad. 2027 // better, the heuristic for "visually non-empty" is bad.
2022 client()->didMeaningfulLayout(WebMeaningfulLayout::VisuallyNonEmpty) ; 2028 client()->didMeaningfulLayout(WebMeaningfulLayout::VisuallyNonEmpty) ;
2023 } 2029 }
2024 2030
2025 if (m_shouldDispatchFirstLayoutAfterFinishedParsing && frame->document() ->hasFinishedParsing()) { 2031 if (m_shouldDispatchFirstLayoutAfterFinishedParsing && frame->document() ->hasFinishedParsing()) {
2026 m_shouldDispatchFirstLayoutAfterFinishedParsing = false; 2032 m_shouldDispatchFirstLayoutAfterFinishedParsing = false;
2027 client()->didMeaningfulLayout(WebMeaningfulLayout::FinishedParsing); 2033 client()->didMeaningfulLayout(WebMeaningfulLayout::FinishedParsing);
2028 } 2034 }
2029 2035
2030 if (m_shouldDispatchFirstLayoutAfterFinishedLoading && frame->document() ->isLoadCompleted()) { 2036 if (m_shouldDispatchFirstLayoutAfterFinishedLoading && frame->document() ->isLoadCompleted()) {
2031 m_shouldDispatchFirstLayoutAfterFinishedLoading = false; 2037 m_shouldDispatchFirstLayoutAfterFinishedLoading = false;
2032 client()->didMeaningfulLayout(WebMeaningfulLayout::FinishedLoading); 2038 client()->didMeaningfulLayout(WebMeaningfulLayout::FinishedLoading);
2033 } 2039 }
2034 } 2040 }
2035
2036 // TODO(wangxianzhu): Avoid traversing frame tree for phases (style, layout, etc.) that we are sure no need to update.
2037 if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled())
2038 PageWidgetDelegate::updateAllLifecyclePhases(*m_page, *mainFrameImpl()-> frame());
2039 } 2041 }
2040 2042
2041 void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect) 2043 void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect)
2042 { 2044 {
2043 // This should only be used when compositing is not being used for this 2045 // This should only be used when compositing is not being used for this
2044 // WebView, and it is painting into the recording of its parent. 2046 // WebView, and it is painting into the recording of its parent.
2045 ASSERT(!isAcceleratedCompositingActive()); 2047 ASSERT(!isAcceleratedCompositingActive());
2046 2048
2047 double paintStart = currentTime(); 2049 double paintStart = currentTime();
2048 PageWidgetDelegate::paint(*m_page, canvas, rect, *m_page->deprecatedLocalMai nFrame()); 2050 PageWidgetDelegate::paint(*m_page, canvas, rect, *m_page->deprecatedLocalMai nFrame());
(...skipping 2563 matching lines...) Expand 10 before | Expand all | Expand 10 after
4612 void WebViewImpl::detachPaintArtifactCompositor() 4614 void WebViewImpl::detachPaintArtifactCompositor()
4613 { 4615 {
4614 if (!m_layerTreeView) 4616 if (!m_layerTreeView)
4615 return; 4617 return;
4616 4618
4617 m_layerTreeView->setDeferCommits(true); 4619 m_layerTreeView->setDeferCommits(true);
4618 m_layerTreeView->clearRootLayer(); 4620 m_layerTreeView->clearRootLayer();
4619 } 4621 }
4620 4622
4621 } // namespace blink 4623 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/InspectorOverlay.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698