Bug 168911

Summary: [GTK] Flickering when leaving accelerated compositing mode
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply
Priority: P2 Keywords: Gtk
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
New patch zan: review+

Description Carlos Garcia Campos 2017-02-27 04:27:31 PST
It doesn't always happen, and it too fast, more noticeable in website with a dark background, because we are drawing a single white fame. This happens when we leave AC mode and the threaded compositor is still rendering a frame. The render layer compositor already detached the root layer, so the threaded compositor doesn't actually render any of its layer (the backing store of all the layers has been destroyed at this point). However, CoordinatedGraphicsScene::paintToCurrentGLContext() always renders a white background when no web view color has been set. And that's the white frame we get. Rendering the web view background in CoordinatedGraphicsScene::paintToCurrentGLContext() is not needed at all, because the web view already takes care of rendering its background. So, we can simply remove the  m_viewBackgroundColor member from CoordinatedGraphicsScene because nobody is actually calling setViewBackgroundColor() and we never want to draw a white background either.
Comment 1 Carlos Garcia Campos 2017-02-27 04:30:00 PST
Created attachment 302837 [details]
Patch
Comment 2 Zan Dobersek 2017-02-27 04:44:58 PST
Comment on attachment 302837 [details]
Patch

Does this cause any change in behavior when loading pages in forced accelerated mode? E.g. the inital screen not being white?
Comment 3 Carlos Garcia Campos 2017-02-27 04:51:53 PST
(In reply to comment #2)
> Comment on attachment 302837 [details]
> Patch
> 
> Does this cause any change in behavior when loading pages in forced
> accelerated mode? E.g. the inital screen not being white?

No, the web view renders the white background.
Comment 4 Carlos Garcia Campos 2017-02-27 06:24:09 PST
Created attachment 302839 [details]
New patch

This is a simpler approach suggested by Zan, thanks!
Comment 5 Carlos Garcia Campos 2017-02-27 06:40:48 PST
Committed r213060: <http://trac.webkit.org/changeset/213060>