Commit dee76339 authored by Mitsuru Oshima's avatar Mitsuru Oshima Committed by Commit Bot

Use the correct layer to check blur sigma.

crrev.com/c/1885219 broke SwitchToNonLayerBlur.

Bug: 1015886
Test: manually tested.
Change-Id: I831be4daa0c97596963a1603343f6735724423c0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1911225Reviewed-by: default avatarSammie Quon <sammiequon@chromium.org>
Commit-Queue: Mitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714678}
parent 27a645c7
...@@ -97,15 +97,14 @@ class WallpaperWidgetController::WidgetHandler ...@@ -97,15 +97,14 @@ class WallpaperWidgetController::WidgetHandler
parent_window_ = widget_->GetNativeWindow()->parent(); parent_window_ = widget_->GetNativeWindow()->parent();
window_observer_.Add(parent_window_); window_observer_.Add(parent_window_);
has_blur_cache_ = blur_sigma() > 0.0f;
has_blur_cache_ = widget_->GetLayer()->layer_blur() > 0.0f;
if (has_blur_cache_) if (has_blur_cache_)
parent_window_->layer()->AddCacheRenderSurfaceRequest(); parent_window_->layer()->AddCacheRenderSurfaceRequest();
return true; return true;
} }
float blur_sigma() const { return widget_->GetLayer()->layer_blur(); } float blur_sigma() const { return wallpaper_view_->layer()->layer_blur(); }
void SetBlur(float blur_sigma) { void SetBlur(float blur_sigma) {
wallpaper_view_->layer()->SetLayerBlur(blur_sigma); wallpaper_view_->layer()->SetLayerBlur(blur_sigma);
...@@ -117,12 +116,18 @@ class WallpaperWidgetController::WidgetHandler ...@@ -117,12 +116,18 @@ class WallpaperWidgetController::WidgetHandler
} else if (old_has_blur_cache && !has_blur_cache_) { } else if (old_has_blur_cache && !has_blur_cache_) {
parent_window_->layer()->RemoveCacheRenderSurfaceRequest(); parent_window_->layer()->RemoveCacheRenderSurfaceRequest();
} }
// Reset the paint blur if any.
if (wallpaper_view_->repaint_blur() != 0.f ||
wallpaper_view_->repaint_opacity() != 1.f) {
wallpaper_view_->RepaintBlurAndOpacity(0, 1.f);
}
} }
void StopAnimating() { widget_->GetLayer()->GetAnimator()->StopAnimating(); } void StopAnimating() { widget_->GetLayer()->GetAnimator()->StopAnimating(); }
void SwitchToNonLayerBlur() { void SwitchToNonLayerBlur() {
float blur = widget_->GetLayer()->layer_blur(); float blur = blur_sigma();
if (has_blur_cache_) { if (has_blur_cache_) {
parent_window_->layer()->RemoveCacheRenderSurfaceRequest(); parent_window_->layer()->RemoveCacheRenderSurfaceRequest();
has_blur_cache_ = false; has_blur_cache_ = false;
...@@ -132,7 +137,7 @@ class WallpaperWidgetController::WidgetHandler ...@@ -132,7 +137,7 @@ class WallpaperWidgetController::WidgetHandler
if (blur == 0.f) if (blur == 0.f)
return; return;
widget_->GetLayer()->SetLayerBlur(0.f); wallpaper_view_->layer()->SetLayerBlur(0.f);
wallpaper_view_->RepaintBlurAndOpacity(blur, 1.f); wallpaper_view_->RepaintBlurAndOpacity(blur, 1.f);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment