Bug 129474 - [GTK] We should not be destroying GL resources for pages stored in the page cache
Summary: [GTK] We should not be destroying GL resources for pages stored in the page c...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2014-02-28 01:08 PST by Iago Toral
Modified: 2017-11-30 07:21 PST (History)
5 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Iago Toral 2014-02-28 01:08:24 PST
When we leave a page that required AC (and hence we created GL objects for it) to load a different URL, the page might go into the page cache but we are still destroying its context and with we might also destroy the GL objects we created with it (particularly the textures). When going back to the page, and if it was stored in the page cache, WebKit will attempt to reuse objects that assume the GL textures still exist, leading to rendering failures.

Although the problem is really there it is not actually producing any harm in X11 because we have a sharing context. Having a sharing context makes it so that the textures created are not destroyed with the LayerTreeHost's context because they are shared with the sharing context, and hence, if we go back to the page at a later time and the page was stored in the page cache, the GL textures needed for this to work will still be there. Not having a sharing context, however, does end up with black quads being rendered due to missing textures, as I found while developing Wayland support. Adding a sharing context in Wayland does indeed fix this problem as it does for X11, but I guess this is probably hiding a real problem we have.

Not sure how we should go about this or if we want to actually do anything since we are kind of assuming that we will always have a sharing context in our implementation.

I suppose any fix to this would involve not destroying the GL context (and thus, probably not invalidating/destroying the LayerTreeHost) when we know that the page will land in the page cache. I am not sure if this is something easy to do though.