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

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

Issue 2194423002: Schedule animation when setting base background color, rather than forcing an update. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: none Created 4 years, 4 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 | « no previous file | third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp » ('j') | 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 1875 matching lines...) Expand 10 before | Expand all | Expand 10 after
1886 } 1886 }
1887 1887
1888 if (relayoutRoot == layoutView) 1888 if (relayoutRoot == layoutView)
1889 m_layoutSubtreeRootList.clearAndMarkContainingBlocksForLayout(); 1889 m_layoutSubtreeRootList.clearAndMarkContainingBlocksForLayout();
1890 else 1890 else
1891 m_layoutSubtreeRootList.add(*relayoutRoot); 1891 m_layoutSubtreeRootList.add(*relayoutRoot);
1892 1892
1893 if (m_layoutSchedulingEnabled) { 1893 if (m_layoutSchedulingEnabled) {
1894 m_hasPendingLayout = true; 1894 m_hasPendingLayout = true;
1895 1895
1896 page()->animator().scheduleVisualUpdate(m_frame.get()); 1896 if (!shouldThrottleRendering())
1897 page()->animator().scheduleVisualUpdate(m_frame.get());
1898
1897 lifecycle().ensureStateAtMost(DocumentLifecycle::StyleClean); 1899 lifecycle().ensureStateAtMost(DocumentLifecycle::StyleClean);
1898 } 1900 }
1899 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Invali dateLayout", TRACE_EVENT_SCOPE_THREAD, "data", InspectorInvalidateLayoutEvent::d ata(m_frame.get())); 1901 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Invali dateLayout", TRACE_EVENT_SCOPE_THREAD, "data", InspectorInvalidateLayoutEvent::d ata(m_frame.get()));
1900 } 1902 }
1901 1903
1902 bool FrameView::layoutPending() const 1904 bool FrameView::layoutPending() const
1903 { 1905 {
1904 // FIXME: This should check Document::lifecycle instead. 1906 // FIXME: This should check Document::lifecycle instead.
1905 return m_hasPendingLayout; 1907 return m_hasPendingLayout;
1906 } 1908 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1965 { 1967 {
1966 m_baseBackgroundColor = backgroundColor; 1968 m_baseBackgroundColor = backgroundColor;
1967 1969
1968 if (!layoutViewItem().isNull() && layoutViewItem().layer()->hasCompositedLay erMapping()) { 1970 if (!layoutViewItem().isNull() && layoutViewItem().layer()->hasCompositedLay erMapping()) {
1969 CompositedLayerMapping* compositedLayerMapping = layoutViewItem().layer( )->compositedLayerMapping(); 1971 CompositedLayerMapping* compositedLayerMapping = layoutViewItem().layer( )->compositedLayerMapping();
1970 compositedLayerMapping->updateContentsOpaque(); 1972 compositedLayerMapping->updateContentsOpaque();
1971 if (compositedLayerMapping->mainGraphicsLayer()) 1973 if (compositedLayerMapping->mainGraphicsLayer())
1972 compositedLayerMapping->mainGraphicsLayer()->setNeedsDisplay(); 1974 compositedLayerMapping->mainGraphicsLayer()->setNeedsDisplay();
1973 } 1975 }
1974 recalculateScrollbarOverlayStyle(documentBackgroundColor()); 1976 recalculateScrollbarOverlayStyle(documentBackgroundColor());
1977
1978 if (!shouldThrottleRendering())
1979 page()->animator().scheduleVisualUpdate(m_frame.get());
1975 } 1980 }
1976 1981
1977 void FrameView::updateBackgroundRecursively(const Color& backgroundColor, bool t ransparent) 1982 void FrameView::updateBackgroundRecursively(const Color& backgroundColor, bool t ransparent)
1978 { 1983 {
1979 forAllNonThrottledFrameViews([backgroundColor, transparent](FrameView& frame View) { 1984 forAllNonThrottledFrameViews([backgroundColor, transparent](FrameView& frame View) {
1980 frameView.setTransparent(transparent); 1985 frameView.setTransparent(transparent);
1981 frameView.setBaseBackgroundColor(backgroundColor); 1986 frameView.setBaseBackgroundColor(backgroundColor);
1982 }); 1987 });
1983 } 1988 }
1984 1989
(...skipping 2291 matching lines...) Expand 10 before | Expand all | Expand 10 after
4276 } 4281 }
4277 4282
4278 bool FrameView::canThrottleRendering() const 4283 bool FrameView::canThrottleRendering() const
4279 { 4284 {
4280 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4285 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4281 return false; 4286 return false;
4282 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); 4287 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling);
4283 } 4288 }
4284 4289
4285 } // namespace blink 4290 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698