Bug 725918 patch 1: Fixed code style in nsSVGGlyphFrame::SetupCairoState. r=longsonr

This commit is contained in:
Edwin Flores 2012-02-17 16:33:00 -08:00
parent 26a1e6cc16
commit 7e0c5df985
2 changed files with 12 additions and 10 deletions

View File

@ -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);
}

View File

@ -268,7 +268,8 @@ protected:
bool mTrimTrailingWhitespace;
private:
DrawMode SetupCairoState(gfxContext *context, nsRefPtr<gfxPattern> *strokePattern);
DrawMode SetupCairoState(gfxContext *aContext,
nsRefPtr<gfxPattern> *aStrokePattern);
};
#endif