[webkit-gtk] [webkit-help] Fwd: webview failed to be transparent

Jianhua Shao alex.sjh at gmail.com
Wed Apr 24 18:40:50 PDT 2013


On Thu, Apr 25, 2013 at 5:32 AM, Emmanuel Rodriguez <
emmanuel.rodriguez at gmail.com> wrote:

>
>
>
> On 24 April 2013 09:32, Jianhua Shao <alex.sjh at gmail.com> wrote:
>
>>
>> I build webkitgtk 1.9.92 by below configuration
>> ./configure --prefix=/usr --enable-accelerated-compositing
>> --enable-fast-mobile-scrolling --enable-jit --disable-webkit2
>> --disable-plugin-process --disable-gtk-doc-html --with-gtk=2.0
>> --with-acceleration-backend=opengl
>>
>> After that, I write a simple app to make the content of webview
>> transparent by calling webkit_web_view_set_transparent(). But it failed.
>> I tryied version 1.11.5, it also does not work.
>> The same app source code works in a old version of gtk-webkit, AFAIK, it
>> was about gtk-webkit 1.3.
>>
>
> Can you try to build gtk-webkit 1.6.3 and see if it works?
>
> I experience a similar problem in which calling webkit_web_view_draw()
> with a custom Cairo context would behave strangely since gtk-webkit 1.8. In
> my case I wanted to save a webpage as a PDF with a Cairo context that's
> backed by a PDF surface. Since gtk-webkit 1.8 the PDF is composed of a big
> rasterized image and is no longer vectorial.
>
> From what I saw in the code base of gtk-webkit 1.8, webkit_web_view_draw()
> is now using a backing buffer to do all it's rendering and doesn't take the
> Cairo context pass in argument into account, all that it does is to copy
> the backing buffer into the Cairo context.
>
> I believe that this is why you're losing the transparency in your main
> window and why my PDFs are no longer vectorial.
>
> Maybe someone that knows more about the internals of gtk-webkit can give
> use more insight.
>

Thanks for sharing your experience.
The version 1.6.3 does not meet my requirements.
"enable-accelerated-compositing" is what I need in the newer version, from
the dev document I found it is available from version 1.7.5.
Seems I can give a try on version 1.7.x.

And have you read my another mail,

cairo_surface_t* surface = webkit_web_view_get_snapshot(view);
cairo_surface_write_to_png(surface, "/home/meego/dump.png");

will result a transparent png file...
Maybe I need to do some configuration on cario/gtk, but I am new on this
subject, anyone can give me some hint?



> --
> Emmanuel Rodriguez
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-gtk/attachments/20130425/94a038ad/attachment-0001.html>


More information about the webkit-gtk mailing list