Bug 167496

Summary: [Threaded Compositor] Stop creating the GLContext on demand the first time makeContextCurrent is called
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply
Priority: P2    
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch zan: review+

Description Carlos Garcia Campos 2017-01-27 03:51:19 PST
This is causing problems with animations when entering AC mode on demand. What happens is that the threaded compositor is created, then the animation is scheduled and during the first animation iteration the GLContext is created, making the first frame of the animation quite slow. In my computer creating the GLContext takes 0.8 seconds. If the animation duration is less than the time it takes to create the GLContext, the animation ends without iterating. This causing timeouts in the bots in tests like animations/animation-iteration-event-destroy-renderer.html that expect webkitAnimationIteration events that never fire.
Comment 1 Carlos Garcia Campos 2017-01-27 03:57:19 PST
Created attachment 299926 [details]
Patch
Comment 2 Zan Dobersek 2017-01-27 04:07:41 PST
Comment on attachment 299926 [details]
Patch

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

> Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:178
>      if (m_context)
>          return m_context->makeContextCurrent();

return m_context && m_context->makeContextCurrent();
Comment 3 Carlos Garcia Campos 2017-01-27 04:12:25 PST
Committed r211281: <http://trac.webkit.org/changeset/211281>