Bug 167416 - [GTK] Improve PageOverlay usage when not in AC mode
Summary: [GTK] Improve PageOverlay usage when not in AC mode
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Miguel Gomez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-25 05:45 PST by Miguel Gomez
Modified: 2017-01-25 05:45 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Miguel Gomez 2017-01-25 05:45:24 PST
There are some components, like the WebInspector that use PageOverlayController to put PageOverlays over the rendered content (in GTK only the WebInspector uses them for highlighting). These overlays are GraphicsLayers that are added to the compositing tree and composited on top of the normal content.

This causes problems when accelerated compositing is not available:
- if there's no compositing those overlays are not going to be visible
- trying to use the GraphicsLayerFactory while not in AC actually triggers AC mode, which mustn't happen if it's not available

This was handled in bug 165237, and fixed in WebInpsectorClient by not using overlays at all when AC is disabled. While this works (because WebInspector is the only overlay user), it would be much better if, instead of modifying the overlay users, we fixed it for all the possible users in a centralized way.

One way that comes to my mind would be:
- in AcceleratedDrawingArea::graphicsLayerFactory(), if there's no layerTreeHost, check that AC is available before entering AC. This allows to create GraphicsLayers without entering AC, so overlays would be able to create layers.
- the GraphicsLayers created after the previous change are CoordinatedGraphicsLayers, which require a coordinator to properly work, and they don't have because we are not in AC mode. To avoid crashing because of this we need to use some kind of dummy GraphicsLayers or to modify CoordinatedGraphicsLayers to be able to work without a coordinator.
- after these changes, the overlays would be able to create GraphicsLayer as they wish, but they would just never be used at all if AC was not available.

I'm leaving this bug open and assigned to myself as a reminder of this taks, so I can retake it when there are no urgent issues.