Bug 1492432. Remove PaintingPropertyDescriptor parameter from SVGObserverUtils::GetPaintServer. r=longsonr

Differential Revision: https://phabricator.services.mozilla.com/D6250

--HG--
extra : rebase_source : 3f9c4a0252ba62db90c908f4021072a22097ec55
This commit is contained in:
Jonathan Watt 2018-08-15 11:54:27 +01:00
Родитель 5015db160d
Коммит f8e64cb389
4 изменённых файлов: 17 добавлений и 22 удалений

Просмотреть файл

@ -90,8 +90,6 @@ SVGContextPaint::IsAllowedForImageFromURI(nsIURI* aURI)
* @param aOuterContextPaint pattern information from the outer text context
* @param aTargetPaint where to store the current pattern information
* @param aFillOrStroke member pointer to the paint we are setting up
* @param aProperty the frame property descriptor of the fill or stroke paint
* server frame
*/
static void
SetupInheritablePaint(const DrawTarget* aDrawTarget,
@ -101,12 +99,11 @@ SetupInheritablePaint(const DrawTarget* aDrawTarget,
SVGContextPaint* aOuterContextPaint,
SVGContextPaintImpl::Paint& aTargetPaint,
nsStyleSVGPaint nsStyleSVG::*aFillOrStroke,
SVGObserverUtils::PaintingPropertyDescriptor aProperty,
imgDrawingParams& aImgParams)
{
const nsStyleSVG *style = aFrame->StyleSVG();
nsSVGPaintServerFrame *ps =
SVGObserverUtils::GetPaintServer(aFrame, aFillOrStroke, aProperty);
SVGObserverUtils::GetPaintServer(aFrame, aFillOrStroke);
if (ps) {
RefPtr<gfxPattern> pattern =
@ -167,7 +164,7 @@ SVGContextPaintImpl::Init(const DrawTarget* aDrawTarget,
SetupInheritablePaint(aDrawTarget, aContextMatrix, aFrame, opacity,
aOuterContextPaint, mFillPaint, &nsStyleSVG::mFill,
SVGObserverUtils::FillProperty(), aImgParams);
aImgParams);
SetFillOpacity(opacity);
@ -184,9 +181,7 @@ SVGContextPaintImpl::Init(const DrawTarget* aDrawTarget,
SetupInheritablePaint(aDrawTarget, aContextMatrix, aFrame, opacity,
aOuterContextPaint, mStrokePaint,
&nsStyleSVG::mStroke,
SVGObserverUtils::StrokeProperty(),
aImgParams);
&nsStyleSVG::mStroke, aImgParams);
SetStrokeOpacity(opacity);

Просмотреть файл

@ -646,8 +646,7 @@ SVGObserverUtils::GetEffectProperties(nsIFrame* aFrame)
nsSVGPaintServerFrame *
SVGObserverUtils::GetPaintServer(nsIFrame* aTargetFrame,
nsStyleSVGPaint nsStyleSVG::* aPaint,
PaintingPropertyDescriptor aType)
nsStyleSVGPaint nsStyleSVG::* aPaint)
{
// If we're looking at a frame within SVG text, then we need to look up
// to find the right frame to get the painting property off. We should at
@ -668,8 +667,12 @@ SVGObserverUtils::GetPaintServer(nsIFrame* aTargetFrame,
RefPtr<URLAndReferrerInfo> paintServerURL =
SVGObserverUtils::GetPaintURI(frame, aPaint);
MOZ_ASSERT(aPaint == &nsStyleSVG::mFill || aPaint == &nsStyleSVG::mStroke);
PaintingPropertyDescriptor propDesc = (aPaint == &nsStyleSVG::mFill) ?
SVGObserverUtils::FillProperty() :
SVGObserverUtils::StrokeProperty();
nsSVGPaintingProperty *property =
SVGObserverUtils::GetPaintingProperty(paintServerURL, frame, aType);
SVGObserverUtils::GetPaintingProperty(paintServerURL, frame, propDesc);
if (!property)
return nullptr;
nsIFrame* result = property->GetReferencedFrame();

Просмотреть файл

@ -534,13 +534,6 @@ public:
NS_DECLARE_FRAME_PROPERTY_DELETABLE(BackgroundImageProperty,
URIObserverHashtable)
/**
* Get the paint server for a aTargetFrame.
*/
static nsSVGPaintServerFrame *GetPaintServer(nsIFrame* aTargetFrame,
nsStyleSVGPaint nsStyleSVG::* aPaint,
PaintingPropertyDescriptor aProperty);
struct EffectProperties {
SVGFilterObserverListForCSSProp* mFilterObservers;
SVGMaskObserverList* mMaskObservers;
@ -684,6 +677,12 @@ public:
static void InvalidateDirectRenderingObservers(Element* aElement, uint32_t aFlags = 0);
static void InvalidateDirectRenderingObservers(nsIFrame* aFrame, uint32_t aFlags = 0);
/**
* Get the paint server for a aTargetFrame.
*/
static nsSVGPaintServerFrame *GetPaintServer(nsIFrame* aTargetFrame,
nsStyleSVGPaint nsStyleSVG::* aPaint);
/**
* Get an SVGMarkerObserver for the frame, creating a fresh one if necessary
*/

Просмотреть файл

@ -1500,8 +1500,7 @@ nsSVGUtils::MakeFillPatternFor(nsIFrame* aFrame,
const DrawTarget* dt = aContext->GetDrawTarget();
nsSVGPaintServerFrame *ps =
SVGObserverUtils::GetPaintServer(aFrame, &nsStyleSVG::mFill,
SVGObserverUtils::FillProperty());
SVGObserverUtils::GetPaintServer(aFrame, &nsStyleSVG::mFill);
if (ps) {
RefPtr<gfxPattern> pattern =
@ -1576,8 +1575,7 @@ nsSVGUtils::MakeStrokePatternFor(nsIFrame* aFrame,
const DrawTarget* dt = aContext->GetDrawTarget();
nsSVGPaintServerFrame *ps =
SVGObserverUtils::GetPaintServer(aFrame, &nsStyleSVG::mStroke,
SVGObserverUtils::StrokeProperty());
SVGObserverUtils::GetPaintServer(aFrame, &nsStyleSVG::mStroke);
if (ps) {
RefPtr<gfxPattern> pattern =