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

Unified Diff: content/browser/frame_host/render_widget_host_view_child_frame.cc

Issue 2702153003: [content] Fix background color update handling in RWHVAura. (Closed)
Patch Set: rebase: employ same mechanism in RWHVMac. 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
Index: content/browser/frame_host/render_widget_host_view_child_frame.cc
diff --git a/content/browser/frame_host/render_widget_host_view_child_frame.cc b/content/browser/frame_host/render_widget_host_view_child_frame.cc
index c591e8514b3c15e5fb256ae44feb0ec07a0230ca..4a33acda21c830f7bd97ef3cb61b7547ca28391d 100644
--- a/content/browser/frame_host/render_widget_host_view_child_frame.cc
+++ b/content/browser/frame_host/render_widget_host_view_child_frame.cc
@@ -56,6 +56,7 @@ RenderWidgetHostViewChildFrame::RenderWidgetHostViewChildFrame(
next_surface_sequence_(1u),
current_surface_scale_factor_(1.f),
frame_connector_(nullptr),
+ background_color_(SK_ColorWHITE),
weak_factory_(this) {
GetSurfaceManager()->RegisterFrameSinkId(frame_sink_id_);
CreateCompositorFrameSinkSupport();
@@ -211,9 +212,15 @@ RenderWidgetHostViewChildFrame::GetNativeViewAccessible() {
}
void RenderWidgetHostViewChildFrame::SetBackgroundColor(SkColor color) {
- RenderWidgetHostViewBase::SetBackgroundColor(color);
- bool opaque = GetBackgroundOpaque();
- host_->SetBackgroundOpaque(opaque);
+ background_color_ = color;
+
+ DCHECK(SkColorGetA(color) == SK_AlphaOPAQUE ||
+ SkColorGetA(color) == SK_AlphaTRANSPARENT);
+ host_->SetBackgroundOpaque(SkColorGetA(color) == SK_AlphaOPAQUE);
+}
+
+SkColor RenderWidgetHostViewChildFrame::background_color() const {
+ return background_color_;
}
gfx::Size RenderWidgetHostViewChildFrame::GetPhysicalBackingSize() const {

Powered by Google App Engine
This is Rietveld 408576698