Go to file
Pekka Paalanen 008a12a637 cogl: pick glReadPixels format by target, not source
Presumably glReadPixels itself can be more performant with pixel format
conversions than doing a fix-up conversion on the CPU afterwards. Hence,
pick required_format based on the destination rather than the source, so
that it has a better chance to avoid the fix-up conversion.

With CoglOnscreen objects, CoglFramebuffer::internal_format (the source
format) is also wrong. It is left to a default value and never set to
reflect the reality. In other words, read-pixels had an arbitrary
intermediate pixel format that was used in glReadPixels and then fix-up
conversion made it work for the destination.

The render buffers (GBM surface) are allocated as DRM_FORMAT_XRGB8888.
If the destination buffer is allocated as the same format, the Cogl
read-pixels first converts with glReadPixels XRGB -> ABGR because of the
above default format, and then the fix-up conversion does ABGR -> XRGB.
This case was observed with DisplayLink outputs, where the native
renderer must use the CPU copy path to fill the "secondary GPU"
framebuffers.

This patch stops using internal_format and uses the desired destination
format instead.

_cogl_framebuffer_gl_read_pixels_into_bitmap() will still use
internal_format to determine alpha premultiplication state and multiply
or un-multiply as needed. Luckily all the formats involved in the
DisplayLink use case are always _PRE and so is the default
internal_format too, so things work in practise.

Furthermore, the GL texture_swizzle extension can never apply to
glReadPixels. Not even with FBOs, as found in this discussion:
https://gitlab.gnome.org/GNOME/mutter/issues/72
Therefore the target_format argument is hardcoded to something that can
never match anything, which will prevent the swizzle from being assumed.
2018-11-30 14:34:09 -05:00
.gitlab-ci gitlab-ci: Add test stage 2018-11-14 15:56:16 +01:00
clutter clutter: Remove erroneous "fixed point" comment 2018-11-26 15:57:41 +00:00
cogl cogl: pick glReadPixels format by target, not source 2018-11-30 14:34:09 -05:00
data Add meson build support 2018-11-06 18:51:44 +01:00
doc Add meson build support 2018-11-06 18:51:44 +01:00
po Add meson build support 2018-11-06 18:51:44 +01:00
src renderer-native: Advertise COGL_FEATURE_ID_PRESENTATION_TIME 2018-11-30 14:31:03 +00:00
tools tools: Remove obsolete ppa-magic.py 2018-11-30 11:12:12 +08:00
.gitignore Add meson build support 2018-11-06 18:51:44 +01:00
.gitlab-ci.yml gitlab-ci.yml: Increase test timeout multiplier further 2018-11-22 18:20:58 +01:00
autogen.sh Fix bashism in autogen.sh 2017-05-11 13:45:44 +02:00
config.h.meson Add meson build support 2018-11-06 18:51:44 +01:00
configure.ac meta/plugin: Use G_DECLARE_DERIVABLE_TYPE 2018-11-23 14:28:37 +00:00
COPYING Updated obsolete FSF postal address in COPYING 2014-01-12 08:44:30 +07:00
Makefile.am autotools: Make install directories paths more consistent 2018-11-06 17:17:36 +01:00
meson_options.txt Add meson build support 2018-11-06 18:51:44 +01:00
meson.build meta/plugin: Use G_DECLARE_DERIVABLE_TYPE 2018-11-23 14:28:37 +00:00
mutter.doap doap: add <programming-language> 2014-07-31 17:50:28 +02:00
NEWS Bump version to 3.31.2 2018-11-14 02:01:25 +01:00
README.md README: Mention usage by Gala 2018-11-08 17:11:27 +01:00

Mutter

Mutter is a Wayland display server and X11 window manager and compositor library.

When used as a Wayland display server, it runs on top of KMS and libinput. It implements the compositor side of the Wayland core protocol as well as various protocol extensions. It also has functionality related to running X11 applications using Xwayland.

When used on top of Xorg it acts as a X11 window manager and compositing manager.

It contains functionality related to, among other things, window management, window compositing, focus tracking, workspace management, keybindings and monitor configuration.

Internally it uses a fork of Cogl, a hardware acceleration abstraction library used to simplify usage of OpenGL pipelines, as well as a fork af Clutter, a scene graph and user interface toolkit.

Mutter is used by, for example, GNOME Shell, the GNOME core user interface, and by Gala, elementary OS's window manager. It can also be run standalone, using the command "mutter", but just running plain mutter is only intended for debugging purposes.

License

Mutter is distributed under the terms of the GNU General Public License, version 2 or later. See the COPYING file for detalis.