Commit 8ba6b43b authored by Mason Freed's avatar Mason Freed Committed by Commit Bot

Remove backdrop-filter crop rectangle from ui::Layer

The prior code incorrectly cropped the backdrop-filtered content on
the ChromeOS Shelf. This fixes that problem.

Bug: 920296, 923022
Change-Id: Idfee932a67b4f8baa2ad9351268384b3b059d72b
Reviewed-on: https://chromium-review.googlesource.com/c/1415171
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: default avatardanakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#625777}
parent 743746a8
...@@ -378,7 +378,6 @@ void Layer::SetBounds(const gfx::Rect& bounds) { ...@@ -378,7 +378,6 @@ void Layer::SetBounds(const gfx::Rect& bounds) {
void Layer::SetSubpixelPositionOffset(const gfx::Vector2dF& offset) { void Layer::SetSubpixelPositionOffset(const gfx::Vector2dF& offset) {
subpixel_position_offset_ = offset; subpixel_position_offset_ = offset;
RecomputePosition(); RecomputePosition();
RecomputeBackdropBounds();
} }
gfx::Rect Layer::GetTargetBounds() const { gfx::Rect Layer::GetTargetBounds() const {
...@@ -540,7 +539,6 @@ void Layer::SetLayerBackgroundFilters() { ...@@ -540,7 +539,6 @@ void Layer::SetLayerBackgroundFilters() {
background_blur_sigma_, SkBlurImageFilter::kClamp_TileMode)); background_blur_sigma_, SkBlurImageFilter::kClamp_TileMode));
} }
cc_layer_->SetBackdropFilters(filters); cc_layer_->SetBackdropFilters(filters);
RecomputeBackdropBounds();
} }
float Layer::GetTargetOpacity() const { float Layer::GetTargetOpacity() const {
...@@ -1007,7 +1005,6 @@ void Layer::OnDeviceScaleFactorChanged(float device_scale_factor) { ...@@ -1007,7 +1005,6 @@ void Layer::OnDeviceScaleFactorChanged(float device_scale_factor) {
device_scale_factor_ = device_scale_factor; device_scale_factor_ = device_scale_factor;
RecomputeDrawsContentAndUVRect(); RecomputeDrawsContentAndUVRect();
RecomputePosition(); RecomputePosition();
RecomputeBackdropBounds();
if (nine_patch_layer_) { if (nine_patch_layer_) {
if (!nine_patch_layer_image_.isNull()) if (!nine_patch_layer_image_.isNull())
UpdateNinePatchLayerImage(nine_patch_layer_image_); UpdateNinePatchLayerImage(nine_patch_layer_image_);
...@@ -1175,7 +1172,6 @@ void Layer::SetBoundsFromAnimation(const gfx::Rect& bounds, ...@@ -1175,7 +1172,6 @@ void Layer::SetBoundsFromAnimation(const gfx::Rect& bounds,
RecomputeDrawsContentAndUVRect(); RecomputeDrawsContentAndUVRect();
RecomputePosition(); RecomputePosition();
RecomputeBackdropBounds();
if (delegate_) if (delegate_)
delegate_->OnLayerBoundsChanged(old_bounds, reason); delegate_->OnLayerBoundsChanged(old_bounds, reason);
...@@ -1323,7 +1319,6 @@ void Layer::CreateCcLayer() { ...@@ -1323,7 +1319,6 @@ void Layer::CreateCcLayer() {
cc_layer_->SetLayerClient(weak_ptr_factory_.GetWeakPtr()); cc_layer_->SetLayerClient(weak_ptr_factory_.GetWeakPtr());
cc_layer_->SetElementId(cc::ElementId(cc_layer_->id())); cc_layer_->SetElementId(cc::ElementId(cc_layer_->id()));
RecomputePosition(); RecomputePosition();
RecomputeBackdropBounds();
} }
void Layer::RecomputeDrawsContentAndUVRect() { void Layer::RecomputeDrawsContentAndUVRect() {
...@@ -1347,13 +1342,6 @@ void Layer::RecomputePosition() { ...@@ -1347,13 +1342,6 @@ void Layer::RecomputePosition() {
subpixel_position_offset_); subpixel_position_offset_);
} }
void Layer::RecomputeBackdropBounds() {
gfx::RectF backdrop_filter_bounds =
gfx::RectF(bounds().width(), bounds().height());
backdrop_filter_bounds.Scale(GetDeviceScaleFactor());
cc_layer_->SetBackdropFilterBounds(backdrop_filter_bounds);
}
void Layer::SetCompositorForAnimatorsInTree(Compositor* compositor) { void Layer::SetCompositorForAnimatorsInTree(Compositor* compositor) {
DCHECK(compositor); DCHECK(compositor);
LayerAnimatorCollection* collection = compositor->layer_animator_collection(); LayerAnimatorCollection* collection = compositor->layer_animator_collection();
......
...@@ -512,7 +512,6 @@ class COMPOSITOR_EXPORT Layer : public LayerAnimationDelegate, ...@@ -512,7 +512,6 @@ class COMPOSITOR_EXPORT Layer : public LayerAnimationDelegate,
// Recomputes and sets to |cc_layer_|. // Recomputes and sets to |cc_layer_|.
void RecomputeDrawsContentAndUVRect(); void RecomputeDrawsContentAndUVRect();
void RecomputePosition(); void RecomputePosition();
void RecomputeBackdropBounds();
// Set all filters which got applied to the layer. // Set all filters which got applied to the layer.
void SetLayerFilters(); void SetLayerFilters();
......
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