GetGlobalTransform(ctx, nsnull);
if (NS_FAILED(GetGlobalTransform(ctx, nsnull))) { cairo_destroy(ctx); delete [] cp; return NS_ERROR_FAILURE; }
nsSVGCairoGlyphGeometry::GetBoundingBox(nsIDOMSVGRect * *aBoundingBox){  *aBoundingBox = nsnull;  nsCOMPtr<nsIDOMSVGRect> rect = do_CreateInstance(NS_SVGRECT_CONTRACTID);  NS_ASSERTION(rect, "could not create rect");  if (!rect) return NS_ERROR_FAILURE;  nsAutoString text;  mSource->GetCharacterData(text);  if (!text.Length())    return NS_OK;  nsSVGCharacterPosition *cp;  mSource->GetCharacterPosition(&cp);  if (NS_FAILED(mSource->GetCharacterPosition(&cp)))    return NS_ERROR_FAILURE;  double xmin, ymin, xmax, ymax;  cairo_t *ctx = cairo_create(gSVGCairoDummySurface);  GetGlobalTransform(ctx, nsnull);  /* get the metrics */  nsCOMPtr<nsISVGCairoGlyphMetrics> metrics;  {    nsCOMPtr<nsISVGRendererGlyphMetrics> xpmetrics;    mSource->GetMetrics(getter_AddRefs(xpmetrics));    metrics = do_QueryInterface(xpmetrics);    NS_ASSERTION(metrics, "wrong metrics object!");    if (!metrics)      return NS_ERROR_FAILURE;  }  metrics->SelectFont(ctx);  float x,y;  mSource->GetX(&x);  mSource->GetY(&y);  cairo_move_to(ctx, x, y);  LOOP_CHARS(cairo_text_path)  delete [] cp;  cairo_fill_extents(ctx, &xmin, &ymin, &xmax, &ymax);  cairo_user_to_device(ctx, &xmin, &ymin);  cairo_user_to_device(ctx, &xmax, &ymax);  cairo_destroy(ctx);  rect->SetX(xmin);  rect->SetY(ymin);  rect->SetWidth(xmax - xmin);  rect->SetHeight(ymax - ymin);  *aBoundingBox = rect;  NS_ADDREF(*aBoundingBox);    return NS_OK;}