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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 634113002: Use solid color layer for delegated surface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/compositor/reflector_impl.cc ('k') | ui/aura/bench/bench_main.cc » ('j') | 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_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 3b8bb93ebc947770f8bf58510255cefc2a5a92a3..dc2478bbf5b4941e4bd5f04fc9ec35ff727740f3 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -474,8 +474,9 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host)
void RenderWidgetHostViewAura::InitAsChild(
gfx::NativeView parent_view) {
window_->SetType(ui::wm::WINDOW_TYPE_CONTROL);
- window_->Init(aura::WINDOW_LAYER_TEXTURED);
+ window_->Init(aura::WINDOW_LAYER_SOLID_COLOR);
window_->SetName("RenderWidgetHostViewAura");
+ window_->layer()->SetColor(SK_ColorWHITE);
}
void RenderWidgetHostViewAura::InitAsPopup(
@@ -502,8 +503,9 @@ void RenderWidgetHostViewAura::InitAsPopup(
}
popup_parent_host_view_->popup_child_host_view_ = this;
window_->SetType(ui::wm::WINDOW_TYPE_MENU);
- window_->Init(aura::WINDOW_LAYER_TEXTURED);
+ window_->Init(aura::WINDOW_LAYER_SOLID_COLOR);
window_->SetName("RenderWidgetHostViewAura");
+ window_->layer()->SetColor(SK_ColorWHITE);
aura::Window* root = popup_parent_host_view_->window_->GetRootWindow();
aura::client::ParentWindowWithContext(window_, root, bounds_in_screen);
@@ -527,9 +529,10 @@ void RenderWidgetHostViewAura::InitAsFullscreen(
RenderWidgetHostView* reference_host_view) {
is_fullscreen_ = true;
window_->SetType(ui::wm::WINDOW_TYPE_NORMAL);
- window_->Init(aura::WINDOW_LAYER_TEXTURED);
+ window_->Init(aura::WINDOW_LAYER_SOLID_COLOR);
window_->SetName("RenderWidgetHostViewAura");
window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
+ window_->layer()->SetColor(SK_ColorWHITE);
aura::Window* parent = NULL;
gfx::Rect bounds;
@@ -804,6 +807,8 @@ void RenderWidgetHostViewAura::SetBackgroundOpaque(bool opaque) {
RenderWidgetHostViewBase::SetBackgroundOpaque(opaque);
host_->SetBackgroundOpaque(opaque);
window_->layer()->SetFillsBoundsOpaquely(opaque);
+ SkColor background_color = opaque ? SK_ColorWHITE : SK_ColorTRANSPARENT;
+ window_->layer()->SetColor(background_color);
}
gfx::Size RenderWidgetHostViewAura::GetVisibleViewportSize() const {
@@ -1681,11 +1686,7 @@ void RenderWidgetHostViewAura::OnCaptureLost() {
}
void RenderWidgetHostViewAura::OnPaint(gfx::Canvas* canvas) {
- // For non-opaque windows, we don't draw anything, since we depend on the
- // canvas coming from the compositor to already be initialized as
- // transparent.
- if (window_->layer()->fills_bounds_opaquely())
- canvas->DrawColor(SK_ColorWHITE);
+ DCHECK(false);
piman 2014/10/09 06:30:27 nit: NOTREACHED()
}
void RenderWidgetHostViewAura::OnDeviceScaleFactorChanged(
« no previous file with comments | « content/browser/compositor/reflector_impl.cc ('k') | ui/aura/bench/bench_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698