summaryrefslogtreecommitdiff
path: root/gsk/gskrendernodeimpl.c
Commit message (Collapse)AuthorAgeFilesLines
* rendernode: clip when drawing shadowsBenjamin Otte2023-05-161-0/+6
| | | | Ensures the shadow stays small.
* rendernode: Implement texture diffing for scale nodesBenjamin Otte2023-05-021-4/+20
|
* texture: Add gdk_texture_diff()Benjamin Otte2023-05-011-3/+19
| | | | | | | | | | | ... and use it in rendernodes. Setting up textures for diffing is done via gdk_texture_set_diff() which should only be used during texture construction. Note that the pointers to next/previous are allowed to dangle if one of the textures is finalized, but that's fine because we always check both textures' links to each other before we consider the pointer valid.
* rendernode: Add diffing for affine transformsBenjamin Otte2023-04-291-1/+32
| | | | | This will be needed most importantly for inverted textures, like in GLArea.
* gsk: Don't misuse bitwise operatorsMatthias Clasen2023-04-251-1/+1
| | | | We should use && for booleans, not &=.
* gsk: Don't misuse bitwise operatorsMatthias Clasen2023-04-251-4/+4
| | | | We should use || for booleans, not |=.
* rendernode: CosmeticsBenjamin Otte2023-04-031-189/+136
| | | | Simplify a function.
* rendernode: Get rid of GskRenderNodeTypeInfoBenjamin Otte2023-04-031-297/+429
| | | | Instead, use class_init functions.
* rendernode: Remove instance_init() functionBenjamin Otte2023-04-031-27/+0
| | | | It's not used.
* docs: Details about texture scale nodesMatthias Clasen2023-03-131-1/+9
| | | | | Add some more details about filtering, to clarify things a bit.
* rendernode: Register PNG serializerBenjamin Otte2023-03-111-0/+37
| | | | | This allows dropping or copy/pasting rendernodes into apps that accept images.
* rendernode: Register SVG serializerBenjamin Otte2023-03-101-13/+84
| | | | | | | | This allows dropping or copy/pasting rendernodes into apps that accept SVGs. Not sure how useful this is because we advertise text/plain from rendernodes already and we prefer that.
* rendernode: Respect clip when drawing scale nodesBenjamin Otte2023-03-031-2/+11
| | | | | | | | Scale nodes can use large scale factors and we don't want to create insanely huge Cairo surfaces. A subsequent commit will add the texture-scale-magnify-10000x test which fails without this fix.
* rendernode: Clarify some Cairo stuffBenjamin Otte2023-03-031-6/+16
| | | | Split out a function to make it more obvious what's going on.
* rendernode: Don't do unnecessary stuffBenjamin Otte2023-03-031-3/+0
| | | | | | | | | Cairo surfaces are created transparent. And even if they weren't, overdrawing with transparency wouldn't erase what's in the surface because it's a no-op. It would require CAIRO_OPERATOR_CLEAR or CAIRO_OPERATOR_SOURCE.
* Fix self-`(type)` annotations for `TextureScaleNode` methodsSebastian Dröge2023-02-191-2/+2
|
* Add two missing `Since` markersSebastian Dröge2023-02-191-0/+2
|
* Make make not fallback match GLMatthias Clasen2023-02-141-5/+9
| | | | | | We were not handling the inverted-luminance case the same way, and it caused a test to fail. Yay for tests.
* Make mask nodes more versatileMatthias Clasen2023-02-141-29/+108
| | | | | Add a GskMaskMode enumeration and implement it in the GL and cairo renderers.
* gsk: Introduce mask nodesMatthias Clasen2023-02-121-0/+146
| | | | | | | | | Add GskMaskNode, and support it in the render node parser, in the inspector and in GtkSnapshot. The rendering is just fallback for now. Based on old work by Timm Bäder.
* gsk: Introduce GskTextureScaleNodeMatthias Clasen2023-02-111-0/+202
|
* gskrendernodeimpl.c: Use foldingMatthias Clasen2023-02-111-23/+49
| | | | Instead of homegrown markup.
* gsk: Extend the blur radius for outset shadow extentsCarlos Garnacho2022-11-231-1/+1
| | | | | | | | | | | | | | | | | By dividing the blur radius to obtain the clip radius, we may end up with halved values that result in an overshunk clip mask. Extend this so that we ensure to cover the last pixel. Fixes artifacts seen with the cairo renderer in X11 when resizing windows horizontally, a black 1px high line would be seen in the top of the window due to these outset bounds being used in clipping. More mysteriously, also seems to fix resize lag in the GL renderer (also X11), if e.g. the bottom-right corner of a window is resized diagonally in bottom-left -> top-right direction, or bottom-right -> top-left. Related: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2175#note_1599335
* gsk: Also ceil() top side when converting graphene to cairo rectanglesCarlos Garnacho2022-11-231-1/+1
| | | | | | The outset border for all sides is ceil()ed, except for the top side. Most often values are already nicely rounded here, but this seems an oversight.
* gsk: Add an assertion to help static analysisMatthias Clasen2022-11-181-0/+2
| | | | clang gets wild ideas about negative radii otherwise.
* Fix spelling errorsMatthias Clasen2022-11-171-5/+5
| | | | These were pointed out by codespell.
* Rename gdk-private.h to gdkprivate.hMatthias Clasen2022-09-231-1/+1
| | | | The extra - does not add any value.
* gsk: Use the new debug macrosMatthias Clasen2022-09-231-4/+4
|
* Mark gsk_rounded_clip_node_new() return value as (transfer full)Sebastian Dröge2022-08-101-1/+1
| | | | | Like all the other constructors for nodes already do. Without this, newly created rounded clip nodes are leaked in bindings.
* gsk: Collect opacity informationMatthias Clasen2022-04-051-0/+26
| | | | | | Collect information about whether to use offscreens for opacity during node construction, so we don't need to walk the tree repeatedly, later.
* gsk: Track disjointness of container nodesMatthias Clasen2022-04-051-0/+21
| | | | | This can be used to optimize some things in the GL renderer.
* Fix up preconditions of gsk_gl_shader_node_newMatthias Clasen2022-03-031-6/+6
| | | | | | | These were not quite right, and implied that args may be NULL, when it really can't. Fixes: #4739
* rendernode: Limit diff regionBenjamin Otte2021-12-201-0/+10
| | | | | | | | | | | | | Limit the diff region to 30 rectangles (randomly chosen because it looked big enough to not trigger by accident and small enough to not cause performance issues). If the diff region gets more complicated, we abort to the parent node and use its bounds as the diff region instead and then continue diffing the rest of the node tree. Fixes: #4560 Fixes: #2396
* gsk: Allow diffing code to abortBenjamin Otte2021-12-201-13/+12
| | | | | Now the vfuncs can decide they don't want to diff anymore, not just the actual diff function.
* rendernode: Simplify conic gradient codeBenjamin Otte2021-11-301-12/+8
|
* g-i: add missing since annotationsBilal Elmoussaoui2021-11-131-0/+2
|
* Ensure blur nodes have a positive blur radiusTimm Bäder2021-10-171-1/+2
|
* gsk: Add high depth rendernode apiMatthias Clasen2021-10-061-1/+31
| | | | | | | | | | | | | | Add private api to find out if the content of a render node should be considered 'deep'. The information is collected at creation time, so there is no tree-walking involved when we are using this information in the renderer. Currently, this comes down to whether there are any texture nodes with high depth textures in the subtree. In the future, we may want to allow marking gradient nodes in this way as well.
* Revert "gsk: Stop enlarging text bounding boxes"Matthias Clasen2021-09-171-4/+4
| | | | | | | | | This reverts commit 87af45403ace1047b91ddbab98d9d5a5e15b84eb. I've found that this change is needed to ensure that the bounding boxes of text nodes encompass all the glyphd drawing. Without it, we overdraw the widget boundaries and cut off glyphs.
* gsk: Stop enlarging text bounding boxesMatthias Clasen2021-09-171-4/+4
| | | | | This should not be necessary and only serves to make the actual bugs harder to find.
* rendernode: Write the whole nodeBenjamin Otte2021-09-111-8/+12
| | | | | It turns out g_output_stream_write_bytes() does not write the bytes. It should be renamed to g_output_stream_write_some_of_the_bytes() maybe.
* Avoid hand-rolled color glyph informationMatthias Clasen2021-09-051-10/+1
| | | | | | Followup to b244f31337eea. Pango provides color glyph information for us now, so we don't need to steal a bit anymore.
* Revert "gsk: Add font options to text nodes"Matthias Clasen2021-09-041-139/+20
| | | | This reverts commit f1347f5841ea526c7016a8fbd329b45001812a23.
* gsk: Add font options to text nodesMatthias Clasen2021-09-031-20/+139
| | | | | | | | | Since font options affect how the glyphs get rendered, we need to pass the font options down from the gtk level to where the glyph cache is populated. Add a new gsk_text_node_new_full api that takes a cairo_font_options_t in addition to the other parameters.
* Use color glyph information from Pangocolor-glyph-infoMatthias Clasen2021-09-011-49/+2
| | | | | | Pango now sets a bit in PangoGlyphVisAttr for color glyphs, so we don't need to do that ourselves anymore.
* rendernode: Add (de)serialization support for render nodesBenjamin Otte2021-08-301-0/+111
| | | | This includes our own new mime type for render nodes, too.
* Merge branch 'wip/exalm/shadow-extents' into 'master'Matthias Clasen2021-08-051-5/+5
|\ | | | | | | | | Shrink shadow extents See merge request GNOME/gtk!3825
| * Shrink shadow extentsAlexander Mikhaylenko2021-08-041-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Long time ago, Cairo shadows in both GTK3 and 4 were drawn at a size about twice their radius. Eventually this was fixed but the shadow extents are still calculated for the previous size and appear unreasonably large: for example, 141px for a 50px radius shadow. This can get very noticeable in places such as invisible window frame which gets included into screenshots. https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3419 just divides the radius by 2 when drawing a shadow with Cairo, do the same when calculating extents. See https://gitlab.gnome.org/GNOME/gtk/-/issues/3841
* | gsk: Use harfbuzz for color fontsMatthias Clasen2021-07-311-105/+45
| | | | | | | | | | | | | | harfbuzz has all the information we need, so we can avoid poking directly at freetype apis. Also drop the caching of color glyph information until it turns out to be a problem.
* | gsk: Cache per-glyph color informationMatthias Clasen2021-07-311-1/+52
| | | | | | | | | | | | We don't really want to load the bitmaps every time we create a render node, so do it once and cache the information on the PangoFont.