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

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2643723008: [devtools] Add a command to emulate the default background color. (Closed)
Patch Set: Apply compositedLayerMapping updates during updateLifecyclePhases to fix DCHECK errors. Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index 6556ad47ace0066df479fab61b784c305194355b..4372e4a3c42254acddaa7fbbbc83dfcffe800744 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -196,6 +196,7 @@ FrameView::FrameView(LocalFrame& frame)
m_needsScrollbarsUpdate(false),
m_suppressAdjustViewSize(false),
m_allowsLayoutInvalidationAfterLayoutClean(true),
+ m_needsOpaquenessUpdate(false),
m_mainThreadScrollingReasons(0),
m_mainThreadScrollingReasonsCounter(
MainThreadScrollingReason::kMainThreadScrollingReasonCount,
@@ -2308,6 +2309,16 @@ Color FrameView::baseBackgroundColor() const {
void FrameView::setBaseBackgroundColor(const Color& backgroundColor) {
m_baseBackgroundColor = backgroundColor;
+ m_needsOpaquenessUpdate = true;
+ recalculateScrollbarOverlayColorTheme(documentBackgroundColor());
+
+ if (!shouldThrottleRendering())
+ page()->animator().scheduleVisualUpdate(m_frame.get());
+}
+
+void FrameView::updateOpaquenessIfNeeded() {
+ if (!m_needsOpaquenessUpdate)
+ return;
if (!layoutViewItem().isNull() &&
layoutViewItem().layer()->hasCompositedLayerMapping()) {
@@ -2317,10 +2328,7 @@ void FrameView::setBaseBackgroundColor(const Color& backgroundColor) {
if (compositedLayerMapping->mainGraphicsLayer())
compositedLayerMapping->mainGraphicsLayer()->setNeedsDisplay();
}
- recalculateScrollbarOverlayColorTheme(documentBackgroundColor());
-
- if (!shouldThrottleRendering())
- page()->animator().scheduleVisualUpdate(m_frame.get());
+ m_needsOpaquenessUpdate = false;
}
void FrameView::updateBackgroundRecursively(const Color& backgroundColor,
@@ -2957,6 +2965,8 @@ void FrameView::updateLifecyclePhasesInternal(
});
}
+ updateOpaquenessIfNeeded();
+
scrollContentsIfNeededRecursive();
DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() ||
lifecycle().state() >= DocumentLifecycle::CompositingClean);

Powered by Google App Engine
This is Rietveld 408576698