All its members are optional, so we can just use it as a plain struct
rather than Maybe<> all around, which simplifies the code and prevents
silly bugs like bug 1779592.
Mostly automatic via:
rg -l 'SVGImageContext' . | xargs sed -i 's/Maybe<SVGImageContext>/SVGImageContext/g'
With trivial build fixes.
Not intended to change behavior.
Differential Revision: https://phabricator.services.mozilla.com/D151846
This patch doesn't change behavior; it's just a const-correctness fix.
Thanks to previous patches in this series, PaintStyleImageLayerWithSC's arg can
become const, so let's make that change and opportunistically make the same
change to the variables that callers pass in, where possible.
Differential Revision: https://phabricator.services.mozilla.com/D149677
This makes the context-value option for stroke width and dash properties in SVG glyphs work
consistently in non-1.0 devicePixelRatio situations (e.g. browser zoom, high-dpi displays).
Differential Revision: https://phabricator.services.mozilla.com/D146886
Although not needed right now (checkerboarding backgrounds get
a slice anyway due to being a different scroll root), this will
be important for the upcoming work to make backdrop filter
roots implicit. This allows WR to know when slicing up a content
slice if the prim is relevant to the backdrop root.
Differential Revision: https://phabricator.services.mozilla.com/D146145
Teach nsDisplay{Filters,BackdropFilters} to use a style that doesn't
belong to mFrame for the root frame, and use it as needed.
Remove the BackdropFilters::CanCreateWebrenderCommands call because it
was testing for StyleSVGEffects::mFilters rather than mBackdropFilters,
so it was doing nothing.
Differential Revision: https://phabricator.services.mozilla.com/D146188
This accelerates web-exposed SVG APIs such as getExtentOfChar() by avoiding the expensive
MeasureText() call when we're just getting the line-height metrics.
Differential Revision: https://phabricator.services.mozilla.com/D145717
This aims to prevent an O(n^2) performance situation when per-glyph
positioning is in use.
This reduces the time to load the testcase here from around 70s to 17s
in my local build. Still not great, but at least it's less of a disaster.
Differential Revision: https://phabricator.services.mozilla.com/D145631
This accelerates web-exposed SVG APIs such as getExtentOfChar() by avoiding the expensive
MeasureText() call when we're just getting the line-height metrics.
Differential Revision: https://phabricator.services.mozilla.com/D145717
This aims to prevent an O(n^2) performance situation when per-glyph
positioning is in use.
This reduces the time to load the testcase here from around 70s to 17s
in my local build. Still not great, but at least it's less of a disaster.
Differential Revision: https://phabricator.services.mozilla.com/D145631
Only return early from PaintFilteredFrame if the scale matrix determinant will
be zero. This should only occur if either the height or width of the context
matrix scale factors are zero.
Depends on D144669
Differential Revision: https://phabricator.services.mozilla.com/D145041
This problem was introduced by bug 1756197. The old code checked
for null before setting the path that was implicitly used by the fill.
This null check is retained at the other usage of
CreateClipPathForFrame()
Differential Revision: https://phabricator.services.mozilla.com/D144477
Make Link and SVGAElement agree on XLink handling, and make it more
explicit that SVGAElement needs to be a bit more special for SMIL.
Remove dead MathML XLink code.
Differential Revision: https://phabricator.services.mozilla.com/D142546
In bug 1758942 there was a bit of clipping logic for webrenderized svg images that was removed because we didn't know what it was useful for.
I still don't quite know, other than that it caused layout/reftests/svg/image/image-preserveAspectRatio-01-raster.svg and layout/reftests/svg/image/image-preserveAspectRatio-02-raster.svg to start failing when the gfx.webrender.svg-images pref is enabled, so let's revert it.
Depends on D141847
Differential Revision: https://phabricator.services.mozilla.com/D141848
The missing line is consistently called after ImageContainer::GetWidth/GetHeight (see TransformContextForPainting for example which would be the equivalent code path for the non-webrenderized case).
This fixes the wptest /density-size-correction/density-corrected-image-svg.html when active svg images are enabled.
Depends on D141846
Differential Revision: https://phabricator.services.mozilla.com/D141847
I wrote the previous code via trial and error by copying similar code without understanding much what the different values represent.
The result looks about right but I suspect it may be only right because of simplifying assumptions.
Differential Revision: https://phabricator.services.mozilla.com/D140726
We don't currently check whether the geometry has markers, nor do we try to render them properly with WebRender display items.
This is caught by the reftest paint-order-001.svg when active SVG images and rects are enabled.
Differential Revision: https://phabricator.services.mozilla.com/D140808
Previously, if ctx->GetDrawTarget() != maskTarget we end up adjusting the
matrix on ctx and not on the maskTarget.
Also, now that we're doing the correct adjustment of the maskTarget transform
we can remove code to set maskTarget's transform to identity.
Differential Revision: https://phabricator.services.mozilla.com/D139133
This avoids having to rasterize the path twice. Once for the clip path and once for
the fill. It will also give us correct antialiasing on the edges.
Differential Revision: https://phabricator.services.mozilla.com/D139137
We need them for SVG primitives.
This patch adds a bit of plumbing to disable snapping some of the primitives and forcing the antialiasing shader feature where needed, and uses it for SVG solid rectangles and images.
Differential Revision: https://phabricator.services.mozilla.com/D139024
Previously, we mostly went to the effort of setting the extra tranform to the
inverse of the context transform except for a case in PaintMask which really
didn't make any sense.
Differential Revision: https://phabricator.services.mozilla.com/D139148