зеркало из https://github.com/mozilla/gecko-dev.git
Bug 955917 (Part 2b) - Use nsSVGUtils::SetupContextPaint in SVGTextFrame. r=dholbert
This commit is contained in:
Родитель
c363103654
Коммит
aa3d7fd89b
|
@ -5587,7 +5587,9 @@ SVGTextFrame::SetupInheritablePaint(gfxContext* aContext,
|
|||
|
||||
if (ps && ps->SetupPaintServer(aContext, aFrame, aFillOrStroke, aOpacity)) {
|
||||
aTargetPaint.SetPaintServer(aFrame, aContext->CurrentMatrix(), ps);
|
||||
} else if (SetupContextPaint(aContext, aFrame, aFillOrStroke, aOpacity, aOuterContextPaint)) {
|
||||
} else if (nsSVGUtils::SetupContextPaint(aContext, aOuterContextPaint,
|
||||
style->*aFillOrStroke,
|
||||
aOpacity)) {
|
||||
aTargetPaint.SetContextPaint(aOuterContextPaint, (style->*aFillOrStroke).mType);
|
||||
} else {
|
||||
nscolor color = nsSVGUtils::GetFallbackOrPaintColor(aContext,
|
||||
|
@ -5603,35 +5605,3 @@ SVGTextFrame::SetupInheritablePaint(gfxContext* aContext,
|
|||
aContext->SetPattern(pattern);
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
SVGTextFrame::SetupContextPaint(gfxContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
nsStyleSVGPaint nsStyleSVG::*aFillOrStroke,
|
||||
float& aOpacity,
|
||||
gfxTextContextPaint* aOuterContextPaint)
|
||||
{
|
||||
if (!aOuterContextPaint) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const nsStyleSVG *style = aFrame->StyleSVG();
|
||||
const nsStyleSVGPaint &paint = style->*aFillOrStroke;
|
||||
|
||||
if (paint.mType != eStyleSVGPaintType_ContextFill &&
|
||||
paint.mType != eStyleSVGPaintType_ContextStroke) {
|
||||
return false;
|
||||
}
|
||||
|
||||
gfxMatrix current = aContext->CurrentMatrix();
|
||||
nsRefPtr<gfxPattern> pattern =
|
||||
paint.mType == eStyleSVGPaintType_ContextFill ?
|
||||
aOuterContextPaint->GetFillPattern(aOpacity, current) :
|
||||
aOuterContextPaint->GetStrokePattern(aOpacity, current);
|
||||
if (!pattern) {
|
||||
return false;
|
||||
}
|
||||
|
||||
aContext->SetPattern(pattern);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -614,17 +614,6 @@ private:
|
|||
gfxTextContextPaint* aOuterContextPaint,
|
||||
SVGTextContextPaint* aThisContextPaint);
|
||||
|
||||
/**
|
||||
* Sets the current pattern for |aFrame| to the fill or stroke style of the
|
||||
* outer text context. Will also set the paint opacity to transparent if the
|
||||
* paint is set to "none".
|
||||
*/
|
||||
bool SetupContextPaint(gfxContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
nsStyleSVGPaint nsStyleSVG::*aFillOrStroke,
|
||||
float& aOpacity,
|
||||
gfxTextContextPaint* aContextPaint);
|
||||
|
||||
/**
|
||||
* Stores in |aTargetPaint| information on how to reconstruct the current
|
||||
* fill or stroke pattern. Will also set the paint opacity to transparent if
|
||||
|
|
Загрузка…
Ссылка в новой задаче