Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions
nsSVGLibartRegion.cpp File Reference
#include "nsCOMPtr.h"
#include "nsISVGLibartRegion.h"
#include "nsSVGLibartRegion.h"
#include "nsISVGRectangleSink.h"
#include <math.h>

Go to the source code of this file.

Classes

class  nsSVGLibartRegion
 Libart region implementation. More...

Functions

nsresult NS_NewSVGLibartRectRegion (nsISVGRendererRegion **result, float x, float y, float width, float height)
nsresult NS_NewSVGLibartSVPRegion (nsISVGRendererRegion **result, ArtSVP *path)

Function Documentation

nsresult NS_NewSVGLibartRectRegion ( nsISVGRendererRegion **  result,
float  x,
float  y,
float  width,
float  height 
)

Definition at line 108 of file nsSVGLibartRegion.cpp.

{
  if (width<=0.0f || height<=0.0f) {
    *result = new nsSVGLibartRegion((ArtUta*)nsnull);
  }
  else {
    ArtIRect irect;
    irect.x0 = (int)x; // floor(x)
    irect.y0 = (int)y; // floor(y)
    irect.x1 = (int)ceil(x+width);
    irect.y1 = (int)ceil(y+height);
    NS_ASSERTION(irect.x0!=irect.x1 && irect.y0!=irect.y1, "empty region");
    *result = new nsSVGLibartRegion(&irect);
  }
  
  if (!*result) return NS_ERROR_OUT_OF_MEMORY;
  
  NS_ADDREF(*result);
  return NS_OK;
}

Here is the call graph for this function:

nsresult NS_NewSVGLibartSVPRegion ( nsISVGRendererRegion **  result,
ArtSVP *  path 
)

Definition at line 132 of file nsSVGLibartRegion.cpp.

{
  *result = new nsSVGLibartRegion(path);
  if (!*result) return NS_ERROR_OUT_OF_MEMORY;

  NS_ADDREF(*result);
  return NS_OK;  
}

Here is the call graph for this function: