Commit Graph
52 Commits
Author SHA1 Message Date
Boris Chiou 705a1fde93 Bug 1915286 - Use 0rad as the default value if the path length is zero. r=dholbert
When ths path length is zero, we may get (0, 0) as the tangent angle
from `ComputePointAtLength()`. Using (0, 0) to atan2() may get an
undefined result. We should avoid this, so use 0rad. This makes more
sense and match other browsers.

Differential Revision: https://phabricator.services.mozilla.com/D220353
2024-08-28 05:10:59 +00:00
Boris Chiou 2206399c45 Bug 1884425 - Introduce PathOrShapeFunciton for path() and shape(). r=firefox-style-system-reviewers,zrhoffman
Use this as a wrapper for `path()` and `shape()`, so it'd be easier to
specialize its `Animate` trait.

Differential Revision: https://phabricator.services.mozilla.com/D205490
2024-03-28 19:42:13 +00:00
Boris Chiou 57211fe21c Bug 1884424 - Support shape() for offset-path and render it. r=layout-reviewers,emilio
We treat it as other basic shapes (excluding path(), which has some
special handling and it doesn't rely on the current layout position).

Therefore, we don't have any implementation for caching and we would like to
leave this part to Bug 1837042.

Also, add some more simple tests in css/motion to make sure we render it
properly.

Differential Revision: https://phabricator.services.mozilla.com/D204440
2024-03-27 20:18:38 +00:00
Boris Chiou e086e6b42b Bug 1823463 - Make PathCommand as the specialization of GenericShapeCommand. r=emilio
Also, we don't have Unkonwn type, so we have to do some minor
refactoring in BuildPath(), and templatize this function so we can use
it for both shape() and path().

This patch doesn't change the behavior.

Note that we instantiate BuildPath() with CSSFloat for now. Once we
instantiate it for StyleAngle and LengthPercentage (i.e. shape()), we
have to tweak this function more. Let's do that in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D202883
2024-03-18 21:20:29 +00:00
Boris Chiou 5621be82f7 Bug 1823463 - Support shape() for clip-path property in style. r=emilio
Implement the style part for shape(). Besides, update some issues in the
test file, e.g. avoid using viewport height so we get the fixed result
on different devices.

I will refactor `PathCommand` to let it be a specialization of
`GenericShapeCommand` in the following path.

Differential Revision: https://phabricator.services.mozilla.com/D202882
2024-03-18 21:20:28 +00:00
Boris Chiou 2058fd2c6b Bug 1870200 - Break the cyclic dependency if any of the desendants uses non-scaling-stroke. r=emilio
While we are computing the transform-box:stroke-box, for CSS Transforms or
Motion path Transforms, we have to avoid the cyclic dependency not only
for the SVG geometry frame itself, but also for the desendants of
the SVG container frame. Therefore, we just compute its fill-box (i.e.
make |getStroke| be false).

https://github.com/w3c/csswg-drafts/issues/9640

Differential Revision: https://phabricator.services.mozilla.com/D203184
2024-03-04 20:46:05 +00:00
Robert Longson d5190a80fb Bug 1836831 - don't try to resolve ray with StrokeBox when non-scaling-stroke is in effect r=boris
Differential Revision: https://phabricator.services.mozilla.com/D195552
2023-12-06 09:19:01 +00:00
Emilio Cobos Álvarez c27730d3df Bug 1364813 - Remove IsFrameOfType, use non-virtual checks. r=jwatt
Extend the per-frame-class bit we have to devirtualize IsLeaf to also
devirtualize IsFrameOfType. That is, move this data to FrameClasses.py.

This was done by going through all the frame classes, trying to preserve
behavior.

The only quirky thing is that I had to add two more trivial frame
classes, `nsAudioFrame` for audio elements, and
`nsFloatingFirstLetterFrame`. That's because these frame classes were
returning different answers at runtime, but they do this only on
conditions that trigger frame reconstruction (floating, and being an
audio element, respectively).

Differential Revision: https://phabricator.services.mozilla.com/D194703
2023-11-26 22:17:28 +00:00
Boris Chiou fc69b7603a Bug 1855756 - Fix the edge cases when the angle is 0deg (or 90deg) for ray(). r=hiro
It looks like our formula doesn't work well for 0deg and 90deg because
it's not a triangle when theta is 0deg or 90deg. So we handle them
separately.

Differential Revision: https://phabricator.services.mozilla.com/D191495
2023-10-20 03:41:10 +00:00
Boris Chiou 148393c7ad Bug 1852323 - Part 2: Fix the mapping of StyleGeometryBox for mask-clip. r=emilio
Also, drop `nsLayoutUtils::ComputeGeometryBox()` and avoid doing mapping
in `ComputeHTMLReferenceRect()` and `ComputeSVGReferenceRect()`. The
caller should handle it properly because each property uses its own mapping
between CSS box and SVG box.

Note:
1. mask-clip-3.html is copied from mask-clip-1.html but just replace
   css boxes with svg boxes.
2. mask-clip-4.html is copied from mask-clip-2.html but just replace
   svg boxed with css boxes.

Differential Revision: https://phabricator.services.mozilla.com/D188316
2023-10-10 22:00:32 +00:00
Boris Chiou c685059bd0 Bug 1856471 - Ignore min-x and min-y when computing view-box (so we return origin box). r=dholbert
Per https://github.com/web-platform-tests/interop/issues/509, we update
the coordinate to match the spec, i.e. When the viewBox includes non-zero min-x
or min-y offsets, this origin box does not actually correspond to the visible
region rectangle defined by the viewBox.
https://drafts.csswg.org/css-box-3/#valdef-box-view-box

Also simplify mask-clip-2.html and mask-origin-3.html so that their
viewBox is anchored at the origin so it is the same as the origin box.

Differential Revision: https://phabricator.services.mozilla.com/D190325
2023-10-10 06:26:51 +00:00
Boris Chiou c691d750aa Bug 1819464 - Part 2: Add content-box and stroke-box into transform-box in style. r=emilio
Also, add a prefernce for content-box and stroke-box. So we have to
define a new type, TransformBox, and let content-box and stroke-box
behind the preference.

Differential Revision: https://phabricator.services.mozilla.com/D185363
2023-08-22 19:49:03 +00:00
Boris Chiou d9c16d7c50 Bug 1598158 - Resolve URL to SVG shape elements. r=emilio
Also update offset-path-url-001.html because it seems its ref html is
incorrect per the spec. We are using its `<coord-box>` (i.e. the reference box
of its containing block) as the viewport and user coordinate system, so its
offset-starting-position should be independent from its current position
from CSS reflow. The SVG shape element always provides the offset starting
position.

So I tweak offset-path-url-001.html a little bit to make it passed for all
browsers, and add some other tests to cover the case mentioned above and
other cases.

Differential Revision: https://phabricator.services.mozilla.com/D184431
2023-08-07 22:04:02 +00:00
Boris Chiou dde7a61d0e Bug 1598158 - Add IsClosedLoop() for SVGGeometryElement. r=emilio
Per https://drafts.fxtf.org/motion/#path-distance, we follow these rules
when `offset-path` references to a SVG shape:

1. Offset paths (including references to SVG Paths) are closed loops only if
   the final command in the path list is a closepath command ("z" or "Z"),
   otherwise they are unclosed intervals.
2. References to SVG circles, ellipses, images, polygons and rects are closed
   loops.
3. References to SVG lines and polylines are unclosed intervals.

Also, rename `mIsClosedIntervals` as `mIsClosedLoop` to be consistent.

Differential Revision: https://phabricator.services.mozilla.com/D184430
2023-08-07 22:04:02 +00:00
Boris Chiou 24398b1861 Bug 1598158 - Support offset-path:url() in style. r=devtools-reviewers,emilio
In layout, we build a default `path("m 0 0")` for now. We will implement
it later.

Besides, we don't support compositor animations for `url()`, so we don't
have to serialize it for IPC.

Note:
`<url>` includes `url()` and `src()`. For now we only support `url()`.
We should revisit `src()` in Bug 1845390.

Differential Revision: https://phabricator.services.mozilla.com/D184429
2023-08-07 22:04:01 +00:00
Boris Chiou 43bb1fa8a2 Bug 1842277 - Compute <basic-shape-rect> to the equivalent inset() function. r=devtools-reviewers,emilio
Per spec
https://drafts.csswg.org/css-shapes-1/#basic-shape-computed-values, and
the spec issue, https://github.com/w3c/csswg-drafts/issues/9053,
all <basic-shape-rect> functions compute to the equivalent inset() function.
i.e.
`xywh(x y w h)` computes to
`inset(y calc(100% - x - w) calc(100% - y - h) x)`

The basic concept is to use `BasicShapeRect` as the specified value of
`<basic-shape-rect>`, i.e. inset()/xywh()/rect(), and its computed value is
the equivalent `InsetRect`, and so it becomes possible to interpolate among
these three functions.

Also, we can drop BuildXywhPath() and ComputeRect() because now there is
only inset() function when building gfx::Path.

Besides, tweak the test, offset-path-shape-xywh-003.html, because the original
test, `xywh(10% 10% 80% 80%)`, has to calculate `calc(100% - 10% - 80%)`.
Its result is `Percentage(0.099999964)` in Rust code, and then it makes us
compute an imprecision inset rect when building the gfx::path, which results in
a transform with the sub-pixel translation. So change it to
`xywh(10% 10% 90% 90%)` to avoid adding fuzzy tolerance.

Differential Revision: https://phabricator.services.mozilla.com/D183221
2023-07-12 20:16:47 +00:00
Boris Chiou 4f1e83c297 Bug 1786160 - Support xywh() for offset-path. r=emilio
And rename some functions, e.g. BuildInsetPath as BuildRectPath and
ComputeInsetRadii as ComputeRectRadii, because we would like to use it for
inset()/xywh()/rect(). All of them define the similar rectangles.

Also, tweak the tests:
1. tweak offset-path-shape-xywh-001.html to avoid the element just at
   the bottom-right corner of path because there is no tangent angle at this
   point. Its direction angle could be 90deg or 180deg, depends on the
   implementation.
2. tweak offset-path-shape-xywh-002.html and
   offset-path-shape-xywh-002-ref.html together because it seems the
   original ref file is incorrect. The test was added by Blink and the
   implementation of xywh() in Blink uses the height of the reference box to
   resolve the precentage value of the width of the transformed box.
   It doesn't make sense because we should use the width of the reference box
   to resolve it. So tweak the test and its reference file together
   based on Gecko's result.

Differential Revision: https://phabricator.services.mozilla.com/D182420
2023-07-07 18:12:41 +00:00
Boris Chiou 0bde3ad169 Bug 1786160 - Rename inset as rect in ShapeUtils. r=emilio
We would like to use these function for all rectangular shape, i.e.
inset()/xywh()/rect(). So rename them to avoid confusion.

No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D182422
2023-07-07 18:12:41 +00:00
Boris Chiou 12bd1f78e9 Bug 1786160 - Support xywh() in style. r=emilio
Also, add layout.css.basic-shape-xywh.enabled and enable it on Nightly

Differential Revision: https://phabricator.services.mozilla.com/D182419
2023-07-07 18:12:40 +00:00
Boris Chiou 2a062a0590 Bug 1598156 - Part 8: Support Compositor animations for all basic shapes. r=emilio,hiro
This patch sends the information of border-radius to the compositor as
well, so we can use it if offset-path uses coord-box only.

Note:
We repaint the frame if border-radius property gets changed, and rebuild
the display item. In this case, we resend the transaction of compositor
animation as well. Therefore, we don't have to block the compositor animations
if they depends on border-radius (i.e. use coord-box only).

We may need a better way to check what should we pass to the compositor,
for motion path, in Bug 1838977.

Differential Revision: https://phabricator.services.mozilla.com/D179631
2023-06-26 23:23:55 +00:00
Boris Chiou 9019fe65c6 Bug 1598156 - Part 7: Support <coord-box> without any function. r=emilio
I tweak css/motion/offset-path-coord-box-001.html a little bit to
avoid decimals in the reference file.

For offset-path-coord-box-002.html and offset-path-coord-box-003.html,
I make the border width larger so it'd be clear to see the difference.
Also the original reference files are not correct because they always use
border-box, so I also fix them to use the correct box.

Also, rename offset-path-geometry-box.html as offset-path-coord-box-004.html,
because there is no "geometry-box" in the spec. We are using "coord-box"
now.

Differential Revision: https://phabricator.services.mozilla.com/D181317
2023-06-26 23:23:55 +00:00
Boris Chiou b5c5779e3d Bug 1598156 - Part 6: Build path for basic shapes. r=emilio
Basically, the fuzzy happens because the direction angle in circle(),
ellipse(), and inset() can not be equal to the degree perfectly (due to
the arc drawing implementation and the anti-alias around the element),
so we need some tolerance.

And drop offset-path-shape(-ref).html because it has been removed from
the upstream repo.

Differential Revision: https://phabricator.services.mozilla.com/D179630
2023-06-26 23:23:55 +00:00
Boris Chiou cf32d4bad8 Bug 1598156 - Part 5: Add some helper functions to check the type of StyleOffsetPath. r=emilio
The data structure of StyleOffsetPath is complicated, so adding some
useful functions to simplify the code.

No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D181316
2023-06-26 23:23:55 +00:00
Boris Chiou 1e453107cb Bug 1598156 - Part 4: Rename ComputeRayOrigin as ComputePosition. r=emilio
I'd like to reuse it to compute the center position for circle() and
ellipse(), so use a better function name.

No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D181315
2023-06-26 23:23:54 +00:00
Boris Chiou 171a85a858 Bug 1598156 - Part 3: Remove RayReferenceData. r=emilio
I'd like to reuse the data in RayReferenceData for all basic shapes,
so unpack RayReferenceData and drop this struct.

Also, use `nsPoint` for the current position and use `nsRect` for coord-box
because we use these types (i.e. app units) in ShapeUtils.

Besides, remove the usage of Maybe from nsStyleTransformMatrix.h and
just accept the pointer of ResolvedMotionPathData to avoid including
the entire header.

No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D181008
2023-06-26 23:23:54 +00:00
Boris Chiou f9e6b66699 Bug 1598156 - Part 2: Rename Path as Shape in OffsetPathData. r=emilio
Because we'd like to use it for all basic shapes.

No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D181314
2023-06-26 23:23:54 +00:00
Boris Chiou 05f2d34740 Bug 1581237 - Use <coord-box> as the reference box of the containing block for ray(). r=emilio
So now we use <coord-box> to decide which box we should use. Also, we
have to tweak the calculation of path length to take the top left point
into consideration, for padding-box and content-box. border-box is the
default value, so other tests should cover it.

Differential Revision: https://phabricator.services.mozilla.com/D180397
2023-06-16 22:43:34 +00:00
Boris Chiou e115cb88e3 Bug 1837305 - Part 6: Update AnimationValue for offset-path. r=emilio
We are using NonNegative now for offset-path, so just like clip-path, we
have to make sure we don't get the negative radius for circle and ellipse,
and don't get the negative border-radius for inset. Therefore, we have to
convert the computed value into animated value when doing interpolation,
and then clamp the value to make sure it is always >= 0 when converting
it back to computed value, just like what we do for clip-path in Bug 1512883.

Also drop the normalization of SVGPathData in AnimationInfo when
preparing offset-path for compositor animations. It's useless because we
"always" do normalization in SVGPathData::animate().

Differential Revision: https://phabricator.services.mozilla.com/D180284
2023-06-15 00:04:00 +00:00
Boris Chiou e8ba941f2d Bug 1837305 - Part 5: Add coord-box to offset-path property. r=devtools-reviewers,emilio
This patch makes sure the syntax of `offset-path` is:
  `offset-path: none | <offset-path> || <coord-box>`.

Differential Revision: https://phabricator.services.mozilla.com/D179628
2023-06-15 00:03:59 +00:00
Boris Chiou 8958a0719a Bug 1837305 - Part 4: Update OffsetPath to use BasicShape in style system. r=devtools-reviewers,emilio
We rewrite the data structure of OffsetPath to support all basic shapes.
However, We don't build the gfx::Path for basic shapes other than path()
for now because the current caching mechanism (on the main thread) doesn't
work for basic shapes. It's layout dependent.

Note:
1. Update offset-path-interpolation-006.html to make sure the start value
   and the end value have `at <position>`. `offset-path` doesn't set center
   as default for `at <position>`, so if any of the values omits the
   `at <position>`, we expect they are not interpolated in Gecko.
   This is different from Blink, they still use center as the default value
   for interpolation.
2. We still have some failures in offset-path-interpolation-006.html
   beacuse we don't clamp the negative radius/radii and the negative
   border-radius. We will handle it in the following patches.
3. We will add `<coord-box>` in the later patch.
4. Adding Deserialize and Serialize is necessary for compositor
   animations.

Differential Revision: https://phabricator.services.mozilla.com/D179627
2023-06-15 00:03:59 +00:00
Boris Chiou d27c1ecd10 Bug 1820070 - Part 4: Send offset-position to the compositor. r=emilio
We send offset-position to the compositor, just like other similar
properties, e.g. offset-rotate, offset-anchor. This includes extracting
this animation value, doing serialization and sending it via IPC.

So now we can run the animation of ray() on the compositor properly.

Differential Revision: https://phabricator.services.mozilla.com/D179862
2023-06-06 21:40:52 +00:00
Boris Chiou 4e52df356d Bug 1820070 - Part 3: Apply "at <position>" and offset-position to ray function. r=emilio
We apply offset-position and "at <position>" to ray function. However,
only use it on the main thread. For compositor animation, we will finish
it in the following patches.

No need to add tests because there are tests in the WPT upstream repo already:
css/motion/offset-path-ray-011.html
css/motion/offset-path-ray-012.html
css/motion/offset-path-ray-013.html
css/motion/offset-path-ray-014.html

Those tests should cover what we do in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D179861
2023-06-06 21:40:52 +00:00
Boris Chiou d3533e4cb3 Bug 1820070 - Part 2: Add at <position> into ray() in style system. r=emilio
We reuse PositionOrAuto here, and let "auto" represent the situation when the
author omits "at <position>" because it has a special meaning.

https://drafts.fxtf.org/motion-1/#valdef-ray-at-position

Note: No need to update css/motion/parsing/offset-path-parsing-valid.html
because Blink added some to the upstream repo already.

Differential Revision: https://phabricator.services.mozilla.com/D179860
2023-06-06 21:40:51 +00:00
Boris Chiou 478f7e3a4f Bug 1821450 - Update the calculation of contain keyword in ray(). r=emilio
Per the spec change, when using contain keyword, the path’s length is reduced
by half the width or half the height of the element’s border box, whichever is
larger, and floored at zero.

Differential Revision: https://phabricator.services.mozilla.com/D177563
2023-05-26 00:14:36 +00:00
Razvan Cojocaru 363946e17f Bug 1060421 - Change the type of [Int]PointTyped::[x|y] back to [Int]CoordTyped. r=botond
[Int]CoordTyped no longer inherits Units because otherwise
instances of [Int]IntPointTyped may get one Base subobject because
it inherits Units, and others because of BasePoint's Coord members,
which end up increasing the [Int]CoordTyped's objects size (since
according to the ISO C++ standard, different Base subobject are
required to have different addresses).

Differential Revision: https://phabricator.services.mozilla.com/D160713
2022-11-04 18:29:35 +00:00
Daniel Holbert 29451e8849 Bug 1730741 part 2: Add includes and forward-decls to fix non-unified-build bustage in layout/base, and remove REQUIRES_UNIFIED_BUILD declaration. r=emilio
After the fixes in this patch, the REQUIRES_UNIFIED_BUILD declaration is no
longer needed, so I'm removing it here.  This directory now builds successfully
with that removed and with ac_add_options --disable-unified-build in the
mozconfig.

Differential Revision: https://phabricator.services.mozilla.com/D125601
2021-09-15 18:48:17 +00:00
longsonr ba1943ecf8 Bug 1259861 - Move everything else into the mozilla namespace in layout/svg r=dholbert
Also: adjust include paths to be consistent for usages of various SVG headers,
and remove unused SVG includes (mostly for "utils" classes),
and drop stray "ns" from already-renamed SVG classes in various code comments.

Differential Revision: https://phabricator.services.mozilla.com/D83140
2020-07-11 02:20:20 +00:00
Emilio Cobos Álvarez 7e256153ad Bug 1613490 - Cleanup usage of ReferenceBox. r=miko
To avoid computing transform bounds over and over. It is generally just better.

Replace the various "overridebounds" thingies by using the "fallback" of the
transform-reference-box code which we need anyway.

