mCR = cairo_create();
nsSVGCairoCanvas::Init(nsIRenderingContext *ctx,                       nsPresContext *presContext,                       const nsRect &dirtyRect){  mPresContext = presContext;  mMozContext = ctx;  NS_ASSERTION(mMozContext, "empty rendering context");  nsDrawingSurfaceGTK *surface;  ctx->GetDrawingSurface((nsIDrawingSurface**)&surface);  surface->GetSize(&mWidth, &mHeight);  GdkDrawable *drawable = surface->GetDrawable();  mCR = cairo_create();  cairo_set_target_drawable(mCR,                            GDK_WINDOW_XDISPLAY(drawable),                            GDK_WINDOW_XWINDOW(drawable));  // get the translation set on the rendering context. It will be in  // displayunits (i.e. pixels*scale), *not* pixels:  nsTransform2D* xform;  mMozContext->GetCurrentTransform(xform);  float dx, dy;  xform->GetTranslation(&dx, &dy);  cairo_translate(mCR, dx, dy);  // clip to dirtyRect  cairo_new_path(mCR);  cairo_rectangle(mCR,                  dirtyRect.x, dirtyRect.y, dirtyRect.width, dirtyRect.height);  cairo_clip(mCR);  cairo_new_path(mCR);  mRenderMode = SVG_RENDER_MODE_NORMAL;  return NS_OK;}