[webkit-dev] Re: get the bits of the complete page

zaheer ahmad zaheer.mot at gmail.com
Fri Nov 23 04:54:03 PST 2007

hi alp,
i need it to show a resized layout of the complete page that can fit
the screen. iam able to do it right now by giving an alternative
surface and render it in that.
cairo_surface_t *sur
cairo_t* cr_sur = cairo_create(sur);
GraphicsContext ctx_sur(cr_sur);
IntRect rect(clip.x, clip.y, frame->view()->contentsWidth(),
frame->paint(&ctx_sur, rect);
this seems to be performance intensive, though.


On Nov 23, 2007 1:42 PM, Alp Toker <alp at atoker.com> wrote:
> zaheer ahmad wrote:
> > hi,
> > iam working on the gtk port of webkit and have a need to get the
> > bitmap of the entire page without actually rendering it. Is there an
> > easy way to get in the current implementation.  one of the ways i
> > thought was to create a cairo surface over a memory buffer (instead of
> > the drawing window in webkit_page_expose_event) and pass it to the
> > scrollview::paint with a complete rectangle. Not sure if this is the
> > right track to solve this issue (also this could be performance/memory
> > intensive)
> There's no public API to render content to an arbitrary graphics context
> yet. There are a few examples showing how to do it in places like
> webkitgtkpage.cpp or the experimental printing patch (bug #15576)
> though, if you're willing to use internal API.
> Can you give an idea of what you need this for? It might help provide
> direction for how to expose this in the API, or it might turn out
> there's a simpler way of doing what you want.

More information about the webkit-dev mailing list