Differential Revision: https://phabricator.services.mozilla.com/D61890
2020-02-07 13:34:42 +00:00
Boris Chiou 61103664ac Bug 1609786 - Make the empty svg path valid. r=emilio
Per SVG2 spec, the EBNF allows the path data string to be empty.
An empty path data string disables rendering of the path.
Therefore, we should make path('') a valid path string.

The related spec issue: https://github.com/w3c/fxtf-drafts/issues/392.
Now we serialize `path("")` as `path("")` for offset-path and clip-path.

Differential Revision: https://phabricator.services.mozilla.com/D60771
2020-01-24 18:59:03 +00:00
Boris Chiou ea40dc1ec2 Bug 1592822 - Use Serde for SVGOffsetPath. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D60087
2020-01-22 20:18:35 +00:00
Bogdan Tara 3426efd4f4 Backed out 6 changesets (bug 1592822) for bustages complaining about layout/painting/nsDisplayList.cpp CLOSED TREE
Backed out changeset 90d0f2ebd310 (bug 1592822)
Backed out changeset 9890bad86a0e (bug 1592822)
Backed out changeset 43870cc90433 (bug 1592822)
Backed out changeset d80e0e3f5b87 (bug 1592822)
Backed out changeset 99be49183325 (bug 1592822)
Backed out changeset 9ce641556acc (bug 1592822)
2020-01-22 21:17:39 +02:00
Boris Chiou 6d13e9ffbb Bug 1592822 - Use Serde for SVGOffsetPath. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D60087
2020-01-22 18:40:11 +00:00
Boris Chiou 8ce5f48338 Bug 1591629 - Rename mozilla::MotionPathData as mozilla::ResolvedMotionPathData. r=hiro
To avoid the ambiguous name because we also have layers::MotionPathData.

