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

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

Issue 2804983003: [blink] Use early returns in baseBackgroundColor(Override) setters. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 db2ee4b233d8dab7ebc5736b177856ad63136137..98806cdafcc19b1200c450f8f78cdb8a7b24f0e6 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -160,6 +160,13 @@ static const double resourcePriorityUpdateDelayAfterScroll = 0.250;
static bool s_initialTrackAllPaintInvalidations = false;
+static void setNeedsCompositingUpdate(LayoutViewItem layoutViewItem,
chrishtr 2017/04/06 17:33:46 I don't see much point in making this a helper met
Eric Seckler 2017/04/06 17:40:29 It was one before - I just moved it. Since it's us
chrishtr 2017/04/06 17:42:53 Oh, didn't see that. Ignore my comment.
+ CompositingUpdateType updateType) {
+ if (PaintLayerCompositor* compositor =
+ !layoutViewItem.isNull() ? layoutViewItem.compositor() : nullptr)
+ compositor->setNeedsCompositingUpdate(updateType);
+}
+
FrameView::FrameView(LocalFrame& frame)
: m_frame(frame),
m_displayMode(WebDisplayModeBrowser),
@@ -2342,20 +2349,13 @@ Color FrameView::baseBackgroundColor() const {
}
void FrameView::setBaseBackgroundColor(const Color& backgroundColor) {
+ if (m_baseBackgroundColor == backgroundColor)
+ return;
+
m_baseBackgroundColor = backgroundColor;
- if (!layoutViewItem().isNull() &&
- layoutViewItem().layer()->hasCompositedLayerMapping()) {
- CompositedLayerMapping* compositedLayerMapping =
- layoutViewItem().layer()->compositedLayerMapping();
- compositedLayerMapping->updateContentsOpaque();
- if (compositedLayerMapping->mainGraphicsLayer())
- compositedLayerMapping->mainGraphicsLayer()->setNeedsDisplay();
chrishtr 2017/04/06 17:33:46 You still need setNeedsDisplay in order to force i
Eric Seckler 2017/04/06 17:40:29 Thanks, will do!
- }
recalculateScrollbarOverlayColorTheme(documentBackgroundColor());
-
- if (!shouldThrottleRendering())
- page()->animator().scheduleVisualUpdate(m_frame.get());
+ setNeedsCompositingUpdate(layoutViewItem(), CompositingUpdateRebuildTree);
}
void FrameView::updateBaseBackgroundColorRecursively(
@@ -4642,13 +4642,6 @@ IntPoint FrameView::convertFromContainingFrameViewBaseToScrollbar(
return newPoint;
}
-static void setNeedsCompositingUpdate(LayoutViewItem layoutViewItem,
- CompositingUpdateType updateType) {
- if (PaintLayerCompositor* compositor =
- !layoutViewItem.isNull() ? layoutViewItem.compositor() : nullptr)
- compositor->setNeedsCompositingUpdate(updateType);
-}
-
void FrameView::setParentVisible(bool visible) {
if (isParentVisible() == visible)
return;
« 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