Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(550)

Issue 2278273004: Fix CSS reference filters with negative transformed children. (Closed)

Created:
4 years, 3 months ago by Stephen White
Modified:
4 years, 3 months ago
CC:
ajuma+watch_chromium.org, blink-reviews, blink-reviews-api_chromium.org, blink-reviews-paint_chromium.org, blink-reviews-platform-graphics_chromium.org, Rik, cc-bugs_chromium.org, chromium-reviews, danakj+watch_chromium.org, dglazkov+blink, dshwang, drott+blinkwatch_chromium.org, krit, f(malita), Justin Novosad, pdr+graphicswatchlist_chromium.org, rwlbuis, Stephen Chennney, slimming-paint-reviews_chromium.org, wkorman
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix CSS reference filters with negative transformed children. The software raster path for filters had always used the bounds top-left corner as the origin for filters. This doesn't work if the filtered primitive contains a negative-transformed child, since the saveLayer() bounds should be negative (non-zero) with respect to the primitive. The solution is to pass through the origin explicitly, and translate to that rather than the bounds origin before applying the filter. This will determine the origin for crop rects, lighting positions, etc. It turns out that there are certain CSS properties (e.g., "outline") which affect the size of the layer, but are not supposed to affect layout. In cc, we had previously been using the layer's src_rect origin to offset filter parameters in order to compensate for clipping, etc, but this is insufficient to handle "outset", which shows up in the layer position but shouldn't affect filter origin. The offset that we want was already being computed for us in GraphicsLayer::setOffsetFromLayoutObject()), but not forwarded to cc. I've done so, with the attendant changes to WebLayer, WebLayerImpl, mojo bindings, struct_traits, cc::Layer, cc::LayerImpl, EffectNode, RenderSurfaceImpl, and RenderPassDrawQuad. (I wish I was kidding.) BUG=638091 R=ajuma@chromium.org, chrishtr@chromium.org, mbarbella@chromium.org, sky@chromium.org, wkorman@chromium.org TBR=sky@chromium.org CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel Committed: https://crrev.com/5941ecb0aea741b27fea283065b25428588dbe43 Cr-Commit-Position: refs/heads/master@{#415043}

Patch Set 1 #

Patch Set 2 : Fix unit test. #

Patch Set 3 : Fix unittests results. #

Patch Set 4 : Add a reftest. #

Patch Set 5 : Update to ToT #

Patch Set 6 : Fix BeginFilterDisplayItem::replay() on the Blink side. #

Total comments: 3

Patch Set 7 : Fix for box reflections. #

Patch Set 8 : Restore the box reflection offset, but only for the cc path. #

Patch Set 9 : Initial hacky fix for filters with outline: pass origin through cc::FilterOperations. #

Patch Set 10 : Fix upstream #

Patch Set 11 : Fix largest display item size. #

Patch Set 12 : Mark tests with minor pixel diffs as NeedsRebaseline. #

Patch Set 13 : Update to ToT #

Patch Set 14 : Plumb filter origin through cc. #

Patch Set 15 : Rename filter_origin -> filters_origin. #

Patch Set 16 : SkPoint -> FloatPoint, gfx::PointF as appropriate. #

Total comments: 9

Patch Set 17 : Fixes per review comments; add pixeltest; fix software compositor #