Differential Revision: https://phabricator.services.mozilla.com/D59074
2020-01-08 09:02:38 +00:00
Boris Chiou 7dc27b5bd6 Bug 1591629 - Split TransformData into 2 parts - transform data and motion path data. r=hiro
So we don't need to create motion path data if there is no offset-path style
and no animations of offset-path.

Differential Revision: https://phabricator.services.mozilla.com/D57907
2020-01-08 09:02:36 +00:00
Boris Chiou cc7c60e573 Bug 1601486 - Use bbox for calculating the alignment for motion path transformation on eSVGContainer elements (e.g. <g>). r=longsonr
When we apply the transformation on the <g> element, its transformation also
performs on its child elements. So Motion-path should also work well in this
case.

For offset-path:path(), we have to make sure the element is on the svg path, no
matter what is its x and y values. That's why we have to calculate the
the frame position of the transformed SVG element if transform-box is fill-box.
However, for <g> element, its nsIFrame::GetPosition() is (0, 0), so we have to
calculate the geometry bbox instead, to make sure it works well on <g> or other
svg transformed elements.

Differential Revision: https://phabricator.services.mozilla.com/D55888
2019-12-09 21:28:21 +00:00
jeffin143 a031243d4d Bug 1597881 : convert NS_STYLE_STROKE_LINECAP_* to an enum class in nsStyleConsts.h r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D53908
2019-11-21 06:07:30 +00:00
Boris Chiou ec0567a623 Bug 1484780 - Cache gfx::Path to avoid building and flattening path at each restyle cycle. r=heycam
In most cases, we run an animation on an object by changing its
offset-distance/offset-rotate, but keep its offset-path the same.
Building and flattening the path is sometime expensive, especially for
large path, so caching it makes sense to us and have a significant
performance improvement. This is for the main thread motion path
animations.

