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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 2866983002: mac: Don't set background color from a frame until frame is displayed (Closed)
Patch Set: Created 3 years, 7 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 | « content/browser/renderer_host/render_widget_host_view_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_mac.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 1e608551b7a862682e7e6a8a45a77a69ceaee574..e9ff56d799d12dc06739332f4e899b2d6f79e916 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -426,6 +426,12 @@ float FlipYFromRectToScreen(float y, float rect_height) {
}
void RenderWidgetHostViewMac::AcceleratedWidgetSwapCompleted() {
+ // Set the background color for the root layer from the frame that just
+ // swapped. See RenderWidgetHostViewAura for more details. Note that this is
+ // done only after the swap has completed, so that the background is not set
+ // before the frame is up.
+ UpdateBackgroundColorFromRenderer(last_frame_root_background_color_);
+
if (display_link_)
display_link_->NotifyCurrentTime(base::TimeTicks::Now());
}
@@ -1423,10 +1429,7 @@ new BrowserCompositorMac(this, this, render_widget_host_->is_hidden(),
cc::CompositorFrame frame) {
TRACE_EVENT0("browser", "RenderWidgetHostViewMac::OnSwapCompositorFrame");
- // Override the compositor background color. See RenderWidgetHostViewAura
- // for more details.
- UpdateBackgroundColorFromRenderer(frame.metadata.root_background_color);
-
+ last_frame_root_background_color_ = frame.metadata.root_background_color;
last_scroll_offset_ = frame.metadata.root_scroll_offset;
page_at_minimum_scale_ =
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698