mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 18:08:58 +00:00
489c83b1dd
gfxRect can be implicitly constructed from IntRect, which hides a number of implicit conversion points, makes Moz2Dification harder, and has some surprising effects. This patch removes the implicit constructor and replaces it with an explicit conversion function: gfxRect ThebesRect(const IntRect&) This is the obvious outcome of removing the constructor. But there is also a second, less obvious outcome: currently we do a number of IntRect-to-Rect conversions using ToRect(), which (surprisingly) works because it turns into an implicit IntRect-to-gfxRect conversion (via the implicit constructor) combined with an explicit gfxRect-to-Rect conversion (via ToRect()). I.e. we do two conversions, going from a Moz2D type to a Thebes type and back to a Moz2D type! So this patch also changes these conversion. It moves this existing function: Rect ToRect(const IntRect&) from gfx2DGlue.h -- where it doesn't really belong because it doesn't involve any Thebes types -- to gfx/2d/Rect.h, templatifying and renaming it as IntRectToRect() in the process. The rest of the patch deals with fall-out from these changes. The call sites change as follows: - IntRect-to-gfxRect conversions: - old: implicit - new: ThebesRect() - IntRect-to-Rect conversions: - old: ToRect() - new: IntRectToRect() --HG-- extra : rebase_source : e4e4c2ad10b36ecad4d57d1630158f3374e403be |
||
---|---|---|
.. | ||
crashtests | ||
resources/content | ||
tests | ||
moz.build | ||
nsCSSFilterInstance.cpp | ||
nsCSSFilterInstance.h | ||
nsFilterInstance.cpp | ||
nsFilterInstance.h | ||
nsISVGChildFrame.h | ||
nsISVGSVGFrame.h | ||
nsSVGAFrame.cpp | ||
nsSVGClipPathFrame.cpp | ||
nsSVGClipPathFrame.h | ||
nsSVGContainerFrame.cpp | ||
nsSVGContainerFrame.h | ||
nsSVGEffects.cpp | ||
nsSVGEffects.h | ||
nsSVGFilterFrame.cpp | ||
nsSVGFilterFrame.h | ||
nsSVGFilterInstance.cpp | ||
nsSVGFilterInstance.h | ||
nsSVGFilterPaintCallback.h | ||
nsSVGForeignObjectFrame.cpp | ||
nsSVGForeignObjectFrame.h | ||
nsSVGGenericContainerFrame.cpp | ||
nsSVGGenericContainerFrame.h | ||
nsSVGGFrame.cpp | ||
nsSVGGFrame.h | ||
nsSVGGradientFrame.cpp | ||
nsSVGGradientFrame.h | ||
nsSVGImageFrame.cpp | ||
nsSVGInnerSVGFrame.cpp | ||
nsSVGInnerSVGFrame.h | ||
nsSVGIntegrationUtils.cpp | ||
nsSVGIntegrationUtils.h | ||
nsSVGMarkerFrame.cpp | ||
nsSVGMarkerFrame.h | ||
nsSVGMaskFrame.cpp | ||
nsSVGMaskFrame.h | ||
nsSVGMaskFrameNEON.cpp | ||
nsSVGMaskFrameNEON.h | ||
nsSVGOuterSVGFrame.cpp | ||
nsSVGOuterSVGFrame.h | ||
nsSVGPaintServerFrame.h | ||
nsSVGPathGeometryFrame.cpp | ||
nsSVGPathGeometryFrame.h | ||
nsSVGPatternFrame.cpp | ||
nsSVGPatternFrame.h | ||
nsSVGStopFrame.cpp | ||
nsSVGSwitchFrame.cpp | ||
nsSVGUseFrame.cpp | ||
nsSVGUtils.cpp | ||
nsSVGUtils.h | ||
svg.css | ||
SVGFEContainerFrame.cpp | ||
SVGFEImageFrame.cpp | ||
SVGFELeafFrame.cpp | ||
SVGFEUnstyledLeafFrame.cpp | ||
SVGImageContext.h | ||
SVGTextFrame.cpp | ||
SVGTextFrame.h | ||
SVGViewFrame.cpp |