gecko-dev/layout/svg
cku 7249e683c3 Bug 1385239 - Part 2. Remove aTransform parameter from PaintFilteredFrame. r=mstange
There are two callers of nsFilterInstance::PaintFilteredFrame:
1. nsSVGUtils::PaintFrameWithEffects at [1]
   This function is used while painting a filtered element on a path which
   display item painting is not supported yet, such as drawing elements inside a
   indirect painted SVG object, such as a mask, a clipPath or a gradient object.

   Let's say we have a masked element, which refers to an SVG mask, and there is
   a filtered element inside that SVG mask.
   Using nsFilterInstance::PaintFilteredFrame to paint that filtered frame in
   the mask, we have to pass a gfxContext and a transform matrix to it. The
   transform of the gfxContext 'target' that we pass in consists of a transform
   from the referenced frame, of the masked frame, to the masked frame. We also
   pass in a transform matrix 'aTransform', this matrix contains a transform
   from the the masked frame to the filtered frame in *device units*, which
   means it contains css-to-dev-px scaling factor.

2. nsSVGIntegrationUtils::PaintFilter at [2]
   This function is used by normal display item painting.

   The same, we pass a gfxContext 'context' and a transform matrix 'tm' into
   nsFilterInstance::PaintFilteredFrame. The transform matrix of 'context'
   consists of a transform from the referenced frame, of the filtered frame,
   to this filtered frame, but the scale factor was taken out . The transform
   matrix 'tm' we pass in contains scale transform from the referenced frame to
   the filtered frame in *device unit*.

Inside nsFilterInstance::PaintFilteredFrame, we treat the transform matrix of
'aCtx' and 'aTransform' as parameters we pass in in #2 caller. So it can be
failed in #1. For example, if the filtered frame inside a masked frame has a
translation transform applied, since that translation was put in 'aTransfrom',
but we only use the scale factor of 'aTransform' in
nsFilterInstance::PaintFilteredFrame, translation factor disappears.

In this patch, I unified the definition of parameters of
nsFilterInstance::PaintFilteredFrame:
1. nsFilterInstance::PaintFilteredFrame(aCtx): the transform matrix of aCtx
   should be a transform from the referenced frame to the filtered frame in
   *css units*. Originally, the aCtx we passed in #1 is in device units, which
   should be fixed; the aCtx we passed in #2 does not even include css scaling
   factor, need be fixed too.
2. nsFilterInstance::PaintFilteredFrame(aTransform): this transform matrix
   should contain only scaling factor in device units. And I removed it in the
   end since I found we can get this value easily right inside the callee.

[1]
https://hg.mozilla.org/mozilla-central/file/ef585ac7c476/layout/svg/nsSVGUtils.cpp#l857

[2]
https://hg.mozilla.org/mozilla-central/file/ef585ac7c476/layout/svg/nsSVGIntegrationUtils.cpp#l1114

MozReview-Commit-ID: gRV128NyQv

