Commit 46367c60 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

[PE] Update reference filters on box resize

Bug: 777259
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Id10b46d54508fc3332c2a20336deaa0f74027554
Reviewed-on: https://chromium-review.googlesource.com/806441
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522178}
parent 5268b083
......@@ -3520,7 +3520,6 @@ crbug.com/772411 http/tests/media/autoplay-crossorigin.html [ Timeout Failure Pa
crbug.com/777222 http/tests/devtools/change-iframe-src.js [ Pass Failure Timeout ]
crbug.com/777222 http/tests/devtools/inspect-iframe-from-different-domain.js [ Pass Failure Timeout ]
crbug.com/777222 http/tests/devtools/startup/console-log-before-frame-navigation.html [ Pass Failure Timeout ]
crbug.com/777259 fast/reflections/reflection-masks-outset.html [ Pass Failure ]
crbug.com/778745 http/tests/inspector-protocol/cachestorage/read-cached-response.js [ Pass Failure ]
......
layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x357
LayoutBlockFlow {HTML} at (0,0) size 800x357
LayoutBlockFlow {BODY} at (8,8) size 784x341
LayoutText {#text} at (0,0) size 0x0
layer at (28,28) size 335x296
LayoutImage {IMG} at (20,20) size 335x296
layer at (0,0) size 800x140
LayoutBlockFlow {HTML} at (0,0) size 800x140
LayoutBlockFlow {BODY} at (8,20) size 784x100
layer at (28,20) size 100x100
LayoutBlockFlow {DIV} at (20,0) size 100x100 [bgcolor=#0000FF]
<!DOCTYPE html>
<img id="target" src="resources/kate.png"
style="margin:20px; outline:20px solid green;
<div id="target"
style="width: 100px; height: 100px; background: blue;
margin:20px; outline:20px solid green;
-webkit-box-reflect: below 2px url(resources/vignette-mask.png) 75 / auto / 25px stretch">
<script src="../../resources/run-after-layout-and-paint.js"></script>
<script>
if (window.testRunner)
testRunner.waitUntilDone();
// Ensure the reflect mask image is loaded before ending the test.
var imageLoader = new Image();
imageLoader.onload = function() {
runAfterLayoutAndPaint(function() {}, true);
};
imageLoader.src = 'resources/vignette-mask.png';
</script>
<!DOCTYPE html>
<div style="width: 100px; height: 150px; background: green"></div>
<div style="width: 100px; height: 150px; background: green; margin-top: 20px"></div>
<!DOCTYPE html>
<div id="target" style="width: 100px; height: 100px; -webkit-box-reflect: below 20px; background: green"></div>
<script src="../../../resources/run-after-layout-and-paint.js"></script>
<script>
runAfterLayoutAndPaint(function() {
target.style.height = '150px';
}, true);
</script>
layer at (0,0) size 980x735
LayoutView at (0,0) size 980x735
layer at (0,0) size 980x140
LayoutBlockFlow {HTML} at (0,0) size 980x140
LayoutBlockFlow {BODY} at (8,20) size 964x100
layer at (28,20) size 100x100
LayoutBlockFlow {DIV} at (20,0) size 100x100 [bgcolor=#0000FF]
layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x356
LayoutBlockFlow {HTML} at (0,0) size 800x356
LayoutBlockFlow {BODY} at (8,8) size 784x340
LayoutText {#text} at (0,0) size 0x0
layer at (28,28) size 335x296
LayoutImage {IMG} at (20,20) size 335x296
......@@ -3224,14 +3224,14 @@ void PaintLayer::UpdateCompositorFilterOperationsForFilter(
CompositorFilterOperations& operations) const {
const auto& style = GetLayoutObject().StyleRef();
float zoom = style.EffectiveZoom();
FloatRect reference_box = FilterReferenceBox(style.Filter(), zoom);
auto filter = FilterOperationsIncludingReflection();
FloatRect reference_box = FilterReferenceBox(filter, zoom);
if (!operations.IsEmpty() && !filter_on_effect_node_dirty_ &&
reference_box == operations.ReferenceBox())
return;
operations =
FilterEffectBuilder(EnclosingNode(), reference_box, zoom)
.BuildFilterOperations(FilterOperationsIncludingReflection());
operations = FilterEffectBuilder(EnclosingNode(), reference_box, zoom)
.BuildFilterOperations(filter);
}
CompositorFilterOperations
......
......@@ -1452,6 +1452,12 @@ static void SetNeedsPaintPropertyUpdateIfNeeded(const LayoutObject& object) {
box.StyleRef().HasTransform() || NeedsPerspective(box) ||
box_generates_property_nodes_for_mask_and_clip_path)
box.GetMutableForPainting().SetNeedsPaintPropertyUpdate();
// The filter generated for reflection depends on box size.
if (box.HasReflection()) {
box.Layer()->SetFilterOnEffectNodeDirty();
box.GetMutableForPainting().SetNeedsPaintPropertyUpdate();
}
}
void FragmentPaintPropertyTreeBuilder::UpdateForObjectLocationAndSize(
......
......@@ -73,8 +73,9 @@ bool FilterOperations::CanInterpolateWith(const FilterOperations& other) const {
}
bool FilterOperations::HasReferenceFilter() const {
for (size_t i = 0; i < operations_.size(); ++i) {
if (operations_.at(i)->GetType() == FilterOperation::REFERENCE)
for (const auto& operation : operations_) {
if (operation->GetType() == FilterOperation::REFERENCE ||
operation->GetType() == FilterOperation::BOX_REFLECT)
return true;
}
return false;
......
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