Commit Graph

13 Commits

Author SHA1 Message Date
Benjamin Otte
73b4a62f51 snapshot: Redo debug messages
Instead of every snapshot function having debug messages, have an
explicit gtk_snapshot_push_debug() function that appends a debug node.
2018-04-24 04:06:58 +02:00
Benjamin Otte
3faa7e04db cssimage: Add GtkCssImagePaintable
This type can hold any GdkPaintable.

Use it to replace GtkCssImageSurface, which used to hold a GdkTexture.
2018-03-16 06:04:44 +01:00
Benjamin Otte
4beeb6173b cssimage: Add gtk_css_image_is_invalid()
Use that instead of hacks to guess when an image is considered invalid
according to https://drafts.csswg.org/css-images-4/#invalid-image

Also add a GtkCssImageInvalid that implements the behavior of invalid
images according to the CSS spec so thjat image implementations can
refer to that image.
2018-03-16 06:04:44 +01:00
Matthias Clasen
072f06abf7 Fix fallout from g_object_ref change
g_object_ref now returns the type of the object that was
passed. Introduce cast as necessary to avoid warnings due
to this.
2017-12-08 17:48:47 -05:00
Benjamin Otte
83fb7a649f css: Merge GtkStyleProviderPrivate into GtkStyleProvider
This is just lots of renaming.

The interface remains private, so the public API does not change, apart
from removing the definition of the Interface object to avoid
subclassing.
2017-10-31 04:33:54 +01:00
Timm Bäder
d2f027a9d9 gtkcssimagefallback: Implement equals()
The default equals() implementation in gtkcssimage.c just returns FALSE.
This avoids needless redraws, e.g. for disabled switches.
2017-10-14 17:29:48 +02:00
Benjamin Otte
6055028c96 snapshot: Rename append APIs
Instead of having gtk_snapshot_append_foo_node(), just have
gtk_snapshot_append_foo(). Nobody needs to know that this internally
uses nodes.
2017-01-13 04:46:09 +01:00
Benjamin Otte
e5e5beafa5 cssimage: Fallback images have no aspect ratio
The aspect ratio for fallback image was incorrectly set to 1.

Reftest is included.
2017-01-13 03:38:36 +01:00
Benjamin Otte
671d43b873 cssimage: Implement snapshot() in the fallback image 2016-12-20 18:01:10 +01:00
Matthias Clasen
c2ab49e963 Fix whitespace 2016-09-06 06:38:50 -04:00
Matthias Clasen
c30ee622fe css: Set meaningful fallback color
This code was passing out-of-range values into
gdk_cairo_set_source_rgb, which cannot really make
anything better.
2016-09-06 06:38:50 -04:00
Matthias Clasen
3fd9bda06f css: Fix printing of images
When there is only a call in a fallback image, we were errnoneously
printing out a comma before it.
2016-04-26 00:03:09 -04:00
Matthias Clasen
2e4b1e72f4 css: Support the image() notation
This lets us do fallback in case an image format is not
supported, and also lets us provide solid-color images.
We don't support image fragment notations.

See ttps://www.w3.org/TR/css3-images/#image-notation

https://bugzilla.gnome.org/show_bug.cgi?id=761318
2016-01-30 00:29:04 -05:00