This involves tweaking a freetype driver property
directly, since cairo font options don't cover this.
So the code is a bit ugly, but it does make text
appear darker.
Convert all the GdkRGBA colors that we have
in render nodes to linear sRGB before using
them. This brings the rendering back in line
with what cairo produces, except for the video.
We want to do compositing in a linear colorspace,
so convert textures to linear sRGB before uploading.
Currently, this causes images to come out dark, since
we don't have a way to tell the compositor that our
framebuffer is linear, so it assumes a gamma that we
don't provide.
Disables gdk_surface_set_color_profile() for backends and forces
sRGB.
This does not change any GSK renderers, it just turns off any backends
trying to hand us color profiles.
GdkColor represents a color in the real world, by combining a color
profile, an alpha valueand N component values.
gsk_render_node_draw() has been ported to use GdkColor when rendering,
which makes it so the rendering happens in a color-managed way when a
ColorProfile has been attached to the target.
Since lcms2 is using autotools, this uses the
experimental 'external project' module of meson,
and adds a minimal meson.build file to lcms2.
It seems to work.
When creating a GdkMemoryTexture, the caller provides
a memory format and a color profile, both of which
encode expectations about the color components of
the pixel data. Check that they match.
Make the formats allow converting to an lcms-compatible format and
then use a cmsTransform to convert between them.
Note that mixing RGBA and non-RGBA formats doesn't seem to work, so we
force all our RGB-only formats to convert to a RGBA format.
* Add name support to the formats
* Add profiler mark to gdk_memory_convert()
* Split up the different branches of conversion
* Use memcpy for straight copies
Converts a memory texture to a new one with a specific format and color
profile. You can even pass a rectangle to restrict the result to a given
region.
The code is well optimized, so it avoids copies if things match and will
in fact return the texture itself if the same colorspace and format and
no/the full rectangle are passed, so it can be used without fear of
performance implications.
In fact, the following code should be used - without any additional
checks - to turn any texture into a desired color profile and format
(say for saving with gdk-pixbuf):
memtex = gdk_texture_download (texture);
memtex = gdk_memory_texture_convert (memory_texture,
GDK_MEMORY_R8G8B8A8,
gdk_color_profile_get_srgb(),
NULL);
pixbuf = gdk_pixbuf_new_from_data (gdk_memory_texture_get_data (memtex),
GDK_COLOR_SPACE_RGB,
TRUE,
8
gdk_texture_get_width (memtex),
gdk_texture_get_height (memtex),
gdk_memory_texture_get_stride (memtex),
g_object_unref_wrapper,
memtex);
Also, now make gdk_memory_convert() the only conversion functions
and allow conversions between any 2 formats by going via a float[4].
This could be optimized via fast-paths, but so far it isn't.
If EGL supports:
* no-config contexts
* >8bits pixel formats
* (optionally) floating point pixel formats
Then select such a profile as the HDR format and use it when HDR is
requested.
Forces request_hdr = TRUE for all requests.
Backends should also use this when choosing whether to honor HDR
requests for low quality compositors - as long as the compositor
pretends to support HDR, shovel HDR at it.