cairo surface blit

View: New views
1 Messages — Rating Filter:   Alert me  

cairo surface blit

by 张玲春 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


void PaintDeviceCairo::BlitToMemory(MemoryImage& image, const ClipRect& rect)
{
    int width = cairo_image_surface_get_stride(m_surface);
    char* target = (char*)image.buffer + image.pitch * rect._y + rect._x * sizeof(UINT);
    char* pixels = (char*)cairo_image_surface_get_data(m_surface) +
        width * rect._y + rect._x * sizeof(UINT);
   
    for(int _y = 0; _y < rect._h; _y ++)
    {
        memcpy(target, pixels, sizeof(UINT) * rect._w);
        pixels += width;
        target += image.pitch;
    }
}

I'd like a cairo surface part of the draw into the memory, but I found that always show all black. Why?
Note: This memory is D3D SURFACE



09年新晋3D主流网游《天下贰》,网易六年亿资打造

_______________________________________________
cairo mailing list
cairo@...
http://lists.cairographics.org/mailman/listinfo/cairo