--HG--
extra : rebase_source : 15d130babd07734c3c36e24e9ea8b5c4e5f7dbbf
2017-08-25 17:51:58 +08:00
..
crashtests Bug 1397363 - stylo: Update crashtest expectations; r=orange 2017-09-06 23:24:53 -07:00
tests Bug 1374282 - script generated patch to remove Task.jsm calls, r=Mossop. 2017-06-22 12:51:42 +02:00
AutoReferenceChainGuard.h Backed out changeset f574c304f748 (bug 1392235) for asserting during wpt-reftest /css/css-masking-1/clip-path-svg-content/clip-path-recursion-002.svg on Linux. r=backout 2017-09-07 18:38:57 +02:00
moz.build Bug 1393791 - Hoist nsSVGUseFrame into a header. r=emilio 2017-08-27 15:28:03 -07:00
nsCSSClipPathInstance.cpp Bug 1088760 - Remove nsRenderingContext, replacing all of its uses with gfxContext. r=jwatt,jrmuizel 2017-06-13 11:00:10 -04:00
nsCSSClipPathInstance.h Bug 1088760 - Remove nsRenderingContext, replacing all of its uses with gfxContext. r=jwatt,jrmuizel 2017-06-13 11:00:10 -04:00
nsCSSFilterInstance.cpp
nsCSSFilterInstance.h
nsFilterInstance.cpp Bug 1385239 - Part 2. Remove aTransform parameter from PaintFilteredFrame. r=mstange 2017-08-25 17:51:58 +08:00
nsFilterInstance.h Bug 1385239 - Part 2. Remove aTransform parameter from PaintFilteredFrame. r=mstange 2017-08-25 17:51:58 +08:00
nsISVGSVGFrame.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
nsSVGAFrame.cpp Bug 1396776 - Move mCanvasTM from the sub classes of nsSVGDisplayContainerFrame to nsSVGDisplayContainerFrame. r=longsonr+218550 2017-09-05 17:26:46 +08:00
nsSVGClipPathFrame.cpp Bug 1396489 - Part 3. Use gfxContext::GetClipExtents(false) when clipped rect in device space is needed. r=mstange 2017-09-04 14:04:17 +08:00
nsSVGClipPathFrame.h Bug 1388161 - Store the dirty rect on the display list builder rather than passing it as a parameter to BuildDisplayList. r=mstange 2017-08-07 14:23:35 +12:00
nsSVGContainerFrame.cpp Bug 1396776 - Move mCanvasTM from the sub classes of nsSVGDisplayContainerFrame to nsSVGDisplayContainerFrame. r=longsonr+218550 2017-09-05 17:26:46 +08:00
nsSVGContainerFrame.h Bug 1396776 - Move mCanvasTM from the sub classes of nsSVGDisplayContainerFrame to nsSVGDisplayContainerFrame. r=longsonr+218550 2017-09-05 17:26:46 +08:00
nsSVGDisplayableFrame.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
nsSVGEffects.cpp Bug 1301245 - Part 3. Resolve a style image if nsSVGPaintingProperty can not handle it. r=heycam 2017-07-26 12:02:44 +08:00
nsSVGEffects.h Bug 1301245 - Part 3. Resolve a style image if nsSVGPaintingProperty can not handle it. r=heycam 2017-07-26 12:02:44 +08:00
nsSVGFilterFrame.cpp Bug 1394156 - Make static_casts of mContent use GetContent(). r=emilio 2017-08-27 10:45:59 -07:00
nsSVGFilterFrame.h Bug 1388161 - Store the dirty rect on the display list builder rather than passing it as a parameter to BuildDisplayList. r=mstange 2017-08-07 14:23:35 +12:00
nsSVGFilterInstance.cpp
nsSVGFilterInstance.h
nsSVGFilterPaintCallback.h
nsSVGForeignObjectFrame.cpp Bug 1394156 - Make static_casts of mContent use GetContent(). r=emilio 2017-08-27 10:45:59 -07:00
nsSVGForeignObjectFrame.h Bug 1388161 - Store the dirty rect on the display list builder rather than passing it as a parameter to BuildDisplayList. r=mstange 2017-08-07 14:23:35 +12:00
nsSVGGenericContainerFrame.cpp Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
nsSVGGenericContainerFrame.h
nsSVGGFrame.cpp Bug 1396776 - Move mCanvasTM from the sub classes of nsSVGDisplayContainerFrame to nsSVGDisplayContainerFrame. r=longsonr+218550 2017-09-05 17:26:46 +08:00
nsSVGGFrame.h Bug 1396776 - Move mCanvasTM from the sub classes of nsSVGDisplayContainerFrame to nsSVGDisplayContainerFrame. r=longsonr+218550 2017-09-05 17:26:46 +08:00
nsSVGGradientFrame.cpp Bug 1394156 - Make static_casts of mContent use GetContent(). r=emilio 2017-08-27 10:45:59 -07:00
nsSVGGradientFrame.h Bug 1377169 - Turn gfxRect into a typedef. r=jrmuizel 2017-07-05 11:22:00 -04:00
nsSVGImageFrame.cpp Bug 1394156 - Make static_casts of mContent use GetContent(). r=emilio 2017-08-27 10:45:59 -07:00
nsSVGImageFrame.h
nsSVGInnerSVGFrame.cpp Bug 265894 - Part 3. Implement nsSVGViewportFrame, and let nsSVGInnerFrame inherit from it. r=heycam 2017-06-14 21:05:37 +08:00
nsSVGInnerSVGFrame.h Bug 265894 - Part 3. Implement nsSVGViewportFrame, and let nsSVGInnerFrame inherit from it. r=heycam 2017-06-14 21:05:37 +08:00
nsSVGIntegrationUtils.cpp Bug 1385239 - Part 2. Remove aTransform parameter from PaintFilteredFrame. r=mstange 2017-08-25 17:51:58 +08:00
nsSVGIntegrationUtils.h Bug 1385745 Part 1 - Add BBoxFlags::eIncludeOnlyCurrentFrameForNonSVGElement to determine whether include all continuations while computing bbox of a html frame. r=cjku,heycam 2017-08-17 09:52:17 +08:00
nsSVGMarkerFrame.cpp Bug 1394156 - Make static_casts of mContent use GetContent(). r=emilio 2017-08-27 10:45:59 -07:00
nsSVGMarkerFrame.h Bug 1388161 - Store the dirty rect on the display list builder rather than passing it as a parameter to BuildDisplayList. r=mstange 2017-08-07 14:23:35 +12:00
nsSVGMaskFrame.cpp Bug 1396489 - Part 3. Use gfxContext::GetClipExtents(false) when clipped rect in device space is needed. r=mstange 2017-09-04 14:04:17 +08:00
nsSVGMaskFrame.h Bug 1388161 - Store the dirty rect on the display list builder rather than passing it as a parameter to BuildDisplayList. r=mstange 2017-08-07 14:23:35 +12:00
nsSVGOuterSVGFrame.cpp Bug 1394156 - Make static_casts of mContent use GetContent(). r=emilio 2017-08-27 10:45:59 -07:00
nsSVGOuterSVGFrame.h Bug 1396776 - Move mCanvasTM from the sub classes of nsSVGDisplayContainerFrame to nsSVGDisplayContainerFrame. r=longsonr+218550 2017-09-05 17:26:46 +08:00
nsSVGPaintServerFrame.h Bug 1388161 - Store the dirty rect on the display list builder rather than passing it as a parameter to BuildDisplayList. r=mstange 2017-08-07 14:23:35 +12:00
nsSVGPatternFrame.cpp Bug 1394156 - Make static_casts of mContent use GetContent(). r=emilio 2017-08-27 10:45:59 -07:00
nsSVGPatternFrame.h
nsSVGStopFrame.cpp Bug 1388161 - Store the dirty rect on the display list builder rather than passing it as a parameter to BuildDisplayList. r=mstange 2017-08-07 14:23:35 +12:00
nsSVGSwitchFrame.cpp Bug 1394156 - Make static_casts of mContent use GetContent(). r=emilio 2017-08-27 10:45:59 -07:00
nsSVGSymbolFrame.cpp Bug 265894 - Part 5. Implement nsSVGSymbolFrame to layout symbol element. r=heycam 2017-06-14 21:40:59 +08:00
nsSVGSymbolFrame.h Bug 265894 - Part 5. Implement nsSVGSymbolFrame to layout symbol element. r=heycam 2017-06-14 21:40:59 +08:00
nsSVGUseFrame.cpp Bug 1394191 - Remove unneeded nsContentList.h includes from layout; r=dholbert 2017-08-29 07:29:11 -04:00
nsSVGUseFrame.h Bug 1393791 - Move SVG Use anonymous content to the frame. r=emilio 2017-08-27 15:29:32 -07:00
nsSVGUtils.cpp Bug 1385239 - Part 2. Remove aTransform parameter from PaintFilteredFrame. r=mstange 2017-08-25 17:51:58 +08:00
nsSVGUtils.h Bug 1396025 - Write a comment to explain the difference between eBBoxIncludeFill/eBBoxIncludeStroke and eBBoxIncludeFillGeometry/eBBoxIncludeStrokeGeometry. r=jwatt 2017-09-02 01:31:57 +08:00
nsSVGViewportFrame.cpp Bug 1396776 - Move mCanvasTM from the sub classes of nsSVGDisplayContainerFrame to nsSVGDisplayContainerFrame. r=longsonr+218550 2017-09-05 17:26:46 +08:00
nsSVGViewportFrame.h Bug 1396776 - Move mCanvasTM from the sub classes of nsSVGDisplayContainerFrame to nsSVGDisplayContainerFrame. r=longsonr+218550 2017-09-05 17:26:46 +08:00
svg.css Bug 265894 - Part 8. Implement -moz-use-shadow-tree-root pseudo class. r=heycam 2017-06-14 22:51:56 +08:00
SVGContextPaint.cpp Bug 1388907 - Add @mozilla.com and @testpilot- extension identifiers for SVG context-fill icons. r=jwatt 2017-08-10 01:19:14 +01:00
SVGContextPaint.h Bug 1365926, part 1 - Support 'context-fill-opacity'/'context-stroke-opacity' as SVG-as-an-image context properties. r=heycam 2017-05-18 12:47:20 +01:00
SVGFEContainerFrame.cpp Bug 1394156 - Make static_casts of mContent use GetContent(). r=emilio 2017-08-27 10:45:59 -07:00
SVGFEImageFrame.cpp Bug 1394156 - Make static_casts of mContent use GetContent(). r=emilio 2017-08-27 10:45:59 -07:00
SVGFELeafFrame.cpp Bug 1394156 - Make static_casts of mContent use GetContent(). r=emilio 2017-08-27 10:45:59 -07:00
SVGFEUnstyledLeafFrame.cpp Bug 1394156 - Make static_casts of mContent use GetContent(). r=emilio 2017-08-27 10:45:59 -07:00
SVGGeometryFrame.cpp Bug 1394156 - Make static_casts of mContent use GetContent(). r=emilio 2017-08-27 10:45:59 -07:00
SVGGeometryFrame.h Bug 1388161 - Store the dirty rect on the display list builder rather than passing it as a parameter to BuildDisplayList. r=mstange 2017-08-07 14:23:35 +12:00
SVGImageContext.cpp Bug 1374614 - Support SVG image context paint in XUL tree views (treecol etc.). r=dholbert 2017-05-26 14:24:57 +01:00
SVGImageContext.h Bug 1378044 - Switch the SVGImageContext::Hash() hashing code to use PLDHashNumber; r=dholbert 2017-07-04 11:08:28 -04:00
SVGTextFrame.cpp Bug 1396776 - Move mCanvasTM from the sub classes of nsSVGDisplayContainerFrame to nsSVGDisplayContainerFrame. r=longsonr+218550 2017-09-05 17:26:46 +08:00
SVGTextFrame.h Bug 1396776 - Move mCanvasTM from the sub classes of nsSVGDisplayContainerFrame to nsSVGDisplayContainerFrame. r=longsonr+218550 2017-09-05 17:26:46 +08:00
SVGViewFrame.cpp Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00