Commit Graph

66210 Commits

Author SHA1 Message Date
Matthias Clasen
3db217ab7a gl: Reset GL_UNPACK_ALIGNMENT
Reset GL_UNPACK_ALIGNMENT to its initial value of 4 after
changing it for a glTexImage2D call.
2020-09-25 16:17:45 -04:00
Matthias Clasen
12f05e80aa gl: Fix RGB uploads
I don't really know what to say, other than:
OpenGL is terrible

Fixes: #3194
2020-09-25 13:16:47 -04:00
Matthias Clasen
c9f6a9f7c5 Merge branch 'gles-texture-colors' into 'master'
Fix uploads of textures in GLES (and make texture uploads better)

See merge request GNOME/gtk!2616
2020-09-25 14:53:19 +00:00
Timm Bäder
09564a5798 Merge branch 'wip/baedert/for-master' into 'master'
Wip/baedert/for master

See merge request GNOME/gtk!2617
2020-09-25 13:35:20 +00:00
Alexander Larsson
a299bbfc58 Drop gdk_cairo_surface_upload_to_gl() helper
There is nothing really special about this code, its just a helper for
uploading pixel data to opengl, and we're not really in the business
of doing opengl-specific helper functions.
2020-09-25 15:00:07 +02:00
Alexander Larsson
90fc671ef8 gl backend: Avoid roundtripping via surface when updloading
Do custom uploads rather than using gdk_cairo_surface_upload_to_gl(),
because this way we avoids a roundtrip (memcpy and possibly conversion)
to the cairo image surface format.
2020-09-25 10:04:48 +02:00
Alexander Larsson
c71921a6be gdk_gl_context_upload_texture() avoid conversion for pixbuf format
The gdk-pixbuf non-rgba format can be directly uploaded without
conversion.

The rgba format needs alpha premultiplication though, which is not
supported by GL during upload.
2020-09-25 09:31:43 +02:00
Alexander Larsson
1001995d49 Correctly upload textures for GLES
GLES doesn't support the GL_BGRA +  GL_UNSIGNED_INT_24_8 hack that
we use on desktop OpenGL to upload textures directly in the cairo
pixel format. This adds the required conversions to all the places
that currently need it.

We also add a data_format to the internal gdk_gl_context_upload_texture()
function to make it clearer what the format are. Currently it is always
the cairo image surface format, but eventually we want to support other
formats so that we can avoid some of the unnecessary conversions we do.

Also, the current gdk_gl_context_upload_texture() code always converts
to a cairo format and uploads that like we did before. Later commits
will allow this to use other upload formats that gl supports to avoid
conversions.
2020-09-25 09:31:43 +02:00
Alexander Larsson
8e59cdabac Add GDK_MEMORY_R8G8B8A8_PREMULTIPLIED
This is the default OpenGL format, and in fact the only pixel format
that GLES supports uploading as. Actually, the premultiplied part is
really just about how we use the textures, but all textures in GTK
are premultiplied.
2020-09-25 09:31:43 +02:00
Alexander Larsson
88b709d5ec texture: Unvirtualize download_surface
We only have one implementation, so why do all this vfunc work?
2020-09-25 09:31:43 +02:00
Matthias Clasen
e6d5a3c4e8 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #3180, #3178, and #3179

See merge request GNOME/gtk!2618
2020-09-24 18:50:26 +00:00
Matthias Clasen
e70ed905d1 columview: Don't overdraw
Just always tell the title and cell widgets to
clip their children to the right size. Otherwise
we risk things getting out of sync and unintended
overdraw.

Fixes: #3179
2020-09-24 14:30:40 -04:00
Matthias Clasen
7eb0ae39c5 columview: Fix column resizing
We were not handling the fixed_width quite right,
and that was causing screaming from the GTK size
allocation machinery.

