color: Rework how image description objects are created, and the globals
This continues and hopefully finishes the work to change what globals are defined and how image description objects are created.
One fundamental point is that we explicitly allow and support multiple independent factories for wp_image_description_v1
objects. This works by creating those objects always with explicit interface and version number, just like the new_id
arguments for wl_registry.bind
work. It is imperative that every single factory follows this scheme, so that wp_image_description_v1
remains extensible unlike wl_buffer
. It also means one cannot create these objects with events, but that's not a loss.
The main global interface is wp_color_manager_v1
as before, which allows creating image description objects for outputs and compositor's surface preferences. Preferred surface image description is now created directly instead of referring to a wl_output
.
The creation of ICC-based and parametric image descriptions are separated into two global factories. This means that compositors can choose what they implement. Set-top-box compositors may not be interested to support ICC files, for instance.
wp_image_description_v1
gains a graceful failure event, replacing the previous events in the previous factory interfaces.
The ICC-based image description factory interface is designed to not allow delivering any additional parameters aside the ICC data. I believe that this is the right thing to do. Any additional parameters should be defined by the ICC and then they revise the ICC file specification to add those, so we don't have to invent protocol for them.
This also include general quality improvements, like ensuring all objects can be created and destroyed, protocol errors, and more.
All in all, this should make the object creation design complete.
There are even more things that this MR does not fix. This is intended as a step in the right direction, while many more steps will follow.