Commit 98355ca7 authored by Malay Keshav's avatar Malay Keshav Committed by Commit Bot

Use shader for rounded corner when animating

When the unified system tray is animating it uses a separate layer to
to perform blur and animation. This layer does not have a mask applied
to it for performance bottlenecks and thus does not have any rounded
corner clipping. This patch modifies this and applies the shader rounded
corner on the layer.

Bug: 898329
Change-Id: I9fed724e4659960710c3daee5e33ec92e2223fb7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1562624Reviewed-by: default avatarTim Song <tengs@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Commit-Queue: Malay Keshav <malaykeshav@chromium.org>
Cr-Commit-Position: refs/heads/master@{#649695}
parent 0593374c
......@@ -5,6 +5,7 @@
#include "ash/system/unified/unified_system_tray_bubble.h"
#include "ash/public/cpp/app_list/app_list_features.h"
#include "ash/public/cpp/ash_features.h"
#include "ash/shelf/shelf.h"
#include "ash/shell.h"
#include "ash/system/status_area_widget.h"
......@@ -317,8 +318,18 @@ void UnifiedSystemTrayBubble::CreateBlurLayerForAnimation() {
bubble_widget_->client_view()->layer()->SetBackgroundBlur(0);
blur_layer_ = views::Painter::CreatePaintedLayer(
views::Painter::CreateSolidRoundRectPainter(SK_ColorTRANSPARENT, 0));
if (features::ShouldUseShaderRoundedCorner()) {
blur_layer_ = std::make_unique<ui::LayerOwner>(
std::make_unique<ui::Layer>(ui::LAYER_SOLID_COLOR));
blur_layer_->layer()->SetColor(SK_ColorTRANSPARENT);
blur_layer_->layer()->SetRoundedCornerRadius(
{kUnifiedTrayCornerRadius, kUnifiedTrayCornerRadius,
kUnifiedTrayCornerRadius, kUnifiedTrayCornerRadius});
} else {
blur_layer_ = views::Painter::CreatePaintedLayer(
views::Painter::CreateSolidRoundRectPainter(SK_ColorTRANSPARENT, 0));
}
blur_layer_->layer()->SetFillsBoundsOpaquely(false);
bubble_widget_->GetLayer()->Add(blur_layer_->layer());
......
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