Note: Even though we support compositor animations for motion path,
nsIFrame::GetTransformMatrix() is still called during the animations for
other usages, so we may still build the gfx::Path on the main thread
without this patch, so this improvement becomes necessary for most cases.

Differential Revision: https://phabricator.services.mozilla.com/D46667
2019-11-07 03:17:58 +00:00
Boris Chiou 4d3a02f5b6 Bug 1429305 - Cache gfx path. r=hiro
We cache the path in AnimationInfo for layers, and in
CompsoitorAnimationStorage for web-renderer.

Differential Revision: https://phabricator.services.mozilla.com/D50013
2019-10-31 21:36:39 +00:00
Boris Chiou b9375cd6f7 Bug 1429305 - Add new layer messages for passing motion path info. r=hiro,mattwoodrow
This also includes the implementation of SetAnimatable, FromAnimatable,
and merge the final matrix with motion path.

Besides, we always use PathBuilderSkia for calculating the gfx::Path for
web-renderer.

Differential Revision: https://phabricator.services.mozilla.com/D50011
2019-10-31 20:07:41 +00:00
Boris Chiou e0ec0926db Bug 1429305 - Make PathBuilder as a parameter. r=hiro
On the compositor thread in GPU process (i.e. web-renderer), gfxPlatform() is
not initialized, so we don't have the DrawTarget information.
Fortunately, all we need is to calculate the motion point and direction
vector, so we don't have to care about which backend we use.

Therefore, make PathBuilder as a parameter, so we can just pass a valid
PathBuilder on the compositor thread. For main thread (i.e. content
process), using the original way is fine.

Differential Revision: https://phabricator.services.mozilla.com/D50010
2019-10-31 20:07:31 +00:00