Fixes: #3178
2020-09-24 14:18:38 -04:00
Timm Bäder
2f93287473 cssimagefallback: Whitespace 2020-09-24 19:08:22 +02:00
Timm Bäder
484dcc043b cssimagefallback: Avoid allocating GPtrArray for colors
If we just parse a color, like image(#FFF), avoid allocating the
GPtrArray to store images. This happens in Adwaita for background images
of backdrop buttons. We save around 70 GPtrArrays this way.
2020-09-24 19:08:22 +02:00
Timm Bäder
716b5afe6a Adwaita: Fix calendar header button backdrop bg color 2020-09-24 19:08:22 +02:00
Timm Bäder
fd728ea8bc gl renderer: Lower maximum gradient stop count
6 is still plenty according to my market research.

Should help with #2624
2020-09-24 19:08:22 +02:00
Timm Bäder
8d7b3bade3 gl renderer: Fall back to cairo if gradients use too many stops 2020-09-24 19:08:22 +02:00
Timm Bäder
12cc178756 textbuffer: Don't try to inset NULL text from clipboard
That used to generate a critical error message.

Also free() the data.
2020-09-24 19:08:22 +02:00
Timm Bäder
9eaa8bd1e7 gl renderer: Only return error if creating programs failed 2020-09-24 19:08:22 +02:00
Timm Bäder
15994db74d gl renderer: Use scale_x/y when rendering clipped nodes 2020-09-24 19:08:22 +02:00
Timm Bäder
467be0b7dc gl renderer: Don't use ops_get_scale() when rendering clip nodes
Differentiate between scale_x and scale_y. This works better for e.g.
transform nodes using scaleX().
2020-09-24 19:08:22 +02:00
Timm Bäder
84d2a33c10 gl renderer: Support scaleX/Y better when rendering radial gradients
We should do this everywhere, but this is a start.
2020-09-24 19:08:22 +02:00
Matthias Clasen
9fde0137a0 listview: Avoid a critical when reordering
When sorting a cell into the place its already at,
we were triggering criticals. Avoid that.

Fixes: #3180
2020-09-23 22:53:21 -04:00
Matthias Clasen
9dab51e7be Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #3188

See merge request GNOME/gtk!2612
2020-09-23 22:44:22 +00:00
Matthias Clasen
810218b2f5 fontchooser: Don't center the list
The centered layout of the font previews don't look appealing
and make it harder to judge the relative width and weight of
the individual styles.

Fixes: #3188
2020-09-23 16:32:48 -04:00
Balázs Úr
7acbbd6bdd Update Hungarian translation 2020-09-23 15:25:12 +00:00
Balázs Úr
a364ab1efb Update Hungarian translation 2020-09-23 14:39:40 +00:00
Thomas Holder
4325c20013 gtktreeview: Fix child access after TEST_EXPAND_ROW
In gtk_tree_view_build_tree with recurse=TRUE, the TEST_EXPAND_ROW
signal might invalidate the child iterator. Getting the iterator after
the signal (instead of before) fixes the issue.

Fixes https://gitlab.com/inkscape/inkscape/-/issues/1879
2020-09-23 07:53:33 -04:00
Matthias Clasen
7bae48335f Merge branch 'wip/jimmac/osd-spinbutton' into 'master'
Adwaita: osd spinbutton specificity bump

Closes #2769

See merge request GNOME/gtk!2610
2020-09-23 11:47:01 +00:00
Matthias Clasen
571f15cac6 Merge branch 'make-claiming-button-release-work' into 'master'
gestures: Make claiming button release work

See merge request GNOME/gtk!2576
2020-09-23 11:35:59 +00:00
Jakub Steiner
78236bfdbe Adwaita: osd spinbutton specificity bump
- mimic the peculiar selector from the normal style onto osd to
  override.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2769
2020-09-23 10:16:55 +02:00
Matthias Clasen
5e4180b5f0 Merge branch 'improve-columnview-styling' into 'master'
Adwaita: Improve columnview styling

See merge request GNOME/gtk!2608
2020-09-22 03:01:38 +00:00
nana-4
2d6a9990b7 Adwaita: Don't restrict columnview editablelabel style to .data-table
This should be available without .data-table.
2020-09-22 10:40:15 +09:00
nana-4
42be26f1b1 Adwaita: Improve columnview styling
- Move padding from parent row to child cell.
- Align horizontal sizing of cell with header button.
- Properly support GtkColumnView:show-column-separators.
- Change cell height with and without .data-table.
2020-09-22 10:37:04 +09:00
nana-4
f98055b075 Adwaita: Fix separator color for lists 2020-09-22 10:35:15 +09:00
Matthias Clasen
3252d4cab2 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

See merge request GNOME/gtk!2607
2020-09-21 18:11:41 +00:00
Matthias Clasen
2c527ec87e inspector: Make switches go back to normal size 2020-09-21 11:53:48 -04:00
Matthias Clasen
d5e315c470 gtk-demo: Improve the pickers demo
"Two of every kind..." Add some customized pickers
here. This found a number of issues that have been
fixed in the preceding commits.
2020-09-21 11:53:48 -04:00
Matthias Clasen
256f845d89 colorbutton: Fix handling of transient parents
When we create the dialog before the button has
been rooted, we need to update its transient
parent when that happens.
2020-09-21 11:53:48 -04:00
Timm Bäder
b3c21bc89a Merge branch 'fix-hover-tracking' into 'master'
main: Update pointer focus state for button releases

Closes #3172

See merge request GNOME/gtk!2601
2020-09-21 12:20:00 +00:00
Marek Černocký
6bc46a9a69 Updated Czech translation 2020-09-21 08:30:59 +02:00
Matthias Clasen
1d34f955a2 filechooser: Fix gtk_file_chooser_set_choice
This broke when it was ported to GtkDropDown.
2020-09-20 12:04:49 -04:00
Matthias Clasen
ee75bae8f8 fontchooser: Make sure the tweak button is updated
This was showing up as tweak buttons being visible
when they should not. The code probably relied on
widgets being hidden by default (as they were in
GTK3).
2020-09-20 10:59:37 -04:00
Matthias Clasen
3c62cd90d4 fontchooser: Handle families without faces
This might seem useless, but I've met fonts
where pango_font_family_get_face (family, NULL)
return NULL. Handle it without criticals.
2020-09-20 10:59:37 -04:00
Matthias Clasen
81793b62d8 docs: Improve gtk_widget_set_font_map docs 2020-09-20 10:59:37 -04:00
Matthias Clasen
9ee7bdf4cb Merge branch 'fix-wayland-popups' into 'master'
wayland: Fix grabbing popup

See merge request GNOME/gtk!2604
2020-09-20 14:19:50 +00:00
Matthias Clasen
bb402a1f1d wayland: Fix grabbing popup
A typo snuck into commit 3023a61e1d that
caused us to fail all grabbing popups with
"grab failed: not viewable". Fix that.
2020-09-20 10:02:53 -04:00
Emin Tufan Çetin
02614713da Update Turkish translation 2020-09-20 06:38:03 +00:00
Matthias Clasen
18a5ca257a Merge branch 'kill-widget-new' into 'master'
Drop gtk_widget_new

See merge request GNOME/gtk!2603
2020-09-19 21:25:32 +00:00