f581ade9a3
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. |
||
---|---|---|
.gitlab-ci | ||
.settings | ||
data | ||
docs/reference | ||
js | ||
man | ||
meson | ||
po | ||
src | ||
subprojects | ||
test | ||
tests | ||
tools | ||
.gitignore | ||
.gitlab-ci.yml | ||
.gitmodules | ||
cldr2json.py | ||
config.h.meson | ||
COPYING | ||
gnome-shell.doap | ||
HACKING.md | ||
meson_options.txt | ||
meson.build | ||
NEWS | ||
README.md | ||
README.mdwn |
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.