EFL on Wayland Rafael Antognolli October, 22th - 2013
Wayland • Simpler replacement for X • Core protocol + extensions • Weston is the reference compositor • Toolkits (EFL, Qt, GTK) implement the client API
EFL – Enlightenment Foundation Libraries • Base libraries of Enlightenment 0.17 (soon 0.18) • Yet another toolkit library, just like Qt and GTK • Split among several libraries/modules: • Evas • Ecore • Elementary • Edje, Eina, Emotion...
What's a Wayland Backend? • In other words, why we need a Wayland backend? We need it to: • Create Wayland windows • Draw widgets into those windows • Expose Wayland-specific APIs • In summary: it allows us to run EFL applications on Wayland
EFL – Wayland Architecture
Work against a moving target • Wayland started in 2008 • Became freedesktop.org project in October, 2010 • EFL backend started in 2011 • Initial SHM backend in December, 14 th 2011 • First Wayland release (0.85) in February, 2012 • Wayland 1.0 released in October, 2012
Frame sync • Frame callback from Wayland • Avoid unnecessary repaints • Avoid blocking the mainloop • Avoid tearing, sync with display update • Implemented in SHM backend first, EGL backend a few months later
SHM triple-buffering • Wayland_SHM engine rewrite • Buffer management moved to Evas engine • Better organization: swapper, buffer and engine
Client-side decorations: introduction • Client renders title bar, buttons and borders • Content must be shifted • Decorations and content cannot overlap
Client-side decorations: first solution • Objects moved by an offset • Master clipper for client area • Window decorations added 0
Client-side decorations: Elementary layouts • Several bugs related to CSD • Fix one case, breaks another one • Elementary will handle all of that for us 1
Client-side decorations: Elementary layouts • Several bugs related to CSD • Fix one case, breaks another one • Elementary will handle all of that for us • Breaks non-elementary apps 2
Client-side decorations: crazy proposal • Using an Ecore_Evas inside another Ecore_Evas • Would fix non-elementary apps • Fix all the problems in the world 3
Client-side decorations: render offset and no clipper • New proposal: put offsets down in the render tree • Affects every Evas object • Needs changes to input coordinates • Needs changes to window decorations 4
Client-side decorations: render offset and no clipper • New proposal: put offsets down in the render tree • Affects every Evas object • Needs changes to input coordinates • Needs changes to window decorations • Ended up bringing back the clipper 5
Multi-touch • Code was there already, not tested • Bugs were found after testing • Needed hardware • Developed with ssh + borrowed laptop 6
Input Methods • Openismus added Input Method support on Wayland • Submitted patches for EFL and IBus too • Eduardo (Etrunko) polished and integrated them 7
Window/Surface Rotation • Simply were not implemented • Copy & paste code from X11 backends • Not using buffer transforms yet 8
Surfaces • Just like “windows” in X11 • Rectangular area, with position, size and pixel contents • Managed by the compositor • Support different types of rendering: • Rendered in a SHM buffer • Directly with EGL 9
Subsurfaces • Always placed relatively to the main surface • Can be updated in sync with the main surface • Uses: • Faster video decoding • Offload compositing work from clients to compositor • Allows to pass buffer (YUV) processing to dedicated overlay hardware • Popups • Surface is not limited to the main surface area 0
Subsurfaces – main features • Sharing API with X11 backends • Video_Surface API • Auto-detection/usage of subsurfaces • API exposed – highly customizable use 1
Subsurfaces - autodetection • For a specific image object, use subsurfaces “when possible” • Some checks are done on the image: • The image is not being clipped • The image is not being scaled • The image remains inside the main surface area • Other conditions might be specified or relaxed later • If conditions are not met, use a pixel buffer as fallback • Seamless transition to/from subsurface 2
Drag'n Drop and Copy'n Paste • CnP fully functional • DnD functional inside the same window • Still needs a common API for Wayland and X 3
Future Plans • Need more common APIs: • DnD, CnP, window handling • More subsurface features as they become available • A common “surface layer” that abstracts the underlying backend • Video backends of Emotion (video library) must use subsurfaces 4
Questions? • Contact: • IRC: #wayland-efl @ freenode • https://lists.sourceforge.net/lists/listinfo/enlightenment-devel • http://www.enlightenment.org/ • rafael.antognolli@intel.com 5
Recommend
More recommend