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

Issue 1174393003: Unify content transformation calculations for SVG clip paths (Closed)

Created:
5 years, 6 months ago by pdr.
Modified:
5 years, 5 months ago
Reviewers:
fs
CC:
blink-reviews, blink-reviews-paint_chromium.org, blink-reviews-rendering, dshwang, krit, eae+blinkwatch, f(malita), fs, gyuyoung2, jchaffraix+rendering, kouhei+svg_chromium.org, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, pdr+svgwatchlist_chromium.org, rwlbuis, Stephen Chennney, slimming-paint-reviews_chromium.org, szager+layoutwatch_chromium.org, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Unify content transformation calculations for SVG clip paths This patch unifies the various content transformation calculations into "LayoutSVGResourceClipper::calculateContentTransformation(...)". This refactoring changes how transformed clip paths are applied to other transformed clip paths with userSpaceOnUse. With this patch we now match Gecko on the new test, though all implementations disagree in this area (IE11, Presto, WebKit) and the spec [2] is vague. [1] transformed-clip-in-transformed-clip.html [2] http://dev.w3.org/fxtf/css-masking-1/#elementdef-clippath BUG=500713

Patch Set 1 #

Patch Set 2 : Rebase #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+79 lines, -63 lines) Patch
A LayoutTests/svg/clip-path/transformed-clip-in-transformed-clip.html View 1 chunk +21 lines, -0 lines 2 comments Download
A LayoutTests/svg/clip-path/transformed-clip-in-transformed-clip-expected.html View 1 chunk +12 lines, -0 lines 0 comments Download
M Source/core/layout/svg/LayoutSVGResourceClipper.h View 1 2 chunks +5 lines, -3 lines 0 comments Download
M Source/core/layout/svg/LayoutSVGResourceClipper.cpp View 1 7 chunks +28 lines, -40 lines 5 comments Download
M Source/core/paint/SVGClipPainter.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/paint/SVGClipPainter.cpp View 1 3 chunks +12 lines, -19 lines 0 comments Download

Messages

Total messages: 3 (1 generated)
pdr.
5 years, 6 months ago (2015-06-16 06:25:46 UTC) #2
fs
5 years, 6 months ago (2015-06-16 09:30:15 UTC) #3
> With this patch we now match Gecko on the new test, though all implementations
disagree
> in this area (IE11, Presto, WebKit) and the spec [2] is vague.

Very vague indeed... I kind of would have expected the order(s) to be:

bboxTransform [or zoom] * 'transform'

which I believe would be consistent with oBB/uSOU treatment for paint servers.
Do we have test for the non-SVG effectiveZoom case? (I suspect that case is
pretty buggy though, but...)

https://codereview.chromium.org/1174393003/diff/20001/LayoutTests/svg/clip-pa...
File LayoutTests/svg/clip-path/transformed-clip-in-transformed-clip.html
(right):

https://codereview.chromium.org/1174393003/diff/20001/LayoutTests/svg/clip-pa...
LayoutTests/svg/clip-path/transformed-clip-in-transformed-clip.html:3: * {
Why do we need/want this?

https://codereview.chromium.org/1174393003/diff/20001/LayoutTests/svg/clip-pa...
LayoutTests/svg/clip-path/transformed-clip-in-transformed-clip.html:8: <svg
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="300" height="300">
Whole lotta namespace declarations... (that isn't needed.)

https://codereview.chromium.org/1174393003/diff/20001/Source/core/layout/svg/...
File Source/core/layout/svg/LayoutSVGResourceClipper.cpp (left):

https://codereview.chromium.org/1174393003/diff/20001/Source/core/layout/svg/...
Source/core/layout/svg/LayoutSVGResourceClipper.cpp:224: if
(!animatedLocalTransform.isInvertible())
This got dropped.

https://codereview.chromium.org/1174393003/diff/20001/Source/core/layout/svg/...
File Source/core/layout/svg/LayoutSVGResourceClipper.cpp (right):

https://codereview.chromium.org/1174393003/diff/20001/Source/core/layout/svg/...
Source/core/layout/svg/LayoutSVGResourceClipper.cpp:69: AffineTransform
LayoutSVGResourceClipper::calculateContentTransformation(const LayoutObject*
target, const FloatRect& targetBoundingBox)
const?

https://codereview.chromium.org/1174393003/diff/20001/Source/core/layout/svg/...
Source/core/layout/svg/LayoutSVGResourceClipper.cpp:77:
transform.scale(style()->effectiveZoom());
Shouldn't this apply before 'transform'?

https://codereview.chromium.org/1174393003/diff/20001/Source/core/layout/svg/...
Source/core/layout/svg/LayoutSVGResourceClipper.cpp:213: m_clipBoundaries =
contentTransformation.mapRect(m_clipBoundaries);
This makes m_clipBoundaries depend on a certain client - the previous
formulation was only dependent on the clip path itself. Maybe just sink this
part out of the function, and let m_clipBoundaries be in the local coordinate
space of the clipPath instead?

https://codereview.chromium.org/1174393003/diff/20001/Source/core/layout/svg/...
Source/core/layout/svg/LayoutSVGResourceClipper.cpp:223:
contentTransformation.inverse().mapPoint(point);
point = ...

Powered by Google App Engine
This is Rietveld 408576698