Ray Strode f581ade9a3 texture-cache: preserve aspect ratio of loaded pixbufs
st_texture_cache_load_file_async takes optional width and height hints
to specify how much space on-screen the loaded image will take up. One
or both of the width and height can be negative.

gdk-pixbuf uses this information to scale down the image to an
appropriate size, when necessary, to save memory and prevent
aliasing.

gdk-pixbuf never uses this information to scale up the image, though;
that would just waste memory. Instead, the width and height hints are
used to set the geometry of the clutter content, so the texture may
get upscaled on-screen.

If both the passed in width and height are negative, it means to assume
the image will fit at native size, and gdk-pixbuf shouldn't downscale
the image.

If just one dimension is negative, it means the image should be
downscaled by gdk-pixbuf proportionally to fit the given (positive)
dimension.

If neither dimension is negative, it means the image should be
downscaled by gdk-pixbuf proportionally to fit whichever dimension keeps
the whole image within the bounds of its clutter content.

In any case, if the passed in width and height are bigger than the
dimensions of the loaded image, then those passed in values won't be used
by gdk-pixbuf, since it has no downscaling to do.

The problem is, the code that converts a pixbuf to a clutter content
fails to handle the case where the passed in dimensions aren't used by
gdk-pixbuf.  It assumes at least one of the pixbuf dimensions matches the
dimensions passed to st_texture_cache_load_file_async.  That won't be the
case if the pixbuf code had no downscaling to do.

This commit fixes that problem by deriving the unknown clutter content
dimension from the known clutter content dimension and the aspect ratio
of the image.
2019-04-30 14:58:26 -04:00
2019-04-26 21:32:51 +02:00
2019-04-17 21:25:34 +00:00
2018-01-07 21:39:18 +01:00
2019-04-26 14:11:05 +00:00
2019-03-04 20:55:15 +00:00
2019-01-09 23:09:18 +00:00
2019-03-04 20:55:15 +00:00
2014-01-08 04:35:14 +07:00
2018-12-31 13:25:05 -06:00
2019-04-17 21:08:32 +02:00
2019-02-13 20:37:39 +01:00
2019-03-04 20:55:15 +00:00

GNOME Shell

GNOME Shell provides core user interface functions for the GNOME 3 desktop, like switching to windows and launching applications. GNOME Shell takes advantage of the capabilities of modern graphics hardware and introduces innovative user interface concepts to provide a visually attractive and easy to use experience.

For more information about GNOME Shell, including instructions on how to build GNOME Shell from source and how to get involved with the project, see the project wiki.

Bugs should be reported to the GNOME bug tracking system.

Contributing

To contribute, open merge requests at https://gitlab.gnome.org/GNOME/gnome-shell.

Commit messages should follow the GNOME commit message guidelines. We require an URL to either an issue or a merge request in each commit.

License

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

Description
Languages
C 49.2%
JavaScript 47.4%
SCSS 1.4%
Meson 0.8%
Python 0.6%
Other 0.4%