Back to index

lightning-sunbird  0.9+nobinonly
Functions
nsSVGGDIPlusGradient.h File Reference
#include "nsISVGGradient.h"
#include "nsISVGGDIPlusRegion.h"
#include "nsISVGGeometrySource.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void GDIPlusGradient (nsISVGGDIPlusRegion *aRegion, nsISVGGradient *aGrad, nsIDOMSVGMatrix *aCTM, Graphics *aGFX, nsISVGGeometrySource *aSource, void(*aCallback)(Graphics *, Brush *, void *), void *aData)

Function Documentation

void GDIPlusGradient ( nsISVGGDIPlusRegion aRegion,
nsISVGGradient aGrad,
nsIDOMSVGMatrix aCTM,
Graphics *  aGFX,
nsISVGGeometrySource aSource,
void(*)(Graphics *, Brush *, void *)  aCallback,
void aData 
)

Definition at line 313 of file nsSVGGDIPlusGradient.cpp.

{
  NS_ASSERTION(aGrad, "Called GDIPlusGradient without a gradient!");
  if (!aGrad)
    return;

  // Get the gradientUnits
  PRUint16 bbox;
  aGrad->GetGradientUnits(&bbox);

  // Get the transform list (if there is one)
  nsCOMPtr<nsIDOMSVGMatrix> svgMatrix;
  aGrad->GetGradientTransform(getter_AddRefs(svgMatrix), aSource);
  NS_ASSERTION(svgMatrix, "GDIPlusGradient: GetGradientTransform returns null");

  // GDI+ gradients don't like having a zero on the diagonal (zero
  // width or height in the bounding box)
  float val;
  svgMatrix->GetA(&val);
  if (val == 0.0)
    svgMatrix->SetA(1.0);
  svgMatrix->GetD(&val);
  if (val == 0.0)
    svgMatrix->SetD(1.0);

  Matrix *patternMatrix =  SVGToMatrix(svgMatrix);
  Matrix *ctm = SVGToMatrix(aCTM);

  // Linear or Radial?
  PRUint32 type;
  aGrad->GetGradientType(&type);
  if (type == nsISVGGradient::SVG_LINEAR_GRADIENT)
    GDIPlusLinearGradient(aGrad, patternMatrix, aGFX, ctm, aCallback, aData);
  else if (type == nsISVGGradient::SVG_RADIAL_GRADIENT)
    GDIPlusRadialGradient(aGrad, patternMatrix, aGFX, ctm, aCallback, aData);

  delete patternMatrix;
  delete ctm;
}

Here is the call graph for this function:

Here is the caller graph for this function: