mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 725918 patch 1: Fixed code style in nsSVGGlyphFrame::SetupCairoState. r=longsonr
This commit is contained in:
parent
26a1e6cc16
commit
7e0c5df985
@ -884,39 +884,40 @@ nsSVGGlyphFrame::GetBaselineOffset(float aMetricsScale)
|
||||
}
|
||||
|
||||
DrawMode
|
||||
nsSVGGlyphFrame::SetupCairoState(gfxContext *context, nsRefPtr<gfxPattern> *strokePattern) {
|
||||
nsSVGGlyphFrame::SetupCairoState(gfxContext *aContext, nsRefPtr<gfxPattern> *aStrokePattern)
|
||||
{
|
||||
DrawMode toDraw = DrawMode(0);
|
||||
const nsStyleSVG* style = GetStyleSVG();
|
||||
|
||||
if (HasStroke()) {
|
||||
gfxContextMatrixAutoSaveRestore matrixRestore(context);
|
||||
context->IdentityMatrix();
|
||||
gfxContextMatrixAutoSaveRestore matrixRestore(aContext);
|
||||
aContext->IdentityMatrix();
|
||||
|
||||
toDraw = DrawMode(toDraw | gfxFont::GLYPH_STROKE);
|
||||
|
||||
SetupCairoStrokeHitGeometry(context);
|
||||
SetupCairoStrokeHitGeometry(aContext);
|
||||
float opacity = style->mStrokeOpacity;
|
||||
nsSVGPaintServerFrame *ps = GetPaintServer(&style->mStroke,
|
||||
nsSVGEffects::StrokeProperty());
|
||||
|
||||
if (ps) {
|
||||
// Gradient or Pattern: can get pattern directly from frame
|
||||
*strokePattern = ps->GetPaintServerPattern(this, opacity);
|
||||
*aStrokePattern = ps->GetPaintServerPattern(this, opacity);
|
||||
|
||||
NS_ASSERTION(*strokePattern, "No pattern returned from paint server");
|
||||
NS_ASSERTION(*aStrokePattern, "No pattern returned from paint server");
|
||||
} else {
|
||||
nscolor color;
|
||||
nsSVGUtils::GetFallbackOrPaintColor(context, GetStyleContext(),
|
||||
nsSVGUtils::GetFallbackOrPaintColor(aContext, GetStyleContext(),
|
||||
&nsStyleSVG::mStroke, &opacity,
|
||||
&color);
|
||||
*strokePattern = new gfxPattern(gfxRGBA(NS_GET_R(color) / 255.0,
|
||||
*aStrokePattern = new gfxPattern(gfxRGBA(NS_GET_R(color) / 255.0,
|
||||
NS_GET_G(color) / 255.0,
|
||||
NS_GET_B(color) / 255.0,
|
||||
NS_GET_A(color) / 255.0 * opacity));
|
||||
}
|
||||
}
|
||||
|
||||
if (SetupCairoFill(context)) {
|
||||
if (SetupCairoFill(aContext)) {
|
||||
toDraw = DrawMode(toDraw | gfxFont::GLYPH_FILL);
|
||||
}
|
||||
|
||||
|
@ -268,7 +268,8 @@ protected:
|
||||
bool mTrimTrailingWhitespace;
|
||||
|
||||
private:
|
||||
DrawMode SetupCairoState(gfxContext *context, nsRefPtr<gfxPattern> *strokePattern);
|
||||
DrawMode SetupCairoState(gfxContext *aContext,
|
||||
nsRefPtr<gfxPattern> *aStrokePattern);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user