Commit Graph

49716 Commits

Author SHA1 Message Date
Benjamin Otte
2571036c07 gsk: Turn GskTexture into a GObject 2017-01-01 19:53:36 +01:00
Benjamin Otte
4ead5c3ba8 colorplane: Implement snapshot() 2017-01-01 19:53:36 +01:00
Benjamin Otte
2fe01a5b57 vulkan: Optimize getting textures
When we already have a texture or know we need to upload, just do that
instead of rendering to Cairo.
2017-01-01 19:53:36 +01:00
Emmanuele Bassi
d915292db9 build: Require graphene-gobject
We need the GType wrappers around Graphene types, so we need to do a
dependency check on graphene-gobject-1.0, not graphene-1.0.
2017-01-01 11:10:33 +00:00
Benjamin Otte
e18d5ca835 vulkan: Add support for color matrix nodes
@keyframes weee {
    100% { filter: hue-rotate(1turn); }
}

.background {
    animation: linear infinite 3s weee;
}
2016-12-31 14:37:20 +01:00
Benjamin Otte
e542d411ac accellabel: Initialize allocation variable
I have no idea why gcc didn't catch this.
2016-12-31 14:37:20 +01:00
Benjamin Otte
fb43807fbb cssfiltervalue: Change node name
We're not just using this for icon filters, but for regular filters, so
the existing name is confusing.
2016-12-31 14:37:20 +01:00
Benjamin Otte
1aa0f79e8b vulkan: Make the effect renderer take matrix + offset
This is in preparation for the new color matrix node.

I don't think keeping support for a separate opacity shader is worth it.
2016-12-31 14:37:20 +01:00
Daniel Boles
0259312142 scrolledwindow: Fix func summary being cut off in bindings using doxygen
...which treats the first '.' in doc comments as the end of the summary.
So, e.g., in gtkmm, get_kinetic_scrolling() is currently summarised as
"Changes the behaviour of @scrolled_window wrt." Not very informative!

No need for a period there & anyway, the phrase "wrt to" is superfluous,
and we have space to actually say "with regard to", so just do that now.
2016-12-31 13:27:15 +00:00
Benjamin Otte
959f80e6e9 css: Implement filter
So far, it's only implemented for widgets, not for gadgets.

Not sure how to do it for gadgets without conflicts for widget gadgets
yet...
2016-12-31 02:49:47 +01:00
Benjamin Otte
45fbc25e5e css: Remove -gtk-icon-effect
-gtk-icon-filter replaces this now.
2016-12-31 02:49:47 +01:00
Benjamin Otte
5b33127692 gtk: Replace -gtk-icon-effect with -gtk-icon-filter
Instead of
  -gtk-icon-effect: dim;
  -gtk-icon-effect: hilight;
we now use
  -gtk-icon-filter: opacity(0.5);
  -gtk-icon-filter: brightness(1.2);
respectively.
2016-12-31 02:49:47 +01:00
Benjamin Otte
2645b5a7d7 gtk: Implement -gtk-icon-filter
This uses the new GskColorMatrixNode to implement a filter that applies
to icons. It's meant to replace -gtk-icon-effect.
2016-12-31 02:49:47 +01:00
Benjamin Otte
8973191278 snapshot: Add gtk_snapshot_push_color_matrix()
So far, this is unused.
2016-12-31 02:49:47 +01:00
Benjamin Otte
7540702cf0 gsk: Add GskColorMatrixNode
This node essentially implements the feColorMatrix SVG filter. I got the
idea yesterday after looking at the opacity implementation.

