Commit 79409a14 authored by Sammie Quon's avatar Sammie Quon Committed by Commit Bot

overview: Put shader rounded corners behind the feature flag.

Test: manual
Bug: 957151
Change-Id: I111826d8ecbb096ae696173b6369228249c77b57
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1586256
Auto-Submit: Sammie Quon <sammiequon@chromium.org>
Reviewed-by: default avatarMalay Keshav <malaykeshav@chromium.org>
Commit-Queue: Malay Keshav <malaykeshav@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654670}
parent aa482206
......@@ -4,6 +4,7 @@
#include "ash/wm/overview/drop_target_view.h"
#include "ash/public/cpp/ash_features.h"
#include "ash/resources/vector_icons/vector_icons.h"
#include "ash/wm/overview/overview_constants.h"
#include "ui/gfx/paint_vector_icon.h"
......@@ -50,11 +51,13 @@ DropTargetView::DropTargetView(bool has_plus_icon) {
background_view_->SetPaintToLayer(ui::LAYER_SOLID_COLOR);
background_view_->layer()->SetColor(kDropTargetBackgroundColor);
background_view_->layer()->SetOpacity(kDropTargetBackgroundOpacity);
const std::array<uint32_t, 4> kRadii = {
kOverviewWindowRoundingDp, kOverviewWindowRoundingDp,
kOverviewWindowRoundingDp, kOverviewWindowRoundingDp};
background_view_->layer()->SetRoundedCornerRadius(kRadii);
background_view_->layer()->SetIsFastRoundedCorner(true);
if (ash::features::ShouldUseShaderRoundedCorner()) {
const std::array<uint32_t, 4> kRadii = {
kOverviewWindowRoundingDp, kOverviewWindowRoundingDp,
kOverviewWindowRoundingDp, kOverviewWindowRoundingDp};
background_view_->layer()->SetRoundedCornerRadius(kRadii);
background_view_->layer()->SetIsFastRoundedCorner(true);
}
AddChildView(background_view_);
if (has_plus_icon) {
......
......@@ -4,6 +4,7 @@
#include "ash/wm/overview/rounded_label_widget.h"
#include "ash/public/cpp/ash_features.h"
#include "ui/aura/window.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/compositor/layer.h"
......@@ -34,10 +35,12 @@ class RoundedLabelView : public views::View {
layer()->SetColor(background_color);
layer()->SetFillsBoundsOpaquely(false);
const std::array<uint32_t, 4> kRadii = {rounding_dp, rounding_dp,
rounding_dp, rounding_dp};
layer()->SetRoundedCornerRadius(kRadii);
layer()->SetIsFastRoundedCorner(true);
if (ash::features::ShouldUseShaderRoundedCorner()) {
const std::array<uint32_t, 4> kRadii = {rounding_dp, rounding_dp,
rounding_dp, rounding_dp};
layer()->SetRoundedCornerRadius(kRadii);
layer()->SetIsFastRoundedCorner(true);
}
label_ = new views::Label(l10n_util::GetStringUTF16(message_id),
views::style::CONTEXT_LABEL);
......
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