Bug 206662

Summary: [GTK] Reduce the maximum time we wait for draw events in DrawingMonitor
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, clopez, cmarcelo, ews-watchlist, gyuyoung.kim, luiz, noam, ryuan.choi, sergio, zeno
Priority: P2 Keywords: Gtk
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=161242
Attachments:
Description Flags
Patch clopez: review+

Description Carlos Garcia Campos 2020-01-23 07:34:55 PST
1 second is too much, we can wait up to 100_ms instead and wait for the next frame after 16_ms. We should also ensure there's a draw event since this is called from dispatchAfterEnsuringDrawing().
Comment 1 Carlos Garcia Campos 2020-01-23 07:36:46 PST
Created attachment 388541 [details]
Patch
Comment 2 Carlos Alberto Lopez Perez 2020-01-23 08:37:47 PST
Comment on attachment 388541 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=388541&action=review

r=me

> Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:413
> +    gtk_widget_queue_draw(m_webPage.viewWidget());

why this was not needed before?
Comment 3 Carlos Garcia Campos 2020-01-24 00:47:46 PST
Committed r255060: <https://trac.webkit.org/changeset/255060>
Comment 4 Carlos Garcia Campos 2020-01-24 00:48:55 PST
(In reply to Carlos Alberto Lopez Perez from comment #2)
> Comment on attachment 388541 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=388541&action=review
> 
> r=me
> 
> > Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:413
> > +    gtk_widget_queue_draw(m_webPage.viewWidget());
> 
> why this was not needed before?

In some cases, like when there's an animation or after a force repaint, there's already a draw scheduled. When there wasn't we ended up waiting 1 second. Now we ensure a draw, like expected. It doesn't hurt if there was a draw already scheduled.