Patch Set 18 : Remove TODO. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+330 lines, -206 lines) Patch
M cc/blink/web_display_item_list_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +3 lines, -1 line 0 comments Download
M cc/blink/web_display_item_list_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +3 lines, -2 lines 0 comments Download
M cc/blink/web_layer_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -0 lines 0 comments Download
M cc/blink/web_layer_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +4 lines, -0 lines 0 comments Download
M cc/ipc/cc_param_traits_macros.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M cc/ipc/cc_param_traits_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +3 lines, -1 line 0 comments Download
M cc/ipc/quads.mojom View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +5 lines, -0 lines 0 comments Download
M cc/ipc/quads_struct_traits.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +6 lines, -0 lines 0 comments Download
M cc/ipc/quads_struct_traits.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M cc/ipc/struct_traits_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -1 line 0 comments Download
M cc/layers/layer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +4 lines, -0 lines 0 comments Download
M cc/layers/layer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +9 lines, -0 lines 0 comments Download
M cc/layers/layer_impl_test_properties.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -0 lines 0 comments Download
M cc/layers/render_surface_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M cc/layers/render_surface_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +5 lines, -1 line 0 comments Download
M cc/output/gl_renderer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +10 lines, -6 lines 0 comments Download
M cc/output/overlay_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 8 chunks +16 lines, -8 lines 0 comments Download
M cc/output/renderer_pixeltest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 8 chunks +17 lines, -40 lines 0 comments Download
M cc/output/software_renderer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -1 line 0 comments Download
M cc/playback/display_item_list_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +6 lines, -4 lines 0 comments Download
M cc/playback/filter_display_item.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +7 lines, -2 lines 0 comments Download
M cc/playback/filter_display_item.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +12 lines, -8 lines 0 comments Download
M cc/playback/largest_display_item.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -4 lines 0 comments Download
M cc/quads/draw_quad_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 8 chunks +27 lines, -50 lines 0 comments Download
M cc/quads/render_pass_draw_quad.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +8 lines, -0 lines 0 comments Download
M cc/quads/render_pass_draw_quad.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +6 lines, -12 lines 0 comments Download
M cc/quads/render_pass_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +4 lines, -10 lines 0 comments Download
M cc/surfaces/surface_aggregator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +4 lines, -10 lines 0 comments Download
M cc/test/render_pass_test_utils.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +11 lines, -24 lines 0 comments Download
M cc/test/surface_aggregator_test_helpers.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M cc/test/surface_hittest_test_helpers.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M cc/trees/effect_node.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -0 lines 0 comments Download
M cc/trees/effect_node.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M cc/trees/layer_tree_host_pixeltest_filters.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +44 lines, -0 lines 0 comments Download
M cc/trees/property_tree_builder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +9 lines, -0 lines 0 comments Download
M services/ui/ws/frame_generator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/TestExpectations View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/css3/filters/filter-region-negative-transformed-child.html View 1 2 3 9 1 chunk +33 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/css3/filters/filter-region-negative-transformed-child-expected.html View 1 2 3 9 1 chunk +32 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/paint/BoxReflectionUtils.cpp View 1 2 3 4 5 6 8 9 1 chunk +0 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/core/paint/FilterPainter.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/paint/FilterDisplayItem.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +6 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/paint/FilterDisplayItem.cpp View 1 2 3 4 5 9 1 chunk +5 lines, -4 lines 0 comments Download
M third_party/WebKit/public/platform/WebDisplayItemList.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/public/platform/WebLayer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +4 lines, -0 lines 0 comments Download

Messages

