I come across the following cairo code, I appreciate if someone can help me understand them:<br><br>1. Why pass tmpBuf.get() to cairo_image_surface_create_for_data()?<br>2. What is the purpose of cairo_set_source_surface() and later with cairo_paint_with_alpha() with the parameter mCairo?
<br>3. What does it save to the file? the data in tmpBuf? or mCairo? <br><br> // Create a temporary surface to hold the full-size image in cairo<br> // image format.<br> nsAutoArrayPtr<PRUint8> tmpBuf(new PRUint8[
aSurfaceSize.width*aSurfaceSize.height*4]);<br><br> cairo_surface_t *tmpSurf =<br> cairo_image_surface_create_for_data(tmpBuf.get(),<br> CAIRO_FORMAT_ARGB32, aSurfaceSize.width
, aSurfaceSize.height,<br> aSurfaceSize.width*4); <br><br> cairo_set_source_surface(mCairo, tmpSurf, 0, 0);<br> cairo_paint_with_alpha(mCairo, mGlobalAlpha);<br><br> cairo_surface_write_to_png(tmpSurf, "
my.png");<br><br>Thank you.<br>