diff --git a/about/architecture.md b/about/architecture.md index 9dc77cdc0..788671fb7 100644 --- a/about/architecture.md +++ b/about/architecture.md @@ -39,30 +39,35 @@ such as the traditional Cocoa, GTK, etc toolkits. ## Web page rendering -
WPE is considered a hybrid port because it defers the final web page delivery for display to a rendering backend. A traditional port would provide a widget for a given toolkit, but WPE opted for a different and more flexible approach.
- -The common interface between WPEWebKit and its rendering backends is provided by -[libwpe](https://github.com/WebPlatformForEmbedded/libwpe). On one side, once -WPEWebKit has a graphical representation of the final composited Web page ready -for rendering, it invokes a callback function on `libwpe`. On the other side, -the WPE application has to register a view backend on the WPE WebView. This view -backend is provided by the rendering backend. The view backend receives the Web -page representation from `libwpe`, usually as an EGLImage, and is in charge of -presenting it in the application, on-screen. - -The decoupling between generating the WebPage representation on WebKit side and -the actual rendering on the application side provides a very flexible design. -For instance, WPE integrators can easily develop a new rendering backend for -specific embedded platforms that might have a graphics driver with special API -requirements. - -WPE provides a rendering backend aiming to target the most common platforms and -leverage the existing graphics stack available in the -[Freedesktop](https://freedesktop.org) umbrella eco-system. -[WPEBackend-FDO](https://github.com/Igalia/WPEBackend-FDO) is the reference -implementation of the base rendering backend design. WPEBackend-FDO provides an API -for WPE applications that aims to ease the handling of rendering either -on-screen using EGL, or off-screen using SHM. +WPE integrates with the target platform through the WPEPlatform +API, which ships as part of WPE WebKit itself. Because WPE provides no user-interface +toolkit widget, this layer is what turns the rendered web page into pixels on screen +and feeds input back to the engine.
+ +Since 2.54, WPEPlatform is the default integration layer, and the only one needed +for the common targets. A `WPEDisplay` represents the connection to the underlying +windowing system or output, and manages one or more `WPEView`s, each hosted in a +`WPEToplevel` (a top-level surface such as a window or a full-screen output). The +composited web page is handed over through `WPEBuffer`, using a system GPU buffer +(e.g. `WPEBufferDMABuf`, `WPEBufferAndroid`), or shared memory (i.e. `WPEBufferSHM`) +as a fallback. + +WPE WebKit includes several built-in platform implementations: + +- **Wayland** (`WPEDisplayWayland`): renders as a client of a Wayland compositor. +- **DRM/KMS** (`WPEDisplayDRM`): renders directly through the display controller, + with no compositor, for dedicated embedded outputs. +- **Headless** (`WPEDisplayHeadless`): renders off-screen, for testing and CI. + +The implementation can be selected at runtime through the `WPE_DISPLAY` environment +variable (`wpe-display-wayland`, `wpe-display-drm`, `wpe-display-headless`), or +chosen automatically with `wpe_display_get_default()`. None of these targets +require libwpe or a separate rendering backend. + +This design keeps WPE flexible without giving up that convenience: for special +environments not covered by the built-in implementations, an integrator can provide +a custom WPEPlatform implementation by subclassing `WPEDisplay` (and the related +view and toplevel types). @@ -72,16 +77,57 @@ on-screen using EGL, or off-screen using SHM.In a traditional WebKit port, the provided widget usually also handles input (keyboard, mouse, touch) events and is in charge of relaying them to the -internal WebKit input-methods components.
+internal WebKit input handling components. + +As WPE doesn't provide a widget, input is handled by the active WPEPlatform +implementation. Each implementation gathers events from its environment (for +example, from the Wayland compositor, or directly from the input devices under +DRM/KMS) and delivers them to the target `WPEView`, which relays them to WebKit's +internal input handling components. This flexible design enables applications to + provide input events in any way that better suits them. + + + +Before 2.54, WPE integrated with the platform through libwpe and a +separate, external rendering backend. This model is legacy as of 2.54: it is kept for +existing deployments and still built as needed, but new projects should use the +WPEPlatform API described above.
+ +WPE is the official port of the WebKit Web rendering engine for Linux-based embedded platforms. WPE is uniquely designed for embedded systems in that it doesn’t depend on any user-interface toolkits such as the traditional Cocoa, GTK, etc toolkits.
+WPE is the official port of the WebKit Web rendering engine for Linux-based embedded platforms. WPE is uniquely designed for embedded systems in that it doesn’t depend on any user-interface toolkits such as the traditional Cocoa, GTK, etc toolkits. Since 2.54, its built-in WPEPlatform API provides Wayland, DRM/KMS, and headless integration out of the box.
These components are tied to the legacy API (pre-2.54) and are provided for existing deployments. They are still released as needed.
++ Stable + {{ package.latestStable.version }} +
++ Development + {{ package.latestDev.version }} +
+