Total messages: 85 (66 generated)
Stephen White
PTAL. ajuma@: cc/* christhtr@: third_party/WebKit/* Thanks!
4 years, 3 months ago (2016-08-26 15:24:48 UTC) #20
ajuma
cc/ lgtm
4 years, 3 months ago (2016-08-26 17:30:07 UTC) #25
wkorman
One minor comment, the rest looks good to me. https://codereview.chromium.org/2278273004/diff/100001/cc/playback/filter_display_item.cc File cc/playback/filter_display_item.cc (right): https://codereview.chromium.org/2278273004/diff/100001/cc/playback/filter_display_item.cc#newcode75 cc/playback/filter_display_item.cc:75: ...
4 years, 3 months ago (2016-08-26 17:45:52 UTC) #27
Stephen White
https://codereview.chromium.org/2278273004/diff/100001/cc/playback/filter_display_item.cc File cc/playback/filter_display_item.cc (right): https://codereview.chromium.org/2278273004/diff/100001/cc/playback/filter_display_item.cc#newcode75 cc/playback/filter_display_item.cc:75: canvas->translate(-origin_.x(), -origin_.y()); On 2016/08/26 17:45:52, wkorman wrote: > Are ...
4 years, 3 months ago (2016-08-26 19:22:02 UTC) #30
Stephen White
+jbroman as an FYI on the changes to BoxReflectionUtils. Looks like you were working around ...
4 years, 3 months ago (2016-08-26 19:23:29 UTC) #31
jbroman
On 2016/08/26 at 19:23:29, senorblanco wrote: > +jbroman as an FYI on the changes to ...
4 years, 3 months ago (2016-08-26 19:24:46 UTC) #32
wkorman
lgtm https://codereview.chromium.org/2278273004/diff/100001/cc/playback/filter_display_item.cc File cc/playback/filter_display_item.cc (right): https://codereview.chromium.org/2278273004/diff/100001/cc/playback/filter_display_item.cc#newcode75 cc/playback/filter_display_item.cc:75: canvas->translate(-origin_.x(), -origin_.y()); On 2016/08/26 19:22:01, Stephen White wrote: ...
4 years, 3 months ago (2016-08-26 19:35:25 UTC) #33
chrishtr
lgtm
4 years, 3 months ago (2016-08-26 19:54:26 UTC) #34
Stephen White
After playing whack-a-mole with a series of bugs, this now should be passing all layout ...
4 years, 3 months ago (2016-08-29 20:05:26 UTC) #69
Martin Barbella
On 2016/08/29 20:05:26, Stephen White wrote: > After playing whack-a-mole with a series of bugs, ...
4 years, 3 months ago (2016-08-29 20:26:47 UTC) #70
ajuma
https://codereview.chromium.org/2278273004/diff/300001/cc/layers/layer.cc File cc/layers/layer.cc (right): https://codereview.chromium.org/2278273004/diff/300001/cc/layers/layer.cc#newcode1138 cc/layers/layer.cc:1138: layer->SetFiltersOrigin(inputs_.filters_origin); This shouldn't be needed (since filters_origin will get ...
4 years, 3 months ago (2016-08-29 20:28:43 UTC) #71
Stephen White
https://codereview.chromium.org/2278273004/diff/300001/cc/layers/layer.cc File cc/layers/layer.cc (right): https://codereview.chromium.org/2278273004/diff/300001/cc/layers/layer.cc#newcode485 cc/layers/layer.cc:485: SetSubtreePropertyChanged(); // TODO(senorblanco) or SetLayerPropertyChanged? Ali: any comment on ...
4 years, 3 months ago (2016-08-29 21:10:54 UTC) #72
Stephen White
4 years, 3 months ago (2016-08-29 21:11:00 UTC) #73
ajuma
Thanks, lgtm https://codereview.chromium.org/2278273004/diff/300001/cc/layers/layer.cc File cc/layers/layer.cc (right): https://codereview.chromium.org/2278273004/diff/300001/cc/layers/layer.cc#newcode485 cc/layers/layer.cc:485: SetSubtreePropertyChanged(); // TODO(senorblanco) or SetLayerPropertyChanged? On 2016/08/29 ...
4 years, 3 months ago (2016-08-29 21:39:30 UTC) #75
Stephen White
https://codereview.chromium.org/2278273004/diff/300001/cc/layers/layer.cc File cc/layers/layer.cc (right): https://codereview.chromium.org/2278273004/diff/300001/cc/layers/layer.cc#newcode485 cc/layers/layer.cc:485: SetSubtreePropertyChanged(); // TODO(senorblanco) or SetLayerPropertyChanged? On 2016/08/29 21:39:30, ajuma ...
4 years, 3 months ago (2016-08-29 21:43:11 UTC) #76
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2278273004/340001
4 years, 3 months ago (2016-08-29 22:20:35 UTC) #80
sky
I'm assuming you added me for services/ui/ws/frame_generator.cc , which LGTM
4 years, 3 months ago (2016-08-29 22:59:58 UTC) #81
commit-bot: I haz the power
Patchset 18 (id:??) landed as https://crrev.com/5941ecb0aea741b27fea283065b25428588dbe43 Cr-Commit-Position: refs/heads/master@{#415043}
4 years, 3 months ago (2016-08-30 01:32:39 UTC) #84
Stephen White
4 years, 3 months ago (2016-08-30 01:32:40 UTC) #85
Message was sent while issue was closed.
Committed patchset #18 (id:340001) manually as
5941ecb0aea741b27fea283065b25428588dbe43 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698