[webkit-gtk] Can I get viewport image cahanges from draw event.

Miha miha.dimec at visionect.com
Wed Jul 2 00:46:38 PDT 2014


Hi

I am developing an eInk paper based application. I have the server that 
runs webkit2gtk based applications and eInk devices that are connected 
to server via WiFi. Basically server renders image changes and sends 
them to device. User can use devices touchscreen to send click events to 
server.

The thing I want to do, but I don't know if it is possible, is to get 
viewport changes from draw signal.
I want to get changed regions and image pixels from those regions 
because don't want to do full screen refreshes eInk display if it is not 
necessary.

As I understand I could do something like this, but I do not know how to 
do it exactly.
http://pastebin.com/1L8cNFfJ  (my test application)

1. Something is changed and need to be drawn.
Breakpoint 2, WebKit::PageClientImpl::setViewNeedsDisplay 
(this=0x78c670, rect=...)
     at ../Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp:77
77        gtk_widget_queue_draw_area(m_viewWidget, rect.x(), rect.y(), 
rect.width(), rect.height());

2. WebKit Ui process draws changes to WebKitWebView widget cairo context.
Breakpoint 1, webkitWebViewBaseDraw (widget=0x782490, cr=0x7d3d80)
     at ../Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:409

3. Custom "draw" signal handler is triggered in application. I get cairo 
context as parameter. Can I render changes from 1. here? Is it possible? 
How to do it?
2014-07-01T11:54:51.499118Z web_view draw 1 {X: 150.000000, Y: 
80.000000, W: 450.000000, H:225.000000} 
0x0-d41d8cd98f00b204e9800998ecf8427e
2014-07-01T11:54:51.499175Z window draw 1 {X: 150.000000, Y: 80.000000, 
W: 450.000000, H:225.000000} 0x0-d41d8cd98f00b204e9800998ecf8427e

Breakpoint 1, webkitWebViewBaseDraw (widget=0x782490, cr=0x7d3d80)
     at ../Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:409
409    {
(gdb) c
Continuing.
2014-07-01T11:54:51.899118Z web_view draw 1 {X: 150.000000, Y: 
80.000000, W: 450.000000, H:225.000000} 
0x0-d41d8cd98f00b204e9800998ecf8427e




<https://www.google.si/search?q=I+am+curious&client=ubuntu&channel=fs&tbm=isch&tbo=u&source=univ&sa=X&ei=_a2zU8uXMsKN7Qa9iYGgBg&ved=0CBsQsAQ&biw=1615&bih=898>I 
am curious , why are there two web_view draw events for each change? 
What trigers the second call to webkitWebViewBaseDraw and sends the 
second web_view "draw" signal in point 3?
I there way to avoid this? Maybe I can use window "draw" as it is 
triggered only once?

Thank you for answer.
Best

Miha




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-gtk/attachments/20140702/e88a4c80/attachment-0001.html>


More information about the webkit-gtk mailing list