It can be used for opacity (not sure if we want to) and to implement a
bunch of the CSS filters.
2016-12-31 02:49:47 +01:00
Benjamin Otte
91741f6b63 vulkan: Handle opacity nodes
Well, "handle" them actually. We still draw the node's child using
Cairo, but we apply the opacity manually now.
2016-12-31 02:49:47 +01:00
Benjamin Otte
d82e8bf3d6 debugupdates: Draw without cairo node 2016-12-31 02:49:47 +01:00
Chris Mayo
051a7eceb1 GtkAboutDialog: Fix formatting of example email address in html
Signed-off-by: Chris Mayo <aklhfex@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=776524
2016-12-30 10:36:50 -05:00
Matthias Clasen
e62696b145 about dialog: Simplify the template a bit
Remove some unnecessary complications, like an extraneous
box, and some child property settings that are not needed.
2016-12-30 10:33:16 -05:00
Chun-wei Fan
9d8b07d150 Visual Studio builds: Fix .pc generation
A space was missed...
2016-12-30 15:10:12 +08:00
Chun-wei Fan
cf8c72b431 Visual Studio builds: Mention about Vulkan builds
Let people know what is needed for Vulkan builds.
2016-12-30 14:52:00 +08:00
Chun-wei Fan
2fdd0cefa5 Visual Studio builds: Support Vulkan builds
This will assume that the Vulkan SDK can be found in the INCLUDE/LIB paths
that are used by the Visual Studio compiler.
2016-12-30 14:42:38 +08:00
Chun-wei Fan
c2fd445764 Visual Studio builds: Clean up project files
There are items in there that can be combined, as there are mostly no
differences between x64 and Win32 configs for source/data file generation.
2016-12-30 12:46:55 +08:00
Chun-wei Fan
22c719b7eb Visual Studio builds: Remove the Broadway projects
They are not used anymore, so we ought to remove them
2016-12-30 11:17:06 +08:00
Chun-wei Fan
ee2f577991 Visual Studio builds: Drop the Broadway projects
Since the status of the GDK broadway backend is more or less unsupported,
drop the projects that build gtk4-broadwayd and gdk-broadway, and update
the projects to not to refer to them.

However, keep the Broadway configs for now as we will later transform
them to become configs for Vulkan, so bascially besides "installation"
parts and output settings, they will do the same as their Release|Debug
counterparts with no support for Broadway.
2016-12-30 11:09:46 +08:00
Chun-wei Fan
391ea68671 Visual Studio builds: Include Vulkan sources in GSK
...but disable them for now.  Configs will be added for the projects to
support Vulkan-enabled builds which will then enable the builds of these
sources.  Extra commands and items will be needed for the GSK resources
along with ensuring GSK_RENDERER_GSK being defined for the build of GDK,
GDK-Win32 and GSK so that the builds of Vulkan-enabled builds can be done
properly.

Filter out the Vulkan sources from the 'dist hook' rules in
gsk/Makefile.am as we don't want to in turn include them twice in the
projects when the 'make dist' is performed on a system with Vulkan
builds enabled.
2016-12-30 01:08:07 +08:00
Stas Solovey
3cb6868e19 Update Russian translation
(cherry picked from commit c7dce1018b)
2016-12-29 16:23:57 +00:00
Matthias Clasen
7e6820415d Avoid a possible crash in ::activate-url handlers
If the signal handler ends up changing the label text,
the link is no longer around to update the css node.
Check for this possibility to avoid a crash here.
2016-12-29 11:09:20 -05:00
Mario Blättermann
715801f302 Update German translation 2016-12-29 10:40:32 +00:00
Chun-wei Fan
49a782413c gsk: Fix build on Visual Studio
One cannot use #if...#endif within macro calls in Visual Studio and
possibly other compilers, and there are more uses of VLAs that need to be
replaced with g_newa().

There were also checks for the clip type in gskvulkanrenderpass.c which
were possibly not done right (using the address of the type value to check
for a type value), which triggered errors as one is attempting to compare
a pointer type to an enum/int type.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2016-12-29 17:52:52 +08:00
Chun-wei Fan
9db5cc9a98 gdk/gdkvulkancontext.c: Avoid VLAs
During the drive to enable Vulkan context creation on Windows, some more
VLAs were found here.  Replace them with g_newa().

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2016-12-29 17:51:56 +08:00
Chun-wei Fan
c4244ea104 GDK/Win32: Support Vulkan context creation
This adds support to the GDK Win32 backend so that we can support Vulkan
context creation for use in the GSK Vulkan renderer, so that we can test
it on Windows platforms as well.

https://bugzilla.gnome.org/show_bug.cgi?id=776544
2016-12-29 17:48:39 +08:00
Chun-wei Fan
1e084567f9 gsk/gskrendernodeimpl.c: Avoid VLAs
Use g_newa() instead of VLAs, as VLAs may never be supported by some
compilers as it became optional in C11 and there are concerns about their
implementations in compilers that do support it.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2016-12-29 17:41:59 +08:00
Gábor Kelemen
e7f4863814 Update Hungarian translation 2016-12-27 23:08:22 +00:00
Gábor Kelemen
a3ef8d350e Update Hungarian translation 2016-12-27 22:57:31 +00:00
Benjamin Otte
68b39a4727 gsk: Add GSK_RENDERING_MODE=full-redraw
Forces a full redraw every frame.
This is done generically, so it's supported on every renderer.

