summaryrefslogtreecommitdiff
path: root/gtk/gtkrenderbackground.c
Commit message (Collapse)AuthorAgeFilesLines
* renderbackground: Avoid unnecessary work in snapshot_background()Timm Bäder2020-01-261-41/+43
|
* Remove GtkCssShadowsValueTimm Bäder2020-01-181-8/+8
| | | | | | | | | Previously, we wrapped all GtkCssShadowValues in a GtkCssShadowsValue, even if it was just one shadow. This causes an unnecessary bloat in css values. Make each GtkCssShadowValue able to handle multiple shadows instead, and use gtk_css_shadow_value* API everywhere.
* Remove GtkCssRgbaValueTimm Bäder2020-01-181-2/+2
| | | | | | | | The differenciation between a literal color value and an RGBA value caused problems in various situations. Just treat the two the same but don't allow access to the rgba value of a non-literal color value. This gets rid of around 1.6k rgba values in the widget-factory.
* renderbackground: Try to omit a save/restore pairTimm Bäder2020-01-071-6/+11
|
* renderbackground: Save a snapshot_translate() callTimm Bäder2020-01-071-15/+7
| | | | | Just add the values manually when really using the snapshot later. Also unifies the two if branches by pulling out getting the x/y values.
* renderbackground: Use new snapshot transformsBenjamin Otte2019-02-211-8/+7
|
* css: Pass boxes to the render functionsBenjamin Otte2019-02-151-16/+11
| | | | | | Instead of style + rect_of_one_box, pass the new GtkCssBoxes object. This has the nice side effect that when drawing background + border + outline, we only compute all the boxes we need once.
* cssboxes: IntroduceBenjamin Otte2019-02-151-57/+37
| | | | | | | | | | | | | Split out the code for computing CSS boxes from given variables from the background render code. This way, it can be shared between different codebases. Also, make that code completely be contained of static inline functions. That ensures that it can be 100% inlined in cases where only parts of the rectangle are needed (like in gtk_widget_get_width() in the future). This will require some more patches to actually work, but those will follow.
* render: Make gtk_render_background() use the snapshot APIBenjamin Otte2018-07-241-321/+0
| | | | This removes a lot of duplicated code.
* snapshot: Redo debug messagesBenjamin Otte2018-04-241-11/+12
| | | | | Instead of every snapshot function having debug messages, have an explicit gtk_snapshot_push_debug() function that appends a debug node.
* renderbackground: Avoid excess css value lookupsTimm Bäder2018-01-101-7/+7
| | | | | We iterate over all background layers twice, so only lookup blend mode vlaues once.
* renderbackground: Add some constnessTimm Bäder2018-01-101-4/+4
|
* renderbackground: Pull out a gdk_rgba_is_clear checkTimm Bäder2018-01-101-4/+2
| | | | | We only call snapshot_color once, and this way it's clearer that nothing will happen for a clear color from the caller side.
* renderbackground: Minimize style lookupsTimm Bäder2017-10-201-13/+19
| | | | | Move the early returns up so we don't look up all those css values for no reason.
* snapshot: Rename gtk_snapshot_translate_2d()Benjamin Otte2017-01-131-7/+7
| | | | It's now called gtk_snapshot_offset().
* snapshot: Rename append APIsBenjamin Otte2017-01-131-8/+8
| | | | | | Instead of having gtk_snapshot_append_foo_node(), just have gtk_snapshot_append_foo(). Nobody needs to know that this internally uses nodes.
* snapshot: Redo pop() APIBenjamin Otte2017-01-131-5/+5
| | | | | | | | gtk_snapshot_pop() => removed gtk_snapshot_pop_and_append() => gtk_snapshot_pop() So now there is no way to get a rendernode out of the snapshotting API until you gtk_snapshot_finish().
* snapshot: Add gtk_snapshot_push_blend()Benjamin Otte2017-01-131-56/+19
| | | | and use it for backgrounds.
* Snapshot: Only record names if inspector is recordingAlexander Larsson2017-01-111-1/+2
| | | | | Otherwise we do a lot of allocations and vprintf calls which are not used.
* gsk: Add GskRepeatNodeBenjamin Otte2017-01-011-40/+31
| | | | | | | Also add gtk_snapshot_push_repeat() and use that to draw backgrounds. With that change, CSS background snapshots are created without Cairo nodes.
* roundedbox: Add gtk_rounded_boxes_init_for_style()Benjamin Otte2016-12-201-31/+5
| | | | | | | | | Instead of making people intiialize a rectangle and then applying border radius manually, provide a constructor that does it for them. While doing that, also allow people to instead request the padding box or the content box. Refactor all relevant code to use this new constructor.
* gtk: Remove GtkJunctionSidesBenjamin Otte2016-12-201-9/+6
|
* API: gdk: Add gdk_rgba_is_clear() and gdk_rgba_is_opaque()Benjamin Otte2016-12-201-3/+3
| | | | | | | I want to use these inside GSK, and I'm not a fan of putting GdkRGBA APIs into it or duplicating it into GTK. So public API it is.
* gsk: Add gsk_rounded_rect_shrink()Benjamin Otte2016-12-201-2/+2
| | | | | ... and replace _gtk_rounded_box_grow() and _gtk_rounded_box_shrink() with it.
* gsk: Add blend nodesBenjamin Otte2016-12-201-7/+39
| | | | Implement blend mode support in GTK background compositing with it.
* css: Replace custom blend modes with GskBlendModeBenjamin Otte2016-12-201-3/+3
|
* render: Fall back later when rendering backgroundsBenjamin Otte2016-12-201-10/+250
| | | | We can now render most backgrounds fine.
* css: An opaque background does not allow omitting push_groupBenjamin Otte2016-12-201-9/+0
| | | | | | | When the background-clip of the background is smaller than the background-clip of blended images, not pushing a group is wrong. Test testing exactly that included.
* roundedbox: Remove _gtk_rounded_box_path()Benjamin Otte2016-12-201-2/+4
| | | | | | Use gsk_rounded_rect_path() instead. That's a private GSK function, be we can just include its header.
* gtk: Remove GtkRoundedBox structBenjamin Otte2016-12-201-2/+2
| | | | Use GskRoundedRect instead.
* roundedbox: typedef to GskRoundedRectBenjamin Otte2016-12-201-3/+3
|
* Use Graphene init macros for compound literalsEmmanuele Bassi2016-11-211-1/+1
| | | | | The Graphene init macros can now be used for compound literals, which means we need to update our mixed uses.
* render: Refactor background drawing codeBenjamin Otte2016-11-191-19/+11
| | | | We can query the blend mode inside the paint function.
* render: Propagate snapshot drawing to box shadowsBenjamin Otte2016-11-191-17/+39
| | | | | | | This decouples actual background drawing from shadow drawing in the snapshot case. We also now create seperate nodes for shadows vs for backgrounds.
* renderbackground: Remove unused functionsBenjamin Otte2016-11-161-166/+0
|
* snapshot: Add gtk_snapshot_render_background()Benjamin Otte2016-11-151-0/+43
| | | | | | | and gtk_snapshot_render_frame() to be direct replacements for the old gtk_render_*() functions. Use them to replace Cairo usage completely in gtk_window_snapshot().
* render: Draw shadows outside of potential push_group() callBenjamin Otte2016-11-081-12/+12
| | | | Before, the shadows were clipped.
* render: Clip the correct rectangleBenjamin Otte2016-11-081-1/+1
| | | | We translated before.
* rendernode: Require passing a renderer to get_draw_context()Benjamin Otte2016-11-011-4/+4
| | | | | | This is in preparation of making render nodes independent of the renderer, so that they can be rendered multiple times with different renderers.
* Split css background into individual render nodesMatthias Clasen2016-10-181-8/+113
| | | | | Use separate render nodes for each layer in a multi-image background. WARNING: blend modes don't work right yet.
* Don't create render nodes for empty backgroundsMatthias Clasen2016-10-181-0/+14
|
* Break out the css background render node in a functionMatthias Clasen2016-10-181-0/+26
| | | | | This is in preparation for creating separate render nodes for individual backgrounds.
* css: add background-blend-mode supportGeorges Basile Stavracas Neto2016-07-031-3/+85
| | | | | | | | | | | | | | | | | CSS supports blend modes, in which a series of layers are merged together according to the given operation or set of operations. Support for blend modes landed on Cairo, which exposes all the commons and also the exquisites blend modes available. Adding support for blend modes, then, is just a matter of using the available Cairo operations. This patch adds the background-blend-mode CSS enum property, and adapts the background rendering code to blend the backgrounds using the available blend modes when they're set. https://bugzilla.gnome.org/show_bug.cgi?id=768305
* stylecontext: Move background_is_opaque() functionBenjamin Otte2016-02-251-0/+22
| | | | | The new way, it no longer depends on the style context, but on the CssStyle. This will become relevant in the next commit.
* render: Rename gtkthemingbackground.[ch]Benjamin Otte2015-01-201-0/+346
I want the gtkrender prefix for all filenames about rendering.