Possibly silly Windows question ...

<[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
Revisiting Cairo after a very long spell in AGG world so please be gentle.
Assuming a cairo_surface_t is acquired using the following pattern:

//
cairo_surface_t* surface = cairo_image_surface_create
(CAIRO_FORMAT_ARGB32,width,height)
// get a cairo_t from the surface
cairo_t* ct = cairo_create (surface);
// initialize to clean state
// mythical drawing 
DrawStff(ct);
// clean up
cairo_destroy(ct);

can one then do this?

// flush may be required ...
// get raw pixel data as ARGB32
char* pixels = cairo_image_surface_get_data (surface);
// blit pixel data, args obviously elided
SetDIBitsToDevice(hDC,....,pixels);

If this is valid then does any available hardware acceleration still get
applied to the drawing operations? I'm slightly at a loss to see how it
would (?)

The motivations here are to try and:

Draw things as quickly as possible - i.e. only create surfaces when client
is resized
cache as many Cairo objects as possible to avoid the Create/Paint/Delete
pattern that crops up in the few extant Windows examples.
Only have to blit when painting is required (WM_PAINT received)

Many thanks.

-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.