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

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
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
2009 // dependency between web/ and core/ in synchronized painting mode.
2010 if (InspectorOverlay* overlay = inspectorOverlay())
2011 overlay->layout();
2012 for (size_t i = 0; i < m_linkHighlights.size(); ++i) 2003 for (size_t i = 0; i < m_linkHighlights.size(); ++i)
2013 m_linkHighlights[i]->updateGeometry(); 2004 m_linkHighlights[i]->updateGeometry();
2014 2005
2006 PageWidgetDelegate::updateAllLifecyclePhases(*m_page, *mainFrameImpl()->fram e());
2007
2008 if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) {
wkorman 2015/12/16 23:29:54 Do things still work the old way with this flag of
Xianzhu 2015/12/16 23:45:39 There are still several regressions. Keeping the o
chrishtr 2015/12/16 23:51:32 I think so yes. I'll do some quick manual testing.
2009 if (InspectorOverlay* overlay = inspectorOverlay()) {
2010 overlay->updateAllLifecyclePhases();
2011 // TODO(chrishtr): integrate paint into the overlay's lifecycle.
2012 if (overlay->pageOverlay() && overlay->pageOverlay()->graphicsLayer( ))
2013 overlay->pageOverlay()->graphicsLayer()->paint(nullptr);
2014 }
2015 if (m_pageColorOverlay)
2016 m_pageColorOverlay->graphicsLayer()->paint(nullptr);
2017
wkorman 2015/12/16 23:29:54 -1 blank
chrishtr 2015/12/16 23:51:33 Fixed.
2018 }
2019
2015 if (FrameView* view = mainFrameImpl()->frameView()) { 2020 if (FrameView* view = mainFrameImpl()->frameView()) {
2016 LocalFrame* frame = mainFrameImpl()->frame(); 2021 LocalFrame* frame = mainFrameImpl()->frame();
2017 2022
2018 if (m_shouldDispatchFirstVisuallyNonEmptyLayout && view->isVisuallyNonEm pty()) { 2023 if (m_shouldDispatchFirstVisuallyNonEmptyLayout && view->isVisuallyNonEm pty()) {
2019 m_shouldDispatchFirstVisuallyNonEmptyLayout = false; 2024 m_shouldDispatchFirstVisuallyNonEmptyLayout = false;
2020 // TODO(esprehn): Move users of this callback to something 2025 // TODO(esprehn): Move users of this callback to something
2021 // better, the heuristic for "visually non-empty" is bad. 2026 // better, the heuristic for "visually non-empty" is bad.
2022 client()->didMeaningfulLayout(WebMeaningfulLayout::VisuallyNonEmpty) ; 2027 client()->didMeaningfulLayout(WebMeaningfulLayout::VisuallyNonEmpty) ;
2023 } 2028 }
2024 2029
2025 if (m_shouldDispatchFirstLayoutAfterFinishedParsing && frame->document() ->hasFinishedParsing()) { 2030 if (m_shouldDispatchFirstLayoutAfterFinishedParsing && frame->document() ->hasFinishedParsing()) {
2026 m_shouldDispatchFirstLayoutAfterFinishedParsing = false; 2031 m_shouldDispatchFirstLayoutAfterFinishedParsing = false;
2027 client()->didMeaningfulLayout(WebMeaningfulLayout::FinishedParsing); 2032 client()->didMeaningfulLayout(WebMeaningfulLayout::FinishedParsing);
2028 } 2033 }
2029 2034
2030 if (m_shouldDispatchFirstLayoutAfterFinishedLoading && frame->document() ->isLoadCompleted()) { 2035 if (m_shouldDispatchFirstLayoutAfterFinishedLoading && frame->document() ->isLoadCompleted()) {
2031 m_shouldDispatchFirstLayoutAfterFinishedLoading = false; 2036 m_shouldDispatchFirstLayoutAfterFinishedLoading = false;
2032 client()->didMeaningfulLayout(WebMeaningfulLayout::FinishedLoading); 2037 client()->didMeaningfulLayout(WebMeaningfulLayout::FinishedLoading);
2033 } 2038 }
2034 } 2039 }
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 } 2040 }
2040 2041
2041 void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect) 2042 void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect)
2042 { 2043 {
2043 // This should only be used when compositing is not being used for this 2044 // 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. 2045 // WebView, and it is painting into the recording of its parent.
2045 ASSERT(!isAcceleratedCompositingActive()); 2046 ASSERT(!isAcceleratedCompositingActive());
2046 2047
2047 double paintStart = currentTime(); 2048 double paintStart = currentTime();
2048 PageWidgetDelegate::paint(*m_page, canvas, rect, *m_page->deprecatedLocalMai nFrame()); 2049 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() 4613 void WebViewImpl::detachPaintArtifactCompositor()
4613 { 4614 {
4614 if (!m_layerTreeView) 4615 if (!m_layerTreeView)
4615 return; 4616 return;
4616 4617
4617 m_layerTreeView->setDeferCommits(true); 4618 m_layerTreeView->setDeferCommits(true);
4618 m_layerTreeView->clearRootLayer(); 4619 m_layerTreeView->clearRootLayer();
4619 } 4620 }
4620 4621
4621 } // namespace blink 4622 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698