Instead of looking at the icon size, look at the CSS value for
-gtk-icon-size. Set style classes depending on icon size instead.
Trivially change Adwaita and HighContrast to report the same values as
before.
Instead, add a function gtk_image_set_icon_size() for the cases where
overriding the icon size is necessary.
Treat icon sizes the same way as pixel sizes, too. So gtk_image_clear()
no longer unsets the icon size.
These are no longer used, instead we always covert to surface as
early as possible and drop the pixbuf.
This means we never store both the pixbuf and the surface at
for any longer time, which is wasteful. Also, its one step further
to drop GdkPixbufs from generic use in our APIs.
It's not a GtkCssGadget anymore, it doesn't have any properties or
signals either and it's not public. Further, its lifetime is very clear
the way it's being used inside GTK+.
Gadgets don't connect to style-changed for widget nodes, and
GtkImage uses its widget node for the icon helper. The visible
effect of this is that symbolic icons don't change color when
switching to the dark variant of Adwaita.
Fix this by manually invalidating the icon helper.
Make gtk_icon_helper_ensure_surface() a private function that just
ensures the surface was loaded.
Add gtk_icon_helper_load_surface() that is called by the above function
and the dnd code to actually load the surface.
We render the source into a cairo_surface_t so that we can render it
with cairo directly, rather than having to convert it from a pixbuf
every time. We also specify the target window when creating the cairo
surface so that rendering can be faster.
Using cairo surfaces also allows us to seamlessly support window scales.
We also add a GTK_IMAGE_SURFACE source type.
GtkIconHelper is a helper object to easily obtain a pixbuf from
different icon sources (e.g. a GIcon, an icon name, a stock id, ...).
Code is ported from GtkImage, which will be adapted in the next commit.