For widget-factory first page (with the spinner spinning and progressbar
pulsing), I get these numbers per frame:

action                  clipped         full redraw
snapshot                   0ms           7-10ms
cairo rendering            0ms          10-15ms
Vulkan rendering         3-5ms          18-20ms
Vulkan expected *          0ms            1-2ms
GL rendering            unsupported     55-62ms

* expected means disabling rendering of unsupported render nodes,
instead of doing fallback drawing. So it overestimates the performance,
because borders and box-shadows are disabled.
2016-12-27 00:48:00 +01:00
Benjamin Otte
a5f8a74ec1 vulkan: Only render minimal region
It's faster to render once for every rectangle in the clip region than
rendering the outline of the clip region.
Especially because this reduces the time necessary to build up the frame
data.

In widget-factory (where we have 3 rectangles), this leads to a 5x
speedup in the rendering time rendering alone.
Snapshotting time goes from 10ms to ~1ms, which is another huge
improvement.
2016-12-27 00:31:33 +01:00
Benjamin Otte
293248c1d3 gdkvulkan: Track changes per swapchain image
... and use those in begin_frame() to ensure all of the invalid area
gets invalidated.
2016-12-26 22:24:22 +01:00
Benjamin Otte
af917c4ade vulkan: Handle linear gradients
Note: We interpolate premultiplied colors as per the CSS spec. This i
different from Cairo, which interpolates unpremultiplied.

So in testcases with translucent gradients, it's actually Cairo that is
wrong.
2016-12-26 17:22:02 +01:00
Benjamin Otte
c0c44c7b9c tests: Add linear gradient test 2016-12-26 17:22:02 +01:00
Benjamin Otte
573ceb0340 tests: Add a patternspec argument for test creation
That way, I don't need to recreate all the tests I don't care about.

This is particularly useful when I want to change the size of the
testcase.
2016-12-26 17:22:01 +01:00
Benjamin Otte
d7e867aa95 tests: Make rendernode --dump-variant actually work 2016-12-26 17:22:01 +01:00
Benjamin Otte
3c8518dce3 gsk: Add missing Mozilla copyright header
I stole one of their shader functions, and if I steal, I might as well
do it right.
2016-12-26 17:22:01 +01:00
Benjamin Otte
599cc995f3 css: Handle repeating gradients with only one offset
Example:
  repeating-linear-gradient(red 50%, blue 50%)

Those gradients in Firefox draw a solid image of the last color, so do
the same here.
2016-12-26 17:22:01 +01:00
Benjamin Otte
5017c3be65 gsk: Insist on ordered color stops
I don't want to sort them later for the shader preparation, so make
sure they come in ordered.
2016-12-26 17:22:01 +01:00
Benjamin Otte
3a79b17309 vulkan: Fix coordinate setup
This makes rendering textures work when the top left of the rendered
texture is not at (0, 0).
2016-12-26 17:22:01 +01:00
Benjamin Otte
c7083a5d37 tests: Make sure number of runs is 1. 2016-12-26 17:22:01 +01:00
Daniel Boles
2a7171534e Box: Restore an accidentally deleted comment
Also, split a MAX() onto its own line to match the others.
2016-12-26 10:57:51 +00:00
Daniel Boles
71bbd8881f Box: avoid recalc/reassignments, improve var names
Homogeneous branches repeated the calculation/assignment of the initial
space available to children. This avoids that by shuffling some code.

Perhaps more importantly, in doing that, I ended up with some ambiguous
names, and Company and I realised how vague the pre-existing naming was.
"size" becomes "extra_space", as this is what it represents. Conversely,
"extra" becomes "size_given_to_child" (albeit still given out in two
different ways depending on whether the Box is homogeneous). My hope is
that these sections of code are now somewhat less baffling than before!
2016-12-25 23:16:14 +00:00
Daniel Boles
5d10174031 Box: Don't unnecessarily repeat a function call
The spacing was already saved in a variable just above.
2016-12-25 21:46:40 +00:00