Matrix *aTransMatrix =  SVGToMatrix(svgMatrix); patternMatrix->Multiply(aTransMatrix); delete aTransMatrix;
Matrix *patternMatrix =  SVGToMatrix(svgMatrix); Matrix *ctm = SVGToMatrix(aCTM);
GDIPlusGradient(nsISVGGDIPlusRegion *aRegion, nsISVGGradient *aGrad,                nsIDOMSVGMatrix *aCTM,                Graphics *aGFX,                void(*aCallback)(Graphics *, Brush*, void *), void *aData){  NS_ASSERTION(aGrad, "Called GDIPlusGradient without a gradient!");  if (!aGrad)    return;  // Get the gradientUnits  PRUint16 bbox;  aGrad->GetGradientUnits(&bbox);  Matrix *patternMatrix;  if (bbox == nsIDOMSVGGradientElement::SVG_GRUNITS_OBJECTBOUNDINGBOX) {    // BoundingBox    // We need to calculate this from the Region (Uta?) in    // the object we're filling    const RectF *rect = aRegion->GetRect();#ifdef DEBUG_tor    printf("In GDIPlusGradient: bbox (%f, %f  %f x %f)\n",           rect->X, rect->Y, rect->Width, rect->Height);#endif    patternMatrix = new Matrix(rect->Width, 0, 0, rect->Height, rect->X, rect->Y);  } else {      patternMatrix = SVGToMatrix(aCTM);  }  // Get the transform list (if there is one)  nsCOMPtr<nsIDOMSVGMatrix> svgMatrix;  aGrad->GetGradientTransform(getter_AddRefs(svgMatrix));  NS_ASSERTION(svgMatrix, "GDIPlusGradient: GetGradientTransform returns null");  Matrix *aTransMatrix =  SVGToMatrix(svgMatrix);  patternMatrix->Multiply(aTransMatrix);  delete aTransMatrix;  // Linear or Radial?  PRUint32 type;  aGrad->GetGradientType(&type);  if (type == nsISVGGradient::SVG_LINEAR_GRADIENT)    GDIPlusLinearGradient(aGrad, patternMatrix, aGFX, aCallback, aData);  else if (type == nsISVGGradient::SVG_RADIAL_GRADIENT)    GDIPlusRadialGradient(aGrad, patternMatrix, aGFX, aCallback, aData);  delete patternMatrix;}