Compare commits
101 Commits
test-conte
...
quick-keyb
Author | SHA1 | Date | |
---|---|---|---|
|
cd7c0f8ae9 | ||
|
5f91bb81ed | ||
|
1fba59f1d1 | ||
|
68a2ca7e85 | ||
|
93ccf08c81 | ||
|
e9f5a3e9e2 | ||
|
2b85c49fb1 | ||
|
d7c3235cd0 | ||
|
ea94bac79e | ||
|
63713c3b68 | ||
|
81fd9741ff | ||
|
c7523cecf1 | ||
|
ce6569d1a6 | ||
|
852f46df19 | ||
|
d82f603fcb | ||
|
5e8e4130a5 | ||
|
f81aa14d93 | ||
|
81db6e9e61 | ||
|
ac0311b621 | ||
|
f41e58d179 | ||
|
d288931b45 | ||
|
03adeecfa3 | ||
|
5439f4596c | ||
|
f98d1a6474 | ||
|
57e6aae80a | ||
|
f23eaafc85 | ||
|
926b26e9fc | ||
|
88f27c423c | ||
|
30342896d0 | ||
|
be8e203edc | ||
|
623c93ccc8 | ||
|
34d8beaf4f | ||
|
983b6ce341 | ||
|
771df47820 | ||
|
3c218687e3 | ||
|
37fb370a5d | ||
|
1cc9413383 | ||
|
bfea39ab2f | ||
|
84d6f023b5 | ||
|
7fe04a7122 | ||
|
19cea99007 | ||
|
1c4ad78d52 | ||
|
955a7e643e | ||
|
b85a137a68 | ||
|
d17ca6b451 | ||
|
da7040874e | ||
|
6f9c4c894d | ||
|
cc7a35cd30 | ||
|
f841621348 | ||
|
f99ecd3739 | ||
|
5eb7e550d1 | ||
|
8d33f2a511 | ||
|
27b0321dec | ||
|
538605eccb | ||
|
81f5967587 | ||
|
771437acf9 | ||
|
a3da58133e | ||
|
9b558b50b8 | ||
|
7ce2eeac47 | ||
|
182dccb8f0 | ||
|
17d2ba94d6 | ||
|
5bac4f13a0 | ||
|
64f9d82506 | ||
|
b83f3d871f | ||
|
a235b59089 | ||
|
0ca6471df4 | ||
|
98dde97f20 | ||
|
9bd9847b3f | ||
|
b79d4a3a22 | ||
|
33ab588d4e | ||
|
7200a93a88 | ||
|
319762b908 | ||
|
e453a989df | ||
|
f56328a6cc | ||
|
f29b24517e | ||
|
552df197c4 | ||
|
f6e47b7eb0 | ||
|
4214067d52 | ||
|
d9a2b74b4a | ||
|
21df62f428 | ||
|
4e501d2d44 | ||
|
5afd5cfec7 | ||
|
ad65db901a | ||
|
406b1e2e03 | ||
|
f1729affa8 | ||
|
3b2ba8ed99 | ||
|
386c3ac34f | ||
|
d92c6406d1 | ||
|
d666f4ab7f | ||
|
5df360f436 | ||
|
0197149ba3 | ||
|
b310ab7304 | ||
|
062e3da57d | ||
|
cdbd931dba | ||
|
2f96a08b3f | ||
|
c1fc6c35cf | ||
|
060992aeba | ||
|
2c15d563e2 | ||
|
2dd7ab2a50 | ||
|
0736fef585 | ||
|
0442fc2b55 |
@@ -26,7 +26,7 @@ variables:
|
||||
BACKEND_FLAGS: "-Dx11-backend=true -Dwayland-backend=true -Dbroadway-backend=true"
|
||||
FEATURE_FLAGS: "-Dvulkan=enabled -Dcloudproviders=enabled -Ddemos=false -Dbuild-examples=false -Dbuild-tests=false -Dbuild-testsuite=true"
|
||||
MESON_TEST_TIMEOUT_MULTIPLIER: 3
|
||||
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v42"
|
||||
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v46"
|
||||
|
||||
workflow:
|
||||
rules:
|
||||
@@ -57,15 +57,9 @@ style-check-diff:
|
||||
reports:
|
||||
junit:
|
||||
- "${CI_PROJECT_DIR}/_build/report-x11.xml"
|
||||
- "${CI_PROJECT_DIR}/_build/report-x11_unstable.xml"
|
||||
- "${CI_PROJECT_DIR}/_build/report-wayland.xml"
|
||||
- "${CI_PROJECT_DIR}/_build/report-wayland_unstable.xml"
|
||||
- "${CI_PROJECT_DIR}/_build/report-wayland_gles.xml"
|
||||
- "${CI_PROJECT_DIR}/_build/report-wayland_gles_unstable.xml"
|
||||
- "${CI_PROJECT_DIR}/_build/report-wayland_smalltexture.xml"
|
||||
- "${CI_PROJECT_DIR}/_build/report-wayland_smalltexture_unstable.xml"
|
||||
- "${CI_PROJECT_DIR}/_build/report-broadway.xml"
|
||||
- "${CI_PROJECT_DIR}/_build/report-broadway_unstable.xml"
|
||||
name: "gtk-${CI_COMMIT_REF_NAME}"
|
||||
paths:
|
||||
- "${CI_PROJECT_DIR}/_build/meson-logs"
|
||||
@@ -91,7 +85,6 @@ fedora-x86_64:
|
||||
script:
|
||||
- .gitlab-ci/show-info-linux.sh
|
||||
- export PATH="$HOME/.local/bin:$PATH"
|
||||
- pip3 install --user meson~=0.64
|
||||
- meson subprojects download
|
||||
- meson subprojects update --reset
|
||||
- mkdir _install
|
||||
@@ -109,7 +102,6 @@ fedora-x86_64:
|
||||
- .gitlab-ci/run-tests.sh _build x11
|
||||
- .gitlab-ci/run-tests.sh _build wayland
|
||||
- .gitlab-ci/run-tests.sh _build wayland_gles
|
||||
- .gitlab-ci/run-tests.sh _build wayland_smalltexture
|
||||
- .gitlab-ci/run-tests.sh _build broadway
|
||||
|
||||
release-build:
|
||||
@@ -121,7 +113,6 @@ release-build:
|
||||
script:
|
||||
- .gitlab-ci/show-info-linux.sh
|
||||
- export PATH="$HOME/.local/bin:$PATH"
|
||||
- pip3 install --user meson~=0.64
|
||||
- meson subprojects download
|
||||
- meson subprojects update --reset
|
||||
- meson setup
|
||||
@@ -152,23 +143,11 @@ fedora-mingw64:
|
||||
script:
|
||||
- .gitlab-ci/show-info-linux.sh
|
||||
- export PATH="$HOME/.local/bin:$PATH"
|
||||
- pip3 install --user meson~=0.64
|
||||
- pip3 install --user meson~=1.0
|
||||
- meson subprojects download
|
||||
- meson subprojects update --reset
|
||||
# Test that mingw64-meson still fails. If it has stopped failing, the CI
|
||||
# will fail and now you should remove the hack that follows this.
|
||||
- FAILED=false
|
||||
- mingw64-meson --version || FAILED=true
|
||||
- test $FAILED = false && echo "mingw64-meson works now, remove the hack" && exit 1
|
||||
# HACK: Running mingw64-meson directly fails on the CI with:
|
||||
# /usr/bin/mingw64-meson: line 92: fg: no job control
|
||||
# Because rpm is not evaluating %__meson and it gets interpreted as a job
|
||||
# specifier. So we fix that and run it ourselves.
|
||||
- rpm --eval "%{mingw64_meson}" > mingw64-meson.sh
|
||||
- sed -i -e 's/%__meson/meson/' mingw64-meson.sh
|
||||
- chmod +x mingw64-meson.sh
|
||||
- ./mingw64-meson.sh -Dintrospection=disabled -Dgraphene:introspection=disabled _build
|
||||
- ninja -C _build
|
||||
- meson -Dintrospection=disabled -Dgraphene:introspection=disabled _build
|
||||
- meson compile -C _build
|
||||
|
||||
.mingw-defaults:
|
||||
stage: build
|
||||
@@ -210,7 +189,7 @@ macos:
|
||||
needs: []
|
||||
before_script:
|
||||
- bash .gitlab-ci/show-info-osx.sh
|
||||
- pip3 install --user meson~=0.64
|
||||
- pip3 install --user meson~=1.0
|
||||
- pip3 install --user ninja
|
||||
- export PATH=/Users/gitlabrunner/Library/Python/3.7/bin:$PATH
|
||||
- export MESON_FORCE_BACKTRACE=1
|
||||
@@ -368,7 +347,6 @@ static-scan:
|
||||
EXTRA_MESON_FLAGS: "--buildtype=debug"
|
||||
script:
|
||||
- export PATH="$HOME/.local/bin:$PATH"
|
||||
- pip3 install --user meson~=0.64
|
||||
- meson setup
|
||||
${COMMON_MESON_FLAGS}
|
||||
${EXTRA_MESON_FLAGS}
|
||||
@@ -390,7 +368,6 @@ asan-build:
|
||||
variables:
|
||||
script:
|
||||
- export PATH="$HOME/.local/bin:$PATH"
|
||||
- pip3 install --user meson~=0.64
|
||||
- CC=clang meson setup --buildtype=debugoptimized -Db_sanitize=address -Db_lundef=false -Dintrospection=disabled -Df16c=disabled _build
|
||||
- ninja -C _build
|
||||
- .gitlab-ci/run-tests.sh _build wayland
|
||||
@@ -405,7 +382,6 @@ reference:
|
||||
needs: []
|
||||
script:
|
||||
- export PATH="$HOME/.local/bin:$PATH"
|
||||
- pip3 install --user meson~=0.64
|
||||
- meson setup
|
||||
${COMMON_MESON_FLAGS}
|
||||
--buildtype=release
|
||||
|
@@ -32,7 +32,6 @@ RUN dnf -y install \
|
||||
glib2-static \
|
||||
glibc-devel \
|
||||
glibc-headers \
|
||||
gnome-desktop-testing \
|
||||
gnupg2 \
|
||||
gobject-introspection-devel \
|
||||
graphene-devel \
|
||||
@@ -73,10 +72,14 @@ RUN dnf -y install \
|
||||
mesa-dri-drivers \
|
||||
mesa-libEGL-devel \
|
||||
mesa-libGLES-devel \
|
||||
meson \
|
||||
mutter \
|
||||
ninja-build \
|
||||
pango-devel \
|
||||
pcre-devel \
|
||||
pcre-static \
|
||||
pipewire \
|
||||
pipewire-gstreamer \
|
||||
python3 \
|
||||
python3-docutils \
|
||||
python3-gobject \
|
||||
@@ -84,6 +87,7 @@ RUN dnf -y install \
|
||||
python3-markdown \
|
||||
python3-packaging \
|
||||
python3-pip \
|
||||
python3-pydbus \
|
||||
python3-pygments \
|
||||
python3-typogrify \
|
||||
python3-wheel \
|
||||
@@ -95,6 +99,7 @@ RUN dnf -y install \
|
||||
weston \
|
||||
weston-libs \
|
||||
which \
|
||||
wireplumber \
|
||||
xorg-x11-server-Xvfb \
|
||||
&& dnf clean all
|
||||
|
||||
|
@@ -138,7 +138,8 @@ if [ $run == 1 ]; then
|
||||
echo -e "\e[1;32mRUNNING\e[0m: ${base} as ${TAG}"
|
||||
${CMD} run \
|
||||
--rm \
|
||||
--volume "$(pwd)/..:/home/user/app" \
|
||||
--userns=keep-id \
|
||||
--volume "$(pwd)/..:/home/user/app:rw,z" \
|
||||
--workdir "/home/user/app" \
|
||||
--tty \
|
||||
--interactive "${TAG}" \
|
||||
|
@@ -6,6 +6,7 @@ set +e
|
||||
srcdir=$( pwd )
|
||||
builddir=$1
|
||||
backend=$2
|
||||
multiplier=${MESON_TEST_TIMEOUT_MULTIPLIER:-1}
|
||||
|
||||
# Ignore memory leaks lower in dependencies
|
||||
export LSAN_OPTIONS=suppressions=$srcdir/lsan.supp:print_suppressions=0:verbosity=1:log_threads=1
|
||||
@@ -15,7 +16,8 @@ case "${backend}" in
|
||||
x11)
|
||||
xvfb-run -a -s "-screen 0 1024x768x24 -noreset" \
|
||||
meson test -C ${builddir} \
|
||||
--timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" \
|
||||
--quiet \
|
||||
--timeout-multiplier "${multiplier}" \
|
||||
--print-errorlogs \
|
||||
--setup=${backend} \
|
||||
--suite=gtk \
|
||||
@@ -26,14 +28,6 @@ case "${backend}" in
|
||||
# Store the exit code for the CI run, but always
|
||||
# generate the reports
|
||||
exit_code=$?
|
||||
|
||||
xvfb-run -a -s "-screen 0 1024x768x24 -noreset" \
|
||||
meson test -C ${builddir} \
|
||||
--timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" \
|
||||
--print-errorlogs \
|
||||
--setup=${backend}_unstable \
|
||||
--suite=flaky \
|
||||
--suite=failing || true
|
||||
;;
|
||||
|
||||
wayland*)
|
||||
@@ -44,22 +38,17 @@ case "${backend}" in
|
||||
export WAYLAND_DISPLAY=wayland-5
|
||||
|
||||
meson test -C ${builddir} \
|
||||
--timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" \
|
||||
--quiet \
|
||||
--timeout-multiplier "${multiplier}" \
|
||||
--print-errorlogs \
|
||||
--setup=${backend} \
|
||||
--suite=gtk \
|
||||
--no-suite=failing \
|
||||
--no-suite=flaky \
|
||||
--no-suite=${backend}_failing \
|
||||
--no-suite=gsk-compare-broadway
|
||||
exit_code=$?
|
||||
|
||||
meson test -C ${builddir} \
|
||||
--timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" \
|
||||
--print-errorlogs \
|
||||
--setup=${backend}_unstable \
|
||||
--suite=flaky \
|
||||
--suite=failing || true
|
||||
|
||||
kill ${compositor}
|
||||
;;
|
||||
|
||||
@@ -71,7 +60,8 @@ case "${backend}" in
|
||||
export BROADWAY_DISPLAY=:5
|
||||
|
||||
meson test -C ${builddir} \
|
||||
--timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" \
|
||||
--quiet \
|
||||
--timeout-multiplier "${multiplier}" \
|
||||
--print-errorlogs \
|
||||
--setup=${backend} \
|
||||
--suite=gtk \
|
||||
@@ -82,13 +72,6 @@ case "${backend}" in
|
||||
# don't let Broadway failures fail the run, for now
|
||||
exit_code=0
|
||||
|
||||
meson test -C ${builddir} \
|
||||
--timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" \
|
||||
--print-errorlogs \
|
||||
--setup=${backend}_unstable \
|
||||
--suite=flaky \
|
||||
--suite=failing || true
|
||||
|
||||
kill ${server}
|
||||
;;
|
||||
|
||||
@@ -101,20 +84,19 @@ esac
|
||||
|
||||
cd ${builddir}
|
||||
|
||||
for suffix in "" "_unstable"; do
|
||||
$srcdir/.gitlab-ci/meson-junit-report.py \
|
||||
$srcdir/.gitlab-ci/meson-junit-report.py \
|
||||
--project-name=gtk \
|
||||
--backend="${backend}${suffix}" \
|
||||
--backend="${backend}" \
|
||||
--job-id="${CI_JOB_NAME}" \
|
||||
--output="report-${backend}${suffix}.xml" \
|
||||
"meson-logs/testlog-${backend}${suffix}.json"
|
||||
$srcdir/.gitlab-ci/meson-html-report.py \
|
||||
--output="report-${backend}.xml" \
|
||||
"meson-logs/testlog-${backend}.json"
|
||||
|
||||
$srcdir/.gitlab-ci/meson-html-report.py \
|
||||
--project-name=gtk \
|
||||
--backend="${backend}${suffix}" \
|
||||
--backend="${backend}" \
|
||||
--job-id="${CI_JOB_NAME}" \
|
||||
--reftest-output-dir="testsuite/reftests/output/${backend}${suffix}" \
|
||||
--output="report-${backend}${suffix}.html" \
|
||||
"meson-logs/testlog-${backend}${suffix}.json"
|
||||
done
|
||||
--reftest-output-dir="testsuite/reftests/output/${backend}" \
|
||||
--output="report-${backend}.html" \
|
||||
"meson-logs/testlog-${backend}.json"
|
||||
|
||||
exit $exit_code
|
||||
|
@@ -64,6 +64,8 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="short_time_label">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label" translatable="yes">38m</property>
|
||||
<style>
|
||||
|
@@ -64,6 +64,7 @@ struct _NodeEditorWindow
|
||||
GListStore *renderers;
|
||||
GskRenderNode *node;
|
||||
|
||||
GFile *file;
|
||||
GFileMonitor *file_monitor;
|
||||
|
||||
GArray *errors;
|
||||
@@ -544,12 +545,14 @@ node_editor_window_load (NodeEditorWindow *self,
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_clear_object (&self->file);
|
||||
g_clear_object (&self->file_monitor);
|
||||
|
||||
if (!load_file_contents (self, file))
|
||||
return FALSE;
|
||||
|
||||
self->file_monitor = g_file_monitor_file (file, G_FILE_MONITOR_NONE, NULL, &error);
|
||||
self->file = g_object_ref (file);
|
||||
self->file_monitor = g_file_monitor_file (self->file, G_FILE_MONITOR_NONE, NULL, &error);
|
||||
|
||||
if (error)
|
||||
{
|
||||
@@ -586,13 +589,21 @@ static void
|
||||
show_open_filechooser (NodeEditorWindow *self)
|
||||
{
|
||||
GtkFileDialog *dialog;
|
||||
GFile *cwd;
|
||||
|
||||
dialog = gtk_file_dialog_new ();
|
||||
gtk_file_dialog_set_title (dialog, "Open node file");
|
||||
cwd = g_file_new_for_path (".");
|
||||
gtk_file_dialog_set_initial_folder (dialog, cwd);
|
||||
g_object_unref (cwd);
|
||||
if (self->file)
|
||||
{
|
||||
gtk_file_dialog_set_initial_file (dialog, self->file);
|
||||
}
|
||||
else
|
||||
{
|
||||
GFile *cwd;
|
||||
cwd = g_file_new_for_path (".");
|
||||
gtk_file_dialog_set_initial_folder (dialog, cwd);
|
||||
g_object_unref (cwd);
|
||||
}
|
||||
|
||||
gtk_file_dialog_open (dialog, GTK_WINDOW (self),
|
||||
NULL, open_response_cb, self);
|
||||
g_object_unref (dialog);
|
||||
@@ -650,14 +661,21 @@ save_cb (GtkWidget *button,
|
||||
NodeEditorWindow *self)
|
||||
{
|
||||
GtkFileDialog *dialog;
|
||||
GFile *cwd;
|
||||
|
||||
dialog = gtk_file_dialog_new ();
|
||||
gtk_file_dialog_set_title (dialog, "Save node");
|
||||
cwd = g_file_new_for_path (".");
|
||||
gtk_file_dialog_set_initial_folder (dialog, cwd);
|
||||
gtk_file_dialog_set_initial_name (dialog, "demo.node");
|
||||
g_object_unref (cwd);
|
||||
if (self->file)
|
||||
{
|
||||
gtk_file_dialog_set_initial_file (dialog, self->file);
|
||||
}
|
||||
else
|
||||
{
|
||||
GFile *cwd = g_file_new_for_path (".");
|
||||
gtk_file_dialog_set_initial_folder (dialog, cwd);
|
||||
gtk_file_dialog_set_initial_name (dialog, "demo.node");
|
||||
g_object_unref (cwd);
|
||||
}
|
||||
|
||||
gtk_file_dialog_save (dialog,
|
||||
GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (button))),
|
||||
NULL,
|
||||
@@ -1091,6 +1109,8 @@ node_editor_window_finalize (GObject *object)
|
||||
|
||||
g_clear_pointer (&self->node, gsk_render_node_unref);
|
||||
g_clear_object (&self->renderers);
|
||||
g_clear_object (&self->file_monitor);
|
||||
g_clear_object (&self->file);
|
||||
|
||||
G_OBJECT_CLASS (node_editor_window_parent_class)->finalize (object);
|
||||
}
|
||||
|
@@ -68,6 +68,7 @@ ui_files = [
|
||||
'stackswitcher.ui',
|
||||
'statusbar.ui',
|
||||
'switch.ui',
|
||||
'switch-state.ui',
|
||||
'toggle-button.ui',
|
||||
'video.ui',
|
||||
'volumebutton.ui',
|
||||
|
BIN
docs/reference/gtk/images/switch-state.png
Normal file
BIN
docs/reference/gtk/images/switch-state.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
43
docs/reference/gtk/images/switch-state.ui
Normal file
43
docs/reference/gtk/images/switch-state.ui
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkWindow">
|
||||
<property name="decorated">0</property>
|
||||
<property name="resizable">0</property>
|
||||
<property name="default-width">280</property>
|
||||
<property name="default-height">120</property>
|
||||
<style>
|
||||
<class name="nobackground"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<style>
|
||||
<class name="shadow"/>
|
||||
<class name="background"/>
|
||||
<class name="frame"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">3</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="vexpand">1</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<child>
|
||||
<object class="GtkSwitch">
|
||||
<property name="active">1</property>
|
||||
<property name="state">0</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch">
|
||||
<property name="active">0</property>
|
||||
<property name="state">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
@@ -875,10 +875,10 @@ reference.
|
||||
### Adapt to coordinate API changes
|
||||
|
||||
A number of APIs that are accepting or returning coordinates have
|
||||
been changed from ints to doubles: `gtk_widget_translate_coordinates()`,
|
||||
been changed from `int`s to `double`s: `gtk_widget_translate_coordinates()`,
|
||||
`gtk_fixed_put()`, `gtk_fixed_move()`. This change is mostly transparent,
|
||||
except for cases where out parameters are involved: you need to
|
||||
pass double* now, instead of int*.
|
||||
pass `double*` now, instead of `int*`.
|
||||
|
||||
### Adapt to GtkStyleContext API changes
|
||||
|
||||
|
@@ -119,3 +119,17 @@ it no longer has a resize handle for the window.
|
||||
|
||||
These are very specialized widgets that should better live with the application
|
||||
where they are used.
|
||||
|
||||
## Widget size api changes
|
||||
|
||||
The functions gtk_widget_get_allocated_width() and gtk_widget_get_allocated_height()
|
||||
are going away. In most cases, [method@Gtk.Widget.get_width] and [method@Gtk.Widget.get_height]
|
||||
are suitable replacements. Note that the semantics are slightly different though:
|
||||
the old functions return the size of the CSS border area, while the new functions return
|
||||
the size of the widgets content area. In places where this difference matters, you can
|
||||
use `gtk_widget_compute_bounds (widget, widget, &bounds)` instead.
|
||||
|
||||
The function gtk_widget_get_allocation() is also going away. It does not have a direct
|
||||
replacement, but the previously mentioned alternatives can be used for it too.
|
||||
|
||||
The function gtk_widget_get_allocated_baseline() has been renamed to [method@Gtk.Widget.get_baseline].
|
||||
|
@@ -437,7 +437,7 @@ gdk_display_manager_open_display (GdkDisplayManager *manager,
|
||||
}
|
||||
}
|
||||
|
||||
if (!found && !display)
|
||||
if (!found && !any && !display)
|
||||
g_warning ("No such backend: %s", backend);
|
||||
}
|
||||
|
||||
|
@@ -223,7 +223,7 @@ gdk_vulkan_strerror (VkResult result)
|
||||
#if VK_HEADER_VERSION < 140
|
||||
case VK_RESULT_RANGE_SIZE:
|
||||
#endif
|
||||
#if VK_HEADER_VERSION >= 218
|
||||
#if VK_HEADER_VERSION >= 238
|
||||
case VK_ERROR_IMAGE_USAGE_NOT_SUPPORTED_KHR:
|
||||
return "The requested VkImageUsageFlags are not supported. (VK_ERROR_IMAGE_USAGE_NOT_SUPPORTED_KHR)";
|
||||
case VK_ERROR_VIDEO_PICTURE_LAYOUT_NOT_SUPPORTED_KHR:
|
||||
|
@@ -78,6 +78,7 @@ gsk_gl_attachment_state_bind_texture (GskGLAttachmentState *self,
|
||||
target == GL_TEXTURE_2D ||
|
||||
target == GL_TEXTURE_3D);
|
||||
g_assert (texture >= GL_TEXTURE0 && texture <= GL_TEXTURE16);
|
||||
g_assert (texture - GL_TEXTURE0 < G_N_ELEMENTS (self->textures));
|
||||
|
||||
attach = &self->textures[texture - GL_TEXTURE0];
|
||||
|
||||
|
@@ -73,11 +73,13 @@ struct _GskGLBindFramebuffer
|
||||
|
||||
G_STATIC_ASSERT (sizeof (GskGLBindFramebuffer) == 4);
|
||||
|
||||
/* Increase if shaders add more textures */
|
||||
#define GSK_GL_MAX_TEXTURES_PER_PROGRAM 4
|
||||
|
||||
struct _GskGLAttachmentState
|
||||
{
|
||||
GskGLBindFramebuffer fbo;
|
||||
/* Increase if shaders add more textures */
|
||||
GskGLBindTexture textures[4];
|
||||
GskGLBindTexture textures[GSK_GL_MAX_TEXTURES_PER_PROGRAM];
|
||||
guint n_changed;
|
||||
};
|
||||
|
||||
|
@@ -1028,8 +1028,8 @@ gsk_gl_command_queue_execute (GskGLCommandQueue *self,
|
||||
G_GNUC_UNUSED unsigned int n_programs = 0;
|
||||
guint vao_id;
|
||||
guint vbo_id;
|
||||
int textures[4];
|
||||
int samplers[4];
|
||||
int textures[GSK_GL_MAX_TEXTURES_PER_PROGRAM];
|
||||
int samplers[GSK_GL_MAX_TEXTURES_PER_PROGRAM];
|
||||
int framebuffer = -1;
|
||||
int next_batch_index;
|
||||
int active = -1;
|
||||
@@ -1161,6 +1161,8 @@ gsk_gl_command_queue_execute (GskGLCommandQueue *self,
|
||||
if G_UNLIKELY (batch->draw.bind_count > 0)
|
||||
{
|
||||
const GskGLCommandBind *bind = &self->batch_binds.items[batch->draw.bind_offset];
|
||||
|
||||
g_assert (bind->texture < G_N_ELEMENTS (textures));
|
||||
for (guint i = 0; i < batch->draw.bind_count; i++)
|
||||
{
|
||||
if (textures[bind->texture] != bind->id)
|
||||
|
@@ -1121,19 +1121,21 @@ gsk_gl_driver_lookup_shader (GskGLDriver *self,
|
||||
}
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
static void
|
||||
write_atlas_to_png (GskGLDriver *driver,
|
||||
GskGLTextureAtlas *atlas,
|
||||
const char *filename)
|
||||
void
|
||||
gsk_gl_driver_save_texture_to_png (GskGLDriver *driver,
|
||||
int texture_id,
|
||||
int width,
|
||||
int height,
|
||||
const char *filename)
|
||||
{
|
||||
GdkGLTextureBuilder *builder;
|
||||
GdkTexture *texture;
|
||||
|
||||
builder = gdk_gl_texture_builder_new ();
|
||||
gdk_gl_texture_builder_set_context (builder, gsk_gl_driver_get_context (driver));
|
||||
gdk_gl_texture_builder_set_id (builder, atlas->texture_id);
|
||||
gdk_gl_texture_builder_set_width (builder, atlas->width);
|
||||
gdk_gl_texture_builder_set_height (builder, atlas->height);
|
||||
gdk_gl_texture_builder_set_id (builder, texture_id);
|
||||
gdk_gl_texture_builder_set_width (builder, width);
|
||||
gdk_gl_texture_builder_set_height (builder, height);
|
||||
|
||||
texture = gdk_gl_texture_builder_build (builder, NULL, NULL);
|
||||
gdk_texture_save_to_png (texture, filename);
|
||||
@@ -1168,7 +1170,7 @@ gsk_gl_driver_save_atlases_to_png (GskGLDriver *self,
|
||||
G_DIR_SEPARATOR_S,
|
||||
(int)self->current_frame_id,
|
||||
atlas->texture_id);
|
||||
write_atlas_to_png (self, atlas, filename);
|
||||
gsk_gl_driver_save_texture_to_png (self, atlas->texture_id, atlas->width, atlas->height, filename);
|
||||
g_free (filename);
|
||||
}
|
||||
|
||||
|
@@ -176,8 +176,13 @@ GskGLProgram * gsk_gl_driver_lookup_shader (GskGLDriver *s
|
||||
GError **error);
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
void gsk_gl_driver_save_texture_to_png (GskGLDriver *self,
|
||||
int texture_id,
|
||||
int width,
|
||||
int height,
|
||||
const char *filename);
|
||||
void gsk_gl_driver_save_atlases_to_png (GskGLDriver *self,
|
||||
const char *directory);
|
||||
const char *filename);
|
||||
#endif
|
||||
|
||||
static inline GskGLTexture *
|
||||
|
@@ -356,7 +356,8 @@ gsk_gl_renderer_render_texture (GskRenderer *renderer,
|
||||
for (x = 0; x < width; x += max_size)
|
||||
{
|
||||
texture = gsk_gl_renderer_render_texture (renderer, root,
|
||||
&GRAPHENE_RECT_INIT (x, y,
|
||||
&GRAPHENE_RECT_INIT (viewport->origin.x + x,
|
||||
viewport->origin.y + y,
|
||||
MIN (max_size, viewport->size.width - x),
|
||||
MIN (max_size, viewport->size.height - y)));
|
||||
gdk_texture_download (texture,
|
||||
|
@@ -54,27 +54,6 @@
|
||||
/* Make sure gradient stops fits in packed array_count */
|
||||
G_STATIC_ASSERT ((MAX_GRADIENT_STOPS * 5) < (1 << GSK_GL_UNIFORM_ARRAY_BITS));
|
||||
|
||||
#define rounded_rect_top_left(r) \
|
||||
(GRAPHENE_RECT_INIT(r->bounds.origin.x, \
|
||||
r->bounds.origin.y, \
|
||||
r->corner[0].width, r->corner[0].height))
|
||||
#define rounded_rect_top_right(r) \
|
||||
(GRAPHENE_RECT_INIT(r->bounds.origin.x + r->bounds.size.width - r->corner[1].width, \
|
||||
r->bounds.origin.y, \
|
||||
r->corner[1].width, r->corner[1].height))
|
||||
#define rounded_rect_bottom_right(r) \
|
||||
(GRAPHENE_RECT_INIT(r->bounds.origin.x + r->bounds.size.width - r->corner[2].width, \
|
||||
r->bounds.origin.y + r->bounds.size.height - r->corner[2].height, \
|
||||
r->corner[2].width, r->corner[2].height))
|
||||
#define rounded_rect_bottom_left(r) \
|
||||
(GRAPHENE_RECT_INIT(r->bounds.origin.x, \
|
||||
r->bounds.origin.y + r->bounds.size.height - r->corner[2].height, \
|
||||
r->corner[3].width, r->corner[3].height))
|
||||
#define rounded_rect_corner0(r) rounded_rect_top_left(r)
|
||||
#define rounded_rect_corner1(r) rounded_rect_top_right(r)
|
||||
#define rounded_rect_corner2(r) rounded_rect_bottom_right(r)
|
||||
#define rounded_rect_corner3(r) rounded_rect_bottom_left(r)
|
||||
#define rounded_rect_corner(r, i) (rounded_rect_corner##i(r))
|
||||
#define ALPHA_IS_CLEAR(alpha) ((alpha) < ((float) 0x00ff / (float) 0xffff))
|
||||
#define RGBA_IS_CLEAR(rgba) ALPHA_IS_CLEAR((rgba)->alpha)
|
||||
|
||||
@@ -429,70 +408,6 @@ rect_intersects (const graphene_rect_t *r1,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
rounded_rect_has_corner (const GskRoundedRect *r,
|
||||
guint i)
|
||||
{
|
||||
return r->corner[i].width > 0 && r->corner[i].height > 0;
|
||||
}
|
||||
|
||||
/* Current clip is NOT rounded but new one is definitely! */
|
||||
static inline gboolean
|
||||
intersect_rounded_rectilinear (const graphene_rect_t *non_rounded,
|
||||
const GskRoundedRect *rounded,
|
||||
GskRoundedRect *result)
|
||||
{
|
||||
gboolean corners[4];
|
||||
|
||||
/* Intersects with top left corner? */
|
||||
corners[0] = rounded_rect_has_corner (rounded, 0) &&
|
||||
rect_intersects (non_rounded,
|
||||
&rounded_rect_corner (rounded, 0));
|
||||
if (corners[0] && !rect_contains_rect (non_rounded,
|
||||
&rounded_rect_corner (rounded, 0)))
|
||||
return FALSE;
|
||||
|
||||
/* top right ? */
|
||||
corners[1] = rounded_rect_has_corner (rounded, 1) &&
|
||||
rect_intersects (non_rounded,
|
||||
&rounded_rect_corner (rounded, 1));
|
||||
if (corners[1] && !rect_contains_rect (non_rounded,
|
||||
&rounded_rect_corner (rounded, 1)))
|
||||
return FALSE;
|
||||
|
||||
/* bottom right ? */
|
||||
corners[2] = rounded_rect_has_corner (rounded, 2) &&
|
||||
rect_intersects (non_rounded,
|
||||
&rounded_rect_corner (rounded, 2));
|
||||
if (corners[2] && !rect_contains_rect (non_rounded,
|
||||
&rounded_rect_corner (rounded, 2)))
|
||||
return FALSE;
|
||||
|
||||
/* bottom left ? */
|
||||
corners[3] = rounded_rect_has_corner (rounded, 3) &&
|
||||
rect_intersects (non_rounded,
|
||||
&rounded_rect_corner (rounded, 3));
|
||||
if (corners[3] && !rect_contains_rect (non_rounded,
|
||||
&rounded_rect_corner (rounded, 3)))
|
||||
return FALSE;
|
||||
|
||||
/* We do intersect with at least one of the corners, but in such a way that the
|
||||
* intersection between the two clips can still be represented by a single rounded
|
||||
* rect in a trivial way. do that.
|
||||
*/
|
||||
graphene_rect_intersection (non_rounded, &rounded->bounds, &result->bounds);
|
||||
|
||||
for (guint i = 0; i < 4; i++)
|
||||
{
|
||||
if (corners[i])
|
||||
result->corner[i] = rounded->corner[i];
|
||||
else
|
||||
result->corner[i].width = result->corner[i].height = 0;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static inline void
|
||||
init_projection_matrix (graphene_matrix_t *projection,
|
||||
const graphene_rect_t *viewport)
|
||||
@@ -551,13 +466,14 @@ extract_matrix_metadata (GskGLRenderModelview *modelview)
|
||||
|
||||
case GSK_TRANSFORM_CATEGORY_2D:
|
||||
{
|
||||
float xx, xy, yx, yy, dx, dy;
|
||||
float skew_x, skew_y, angle, dx, dy;
|
||||
|
||||
gsk_transform_to_2d (modelview->transform,
|
||||
&xx, &xy, &yx, &yy, &dx, &dy);
|
||||
|
||||
modelview->scale_x = sqrtf (xx * xx + xy * xy);
|
||||
modelview->scale_y = sqrtf (yx * yx + yy * yy);
|
||||
gsk_transform_to_2d_components (modelview->transform,
|
||||
&skew_x, &skew_y,
|
||||
&modelview->scale_x, &modelview->scale_y,
|
||||
&angle, &dx, &dy);
|
||||
modelview->dx = 0;
|
||||
modelview->dy = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -918,10 +834,10 @@ gsk_gl_render_job_untransform_bounds (GskGLRenderJob *job,
|
||||
}
|
||||
|
||||
static inline void
|
||||
gsk_gl_render_job_transform_rounded_rect (GskGLRenderJob *job,
|
||||
gsk_gl_render_job_translate_rounded_rect (GskGLRenderJob *job,
|
||||
const GskRoundedRect *rect,
|
||||
GskRoundedRect *out_rect)
|
||||
{
|
||||
{
|
||||
out_rect->bounds.origin.x = job->offset_x + rect->bounds.origin.x;
|
||||
out_rect->bounds.origin.y = job->offset_y + rect->bounds.origin.y;
|
||||
out_rect->bounds.size.width = rect->bounds.size.width;
|
||||
@@ -929,6 +845,52 @@ gsk_gl_render_job_transform_rounded_rect (GskGLRenderJob *job,
|
||||
memcpy (out_rect->corner, rect->corner, sizeof rect->corner);
|
||||
}
|
||||
|
||||
static inline void
|
||||
rounded_rect_scale_corners (const GskRoundedRect *rect,
|
||||
GskRoundedRect *out_rect,
|
||||
float scale_x,
|
||||
float scale_y)
|
||||
{
|
||||
for (guint i = 0; i < G_N_ELEMENTS (out_rect->corner); i++)
|
||||
{
|
||||
out_rect->corner[i].width = rect->corner[i].width * fabs (scale_x);
|
||||
out_rect->corner[i].height = rect->corner[i].height * fabs (scale_y);
|
||||
}
|
||||
|
||||
if (scale_x < 0)
|
||||
{
|
||||
graphene_size_t p;
|
||||
|
||||
p = out_rect->corner[GSK_CORNER_TOP_LEFT];
|
||||
out_rect->corner[GSK_CORNER_TOP_LEFT] = out_rect->corner[GSK_CORNER_TOP_RIGHT];
|
||||
out_rect->corner[GSK_CORNER_TOP_RIGHT] = p;
|
||||
p = out_rect->corner[GSK_CORNER_BOTTOM_LEFT];
|
||||
out_rect->corner[GSK_CORNER_BOTTOM_LEFT] = out_rect->corner[GSK_CORNER_BOTTOM_RIGHT];
|
||||
out_rect->corner[GSK_CORNER_BOTTOM_RIGHT] = p;
|
||||
}
|
||||
|
||||
if (scale_y < 0)
|
||||
{
|
||||
graphene_size_t p;
|
||||
|
||||
p = out_rect->corner[GSK_CORNER_TOP_LEFT];
|
||||
out_rect->corner[GSK_CORNER_TOP_LEFT] = out_rect->corner[GSK_CORNER_BOTTOM_LEFT];
|
||||
out_rect->corner[GSK_CORNER_BOTTOM_LEFT] = p;
|
||||
p = out_rect->corner[GSK_CORNER_TOP_RIGHT];
|
||||
out_rect->corner[GSK_CORNER_TOP_RIGHT] = out_rect->corner[GSK_CORNER_BOTTOM_RIGHT];
|
||||
out_rect->corner[GSK_CORNER_BOTTOM_RIGHT] = p;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
gsk_gl_render_job_transform_rounded_rect (GskGLRenderJob *job,
|
||||
const GskRoundedRect *rect,
|
||||
GskRoundedRect *out_rect)
|
||||
{
|
||||
gsk_gl_render_job_transform_bounds (job, &rect->bounds, &out_rect->bounds);
|
||||
rounded_rect_scale_corners (rect, out_rect, job->scale_x, job->scale_y);
|
||||
}
|
||||
|
||||
static inline void
|
||||
rounded_rect_get_inner (const GskRoundedRect *rect,
|
||||
graphene_rect_t *inner)
|
||||
@@ -1231,13 +1193,12 @@ gsk_gl_render_job_visit_as_fallback (GskGLRenderJob *job,
|
||||
{
|
||||
float scale_x = job->scale_x;
|
||||
float scale_y = job->scale_y;
|
||||
int surface_width = ceilf (node->bounds.size.width * scale_x);
|
||||
int surface_height = ceilf (node->bounds.size.height * scale_y);
|
||||
int surface_width = ceilf (node->bounds.size.width * fabs (scale_x));
|
||||
int surface_height = ceilf (node->bounds.size.height * fabs (scale_y));
|
||||
GdkTexture *texture;
|
||||
cairo_surface_t *surface;
|
||||
cairo_surface_t *rendered_surface;
|
||||
cairo_t *cr;
|
||||
int cached_id;
|
||||
int texture_id;
|
||||
GskTextureKey key;
|
||||
|
||||
@@ -1249,18 +1210,10 @@ gsk_gl_render_job_visit_as_fallback (GskGLRenderJob *job,
|
||||
key.scale_x = scale_x;
|
||||
key.scale_y = scale_y;
|
||||
|
||||
cached_id = gsk_gl_driver_lookup_texture (job->driver, &key);
|
||||
texture_id = gsk_gl_driver_lookup_texture (job->driver, &key);
|
||||
|
||||
if (cached_id != 0)
|
||||
{
|
||||
gsk_gl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blit));
|
||||
gsk_gl_program_set_uniform_texture (job->current_program,
|
||||
UNIFORM_SHARED_SOURCE, 0,
|
||||
GL_TEXTURE_2D, GL_TEXTURE0, cached_id);
|
||||
gsk_gl_render_job_draw_offscreen_rect (job, &node->bounds);
|
||||
gsk_gl_render_job_end_draw (job);
|
||||
return;
|
||||
}
|
||||
if (texture_id != 0)
|
||||
goto done;
|
||||
|
||||
/* We first draw the recording surface on an image surface,
|
||||
* just because the scaleY(-1) later otherwise screws up the
|
||||
@@ -1270,7 +1223,7 @@ gsk_gl_render_job_visit_as_fallback (GskGLRenderJob *job,
|
||||
surface_width,
|
||||
surface_height);
|
||||
|
||||
cairo_surface_set_device_scale (rendered_surface, scale_x, scale_y);
|
||||
cairo_surface_set_device_scale (rendered_surface, fabs (scale_x), fabs (scale_y));
|
||||
cr = cairo_create (rendered_surface);
|
||||
|
||||
cairo_save (cr);
|
||||
@@ -1284,15 +1237,16 @@ gsk_gl_render_job_visit_as_fallback (GskGLRenderJob *job,
|
||||
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
|
||||
surface_width,
|
||||
surface_height);
|
||||
cairo_surface_set_device_scale (surface, scale_x, scale_y);
|
||||
cairo_surface_set_device_scale (surface, fabs (scale_x), fabs (scale_y));
|
||||
cr = cairo_create (surface);
|
||||
|
||||
/* We draw upside down here, so it matches what GL does. */
|
||||
cairo_save (cr);
|
||||
cairo_scale (cr, 1, -1);
|
||||
cairo_translate (cr, 0, - surface_height / scale_y);
|
||||
cairo_scale (cr, scale_x < 0 ? -1 : 1, scale_y < 0 ? 1 : -1);
|
||||
cairo_translate (cr, scale_x < 0 ? - surface_width / fabs (scale_x) : 0,
|
||||
scale_y < 0 ? 0 : - surface_height / fabs (scale_y));
|
||||
cairo_set_source_surface (cr, rendered_surface, 0, 0);
|
||||
cairo_rectangle (cr, 0, 0, surface_width / scale_x, surface_height / scale_y);
|
||||
cairo_rectangle (cr, 0, 0, surface_width / fabs (scale_x), surface_height / fabs (scale_y));
|
||||
cairo_fill (cr);
|
||||
cairo_restore (cr);
|
||||
|
||||
@@ -1331,6 +1285,16 @@ gsk_gl_render_job_visit_as_fallback (GskGLRenderJob *job,
|
||||
|
||||
gsk_gl_driver_cache_texture (job->driver, &key, texture_id);
|
||||
|
||||
done:
|
||||
if (scale_x < 0 || scale_y < 0)
|
||||
{
|
||||
GskTransform *transform = gsk_transform_translate (NULL,
|
||||
&GRAPHENE_POINT_INIT (scale_x < 0 ? - surface_width : 0,
|
||||
scale_y < 0 ? - surface_height : 0));
|
||||
gsk_gl_render_job_push_modelview (job, transform);
|
||||
gsk_transform_unref (transform);
|
||||
}
|
||||
|
||||
gsk_gl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blit));
|
||||
gsk_gl_program_set_uniform_texture (job->current_program,
|
||||
UNIFORM_SHARED_SOURCE, 0,
|
||||
@@ -1339,6 +1303,9 @@ gsk_gl_render_job_visit_as_fallback (GskGLRenderJob *job,
|
||||
texture_id);
|
||||
gsk_gl_render_job_draw_offscreen_rect (job, &node->bounds);
|
||||
gsk_gl_render_job_end_draw (job);
|
||||
|
||||
if (scale_x < 0 || scale_y < 0)
|
||||
gsk_gl_render_job_pop_modelview (job);
|
||||
}
|
||||
|
||||
static guint
|
||||
@@ -1493,10 +1460,10 @@ blur_node (GskGLRenderJob *job,
|
||||
|
||||
offscreen->texture_id = blur_offscreen (job,
|
||||
offscreen,
|
||||
texture_width * scale_x,
|
||||
texture_height * scale_y,
|
||||
blur_radius * scale_x,
|
||||
blur_radius * scale_y);
|
||||
texture_width * fabs (scale_x),
|
||||
texture_height * fabs (scale_y),
|
||||
blur_radius * fabs (scale_x),
|
||||
blur_radius * fabs (scale_y));
|
||||
init_full_texture_region (offscreen);
|
||||
}
|
||||
|
||||
@@ -1678,6 +1645,7 @@ gsk_gl_render_job_visit_clipped_child (GskGLRenderJob *job,
|
||||
{
|
||||
graphene_rect_t transformed_clip;
|
||||
GskRoundedRect intersection;
|
||||
GskRoundedRectIntersection result;
|
||||
|
||||
gsk_gl_render_job_transform_bounds (job, clip, &transformed_clip);
|
||||
|
||||
@@ -1691,10 +1659,17 @@ gsk_gl_render_job_visit_clipped_child (GskGLRenderJob *job,
|
||||
gsk_gl_render_job_push_clip (job, &intersection);
|
||||
gsk_gl_render_job_visit_node (job, child);
|
||||
gsk_gl_render_job_pop_clip (job);
|
||||
return;
|
||||
}
|
||||
else if (intersect_rounded_rectilinear (&transformed_clip,
|
||||
&job->current_clip->rect,
|
||||
&intersection))
|
||||
|
||||
result = gsk_rounded_rect_intersect_with_rect (&job->current_clip->rect,
|
||||
&transformed_clip,
|
||||
&intersection);
|
||||
|
||||
if (result == GSK_INTERSECTION_EMPTY)
|
||||
return;
|
||||
|
||||
if (result == GSK_INTERSECTION_NONEMPTY)
|
||||
{
|
||||
gsk_gl_render_job_push_clip (job, &intersection);
|
||||
gsk_gl_render_job_visit_node (job, child);
|
||||
@@ -1741,28 +1716,26 @@ gsk_gl_render_job_visit_rounded_clip_node (GskGLRenderJob *job,
|
||||
const GskRenderNode *child = gsk_rounded_clip_node_get_child (node);
|
||||
const GskRoundedRect *clip = gsk_rounded_clip_node_get_clip (node);
|
||||
GskRoundedRect transformed_clip;
|
||||
float scale_x = job->scale_x;
|
||||
float scale_y = job->scale_y;
|
||||
gboolean need_offscreen;
|
||||
|
||||
if (node_is_invisible (child))
|
||||
return;
|
||||
|
||||
gsk_gl_render_job_transform_bounds (job, &clip->bounds, &transformed_clip.bounds);
|
||||
|
||||
for (guint i = 0; i < G_N_ELEMENTS (transformed_clip.corner); i++)
|
||||
{
|
||||
transformed_clip.corner[i].width = clip->corner[i].width * scale_x;
|
||||
transformed_clip.corner[i].height = clip->corner[i].height * scale_y;
|
||||
}
|
||||
gsk_gl_render_job_transform_rounded_rect (job, clip, &transformed_clip);
|
||||
|
||||
if (job->current_clip->is_rectilinear)
|
||||
{
|
||||
GskRoundedRect intersected_clip;
|
||||
GskRoundedRectIntersection result;
|
||||
|
||||
if (intersect_rounded_rectilinear (&job->current_clip->rect.bounds,
|
||||
&transformed_clip,
|
||||
&intersected_clip))
|
||||
result = gsk_rounded_rect_intersect_with_rect (&transformed_clip,
|
||||
&job->current_clip->rect.bounds,
|
||||
&intersected_clip);
|
||||
|
||||
if (result == GSK_INTERSECTION_EMPTY)
|
||||
return;
|
||||
|
||||
if (result == GSK_INTERSECTION_NONEMPTY)
|
||||
{
|
||||
gsk_gl_render_job_push_clip (job, &intersected_clip);
|
||||
gsk_gl_render_job_visit_node (job, child);
|
||||
@@ -1777,22 +1750,13 @@ gsk_gl_render_job_visit_rounded_clip_node (GskGLRenderJob *job,
|
||||
|
||||
if (job->clip->len <= 1)
|
||||
need_offscreen = FALSE;
|
||||
else if (rounded_inner_rect_contains_rect (&job->current_clip->rect, &transformed_clip.bounds))
|
||||
else if (gsk_rounded_rect_contains_rect (&job->current_clip->rect, &transformed_clip.bounds))
|
||||
need_offscreen = FALSE;
|
||||
else
|
||||
need_offscreen = TRUE;
|
||||
|
||||
if (!need_offscreen)
|
||||
{
|
||||
/* If the new clip entirely contains the current clip, the intersection is simply
|
||||
* the current clip, so we can ignore the new one.
|
||||
*/
|
||||
if (rounded_inner_rect_contains_rect (&transformed_clip, &job->current_clip->rect.bounds))
|
||||
{
|
||||
gsk_gl_render_job_visit_node (job, child);
|
||||
return;
|
||||
}
|
||||
|
||||
gsk_gl_render_job_push_clip (job, &transformed_clip);
|
||||
gsk_gl_render_job_visit_node (job, child);
|
||||
gsk_gl_render_job_pop_clip (job);
|
||||
@@ -1914,7 +1878,7 @@ gsk_gl_render_job_visit_border_node (GskGLRenderJob *job,
|
||||
sizes[3].w = MAX (widths[3], rounded_outline->corner[3].width);
|
||||
}
|
||||
|
||||
gsk_gl_render_job_transform_rounded_rect (job, rounded_outline, &outline);
|
||||
gsk_gl_render_job_translate_rounded_rect (job, rounded_outline, &outline);
|
||||
|
||||
gsk_gl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, border));
|
||||
|
||||
@@ -2018,7 +1982,7 @@ gsk_gl_render_job_visit_css_background (GskGLRenderJob *job,
|
||||
rgba_to_half (&gsk_border_node_get_colors (node2)[0], color);
|
||||
rgba_to_half (gsk_color_node_get_color (child), color2);
|
||||
|
||||
gsk_gl_render_job_transform_rounded_rect (job, rounded_outline, &outline);
|
||||
gsk_gl_render_job_translate_rounded_rect (job, rounded_outline, &outline);
|
||||
|
||||
gsk_gl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, filled_border));
|
||||
|
||||
@@ -2159,6 +2123,7 @@ gsk_gl_render_job_visit_transform_node (GskGLRenderJob *job,
|
||||
scale = gsk_transform_translate (gsk_transform_scale (NULL, sx, sy), &GRAPHENE_POINT_INIT (tx, ty));
|
||||
gsk_gl_render_job_push_modelview (job, scale);
|
||||
transform = gsk_transform_transform (gsk_transform_invert (scale), transform);
|
||||
gsk_transform_unref (scale);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2209,7 +2174,7 @@ gsk_gl_render_job_visit_unblurred_inset_shadow_node (GskGLRenderJob *job,
|
||||
GskRoundedRect transformed_outline;
|
||||
guint16 color[4];
|
||||
|
||||
gsk_gl_render_job_transform_rounded_rect (job, outline, &transformed_outline);
|
||||
gsk_gl_render_job_translate_rounded_rect (job, outline, &transformed_outline);
|
||||
|
||||
gsk_gl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, inset_shadow));
|
||||
gsk_gl_program_set_uniform_rounded_rect (job->current_program,
|
||||
@@ -2309,7 +2274,7 @@ gsk_gl_render_job_visit_blurred_inset_shadow_node (GskGLRenderJob *job,
|
||||
prev_fbo = gsk_gl_command_queue_bind_framebuffer (job->command_queue, render_target->framebuffer_id);
|
||||
gsk_gl_command_queue_clear (job->command_queue, 0, &job->viewport);
|
||||
|
||||
gsk_gl_render_job_transform_rounded_rect (job, &outline_to_blur, &transformed_outline);
|
||||
gsk_gl_render_job_translate_rounded_rect (job, &outline_to_blur, &transformed_outline);
|
||||
|
||||
/* Actual inset shadow outline drawing */
|
||||
gsk_gl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, inset_shadow));
|
||||
@@ -2342,8 +2307,8 @@ gsk_gl_render_job_visit_blurred_inset_shadow_node (GskGLRenderJob *job,
|
||||
&offscreen,
|
||||
texture_width,
|
||||
texture_height,
|
||||
blur_radius * scale_x,
|
||||
blur_radius * scale_y);
|
||||
blur_radius * fabs (scale_x),
|
||||
blur_radius * fabs (scale_y));
|
||||
|
||||
gsk_gl_driver_release_render_target (job->driver, render_target, TRUE);
|
||||
|
||||
@@ -2365,14 +2330,7 @@ gsk_gl_render_job_visit_blurred_inset_shadow_node (GskGLRenderJob *job,
|
||||
{
|
||||
GskRoundedRect node_clip;
|
||||
|
||||
gsk_gl_render_job_transform_bounds (job, &node_outline->bounds, &node_clip.bounds);
|
||||
|
||||
for (guint i = 0; i < 4; i ++)
|
||||
{
|
||||
node_clip.corner[i].width = node_outline->corner[i].width * scale_x;
|
||||
node_clip.corner[i].height = node_outline->corner[i].height * scale_y;
|
||||
}
|
||||
|
||||
gsk_gl_render_job_translate_rounded_rect (job, node_outline, &node_clip);
|
||||
gsk_gl_render_job_push_clip (job, &node_clip);
|
||||
}
|
||||
|
||||
@@ -2422,7 +2380,7 @@ gsk_gl_render_job_visit_unblurred_outset_shadow_node (GskGLRenderJob *job,
|
||||
|
||||
rgba_to_half (gsk_outset_shadow_node_get_color (node), color);
|
||||
|
||||
gsk_gl_render_job_transform_rounded_rect (job, outline, &transformed_outline);
|
||||
gsk_gl_render_job_translate_rounded_rect (job, outline, &transformed_outline);
|
||||
|
||||
gsk_gl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, unblurred_outset_shadow));
|
||||
gsk_gl_program_set_uniform_rounded_rect (job->current_program,
|
||||
@@ -2615,8 +2573,8 @@ gsk_gl_render_job_visit_blurred_outset_shadow_node (GskGLRenderJob *job,
|
||||
&offscreen,
|
||||
texture_width,
|
||||
texture_height,
|
||||
blur_radius * scale_x,
|
||||
blur_radius * scale_y);
|
||||
blur_radius * fabs (scale_x),
|
||||
blur_radius * fabs (scale_y));
|
||||
|
||||
gsk_gl_shadow_library_insert (job->driver->shadows_library,
|
||||
&scaled_outline,
|
||||
@@ -2630,7 +2588,7 @@ gsk_gl_render_job_visit_blurred_outset_shadow_node (GskGLRenderJob *job,
|
||||
blurred_texture_id = cached_tid;
|
||||
}
|
||||
|
||||
gsk_gl_render_job_transform_rounded_rect (job, outline, &transformed_outline);
|
||||
gsk_gl_render_job_translate_rounded_rect (job, outline, &transformed_outline);
|
||||
|
||||
if (!do_slicing)
|
||||
{
|
||||
@@ -2866,8 +2824,12 @@ gsk_gl_render_job_visit_cross_fade_node (GskGLRenderJob *job,
|
||||
offscreen_end.reset_clip = TRUE;
|
||||
offscreen_end.bounds = &node->bounds;
|
||||
|
||||
gsk_gl_render_job_set_modelview (job, gsk_transform_scale (NULL, fabs (job->scale_x), fabs (job->scale_y)));
|
||||
|
||||
if (!gsk_gl_render_job_visit_node_with_offscreen (job, start_node, &offscreen_start))
|
||||
{
|
||||
gsk_gl_render_job_pop_modelview (job);
|
||||
|
||||
gsk_gl_render_job_visit_node (job, end_node);
|
||||
return;
|
||||
}
|
||||
@@ -2876,12 +2838,18 @@ gsk_gl_render_job_visit_cross_fade_node (GskGLRenderJob *job,
|
||||
|
||||
if (!gsk_gl_render_job_visit_node_with_offscreen (job, end_node, &offscreen_end))
|
||||
{
|
||||
float prev_alpha = gsk_gl_render_job_set_alpha (job, job->alpha * progress);
|
||||
float prev_alpha;
|
||||
|
||||
gsk_gl_render_job_pop_modelview (job);
|
||||
|
||||
prev_alpha = gsk_gl_render_job_set_alpha (job, job->alpha * progress);
|
||||
gsk_gl_render_job_visit_node (job, start_node);
|
||||
gsk_gl_render_job_set_alpha (job, prev_alpha);
|
||||
return;
|
||||
}
|
||||
|
||||
gsk_gl_render_job_pop_modelview (job);
|
||||
|
||||
g_assert (offscreen_end.texture_id);
|
||||
|
||||
gsk_gl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, cross_fade));
|
||||
@@ -3275,10 +3243,14 @@ gsk_gl_render_job_visit_blend_node (GskGLRenderJob *job,
|
||||
bottom_offscreen.force_offscreen = TRUE;
|
||||
bottom_offscreen.reset_clip = TRUE;
|
||||
|
||||
gsk_gl_render_job_set_modelview (job, gsk_transform_scale (NULL, fabs (job->scale_x), fabs (job->scale_y)));
|
||||
|
||||
/* TODO: We create 2 textures here as big as the blend node, but both the
|
||||
* start and the end node might be a lot smaller than that. */
|
||||
if (!gsk_gl_render_job_visit_node_with_offscreen (job, bottom_child, &bottom_offscreen))
|
||||
{
|
||||
gsk_gl_render_job_pop_modelview (job);
|
||||
|
||||
gsk_gl_render_job_visit_node (job, top_child);
|
||||
return;
|
||||
}
|
||||
@@ -3287,6 +3259,8 @@ gsk_gl_render_job_visit_blend_node (GskGLRenderJob *job,
|
||||
|
||||
if (!gsk_gl_render_job_visit_node_with_offscreen (job, top_child, &top_offscreen))
|
||||
{
|
||||
gsk_gl_render_job_pop_modelview (job);
|
||||
|
||||
gsk_gl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blit));
|
||||
gsk_gl_program_set_uniform_texture (job->current_program,
|
||||
UNIFORM_SHARED_SOURCE, 0,
|
||||
@@ -3300,6 +3274,8 @@ gsk_gl_render_job_visit_blend_node (GskGLRenderJob *job,
|
||||
|
||||
g_assert (top_offscreen.was_offscreen);
|
||||
|
||||
gsk_gl_render_job_pop_modelview (job);
|
||||
|
||||
gsk_gl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blend));
|
||||
gsk_gl_program_set_uniform_texture (job->current_program,
|
||||
UNIFORM_SHARED_SOURCE, 0,
|
||||
@@ -3336,11 +3312,14 @@ gsk_gl_render_job_visit_mask_node (GskGLRenderJob *job,
|
||||
mask_offscreen.reset_clip = TRUE;
|
||||
mask_offscreen.do_not_cache = TRUE;
|
||||
|
||||
gsk_gl_render_job_set_modelview (job, gsk_transform_scale (NULL, fabs (job->scale_x), fabs (job->scale_y)));
|
||||
|
||||
/* TODO: We create 2 textures here as big as the mask node, but both
|
||||
* nodes might be a lot smaller than that.
|
||||
*/
|
||||
if (!gsk_gl_render_job_visit_node_with_offscreen (job, source, &source_offscreen))
|
||||
{
|
||||
gsk_gl_render_job_pop_modelview (job);
|
||||
gsk_gl_render_job_visit_node (job, source);
|
||||
return;
|
||||
}
|
||||
@@ -3349,11 +3328,14 @@ gsk_gl_render_job_visit_mask_node (GskGLRenderJob *job,
|
||||
|
||||
if (!gsk_gl_render_job_visit_node_with_offscreen (job, mask, &mask_offscreen))
|
||||
{
|
||||
gsk_gl_render_job_pop_modelview (job);
|
||||
return;
|
||||
}
|
||||
|
||||
g_assert (mask_offscreen.was_offscreen);
|
||||
|
||||
gsk_gl_render_job_pop_modelview (job);
|
||||
|
||||
gsk_gl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, mask));
|
||||
gsk_gl_program_set_uniform_texture (job->current_program,
|
||||
UNIFORM_SHARED_SOURCE, 0,
|
||||
@@ -3587,8 +3569,8 @@ gsk_gl_render_job_visit_texture (GskGLRenderJob *job,
|
||||
float scale_y = bounds->size.height / texture->height;
|
||||
gboolean use_mipmap;
|
||||
|
||||
use_mipmap = (scale_x * job->scale_x) < 0.5 ||
|
||||
(scale_y * job->scale_y) < 0.5;
|
||||
use_mipmap = (scale_x * fabs (job->scale_x)) < 0.5 ||
|
||||
(scale_y * fabs (job->scale_y)) < 0.5;
|
||||
|
||||
if G_LIKELY (texture->width <= max_texture_size &&
|
||||
texture->height <= max_texture_size)
|
||||
@@ -4120,7 +4102,7 @@ gsk_gl_render_job_visit_node_with_offscreen (GskGLRenderJob *job,
|
||||
}
|
||||
|
||||
if (gsk_render_node_get_node_type (node) == GSK_TEXTURE_NODE &&
|
||||
offscreen->force_offscreen == FALSE)
|
||||
!offscreen->force_offscreen)
|
||||
{
|
||||
GdkTexture *texture = gsk_texture_node_get_texture (node);
|
||||
gsk_gl_render_job_upload_texture (job, texture, FALSE, offscreen);
|
||||
@@ -4138,6 +4120,7 @@ gsk_gl_render_job_visit_node_with_offscreen (GskGLRenderJob *job,
|
||||
gboolean flipped_x = job->scale_x < 0;
|
||||
gboolean flipped_y = job->scale_y < 0;
|
||||
graphene_rect_t viewport;
|
||||
gboolean reset_clip = FALSE;
|
||||
|
||||
if (flipped_x || flipped_y)
|
||||
{
|
||||
@@ -4145,6 +4128,7 @@ gsk_gl_render_job_visit_node_with_offscreen (GskGLRenderJob *job,
|
||||
flipped_x ? -1 : 1,
|
||||
flipped_y ? -1 : 1);
|
||||
gsk_gl_render_job_push_modelview (job, transform);
|
||||
gsk_transform_unref (transform);
|
||||
}
|
||||
|
||||
gsk_gl_render_job_transform_bounds (job, offscreen->bounds, &viewport);
|
||||
@@ -4182,7 +4166,9 @@ gsk_gl_render_job_visit_node_with_offscreen (GskGLRenderJob *job,
|
||||
{
|
||||
GskTransform *transform = gsk_transform_scale (NULL, downscale_x, downscale_y);
|
||||
gsk_gl_render_job_push_modelview (job, transform);
|
||||
gsk_transform_unref (transform);
|
||||
gsk_gl_render_job_transform_bounds (job, offscreen->bounds, &viewport);
|
||||
graphene_rect_scale (&viewport, downscale_x, downscale_y, &viewport);
|
||||
}
|
||||
|
||||
if (downscale_x == 1)
|
||||
@@ -4266,11 +4252,25 @@ gsk_gl_render_job_visit_node_with_offscreen (GskGLRenderJob *job,
|
||||
gsk_gl_command_queue_clear (job->command_queue, 0, &job->viewport);
|
||||
|
||||
if (offscreen->reset_clip)
|
||||
gsk_gl_render_job_push_clip (job, &GSK_ROUNDED_RECT_INIT_FROM_RECT (job->viewport));
|
||||
{
|
||||
gsk_gl_render_job_push_clip (job, &GSK_ROUNDED_RECT_INIT_FROM_RECT (job->viewport));
|
||||
reset_clip = TRUE;
|
||||
}
|
||||
else if (flipped_x || flipped_y || downscale_x != 1 || downscale_y != 1)
|
||||
{
|
||||
GskRoundedRect new_clip;
|
||||
float scale_x = flipped_x ? - downscale_x : downscale_x;
|
||||
float scale_y = flipped_y ? - downscale_y : downscale_y;
|
||||
|
||||
graphene_rect_scale (&job->current_clip->rect.bounds, scale_x, scale_y, &new_clip.bounds);
|
||||
rounded_rect_scale_corners (&job->current_clip->rect, &new_clip, scale_x, scale_y);
|
||||
gsk_gl_render_job_push_clip (job, &new_clip);
|
||||
reset_clip = TRUE;
|
||||
}
|
||||
|
||||
gsk_gl_render_job_visit_node (job, node);
|
||||
|
||||
if (offscreen->reset_clip)
|
||||
if (reset_clip)
|
||||
gsk_gl_render_job_pop_clip (job);
|
||||
|
||||
if (downscale_x != 1 || downscale_y != 1)
|
||||
|
@@ -19,6 +19,9 @@ void main() {
|
||||
gsk_rounded_rect_transform(outside, u_modelview);
|
||||
gsk_rounded_rect_transform(inside, u_modelview);
|
||||
|
||||
gsk_rounded_rect_normalize(outside);
|
||||
gsk_rounded_rect_normalize(inside);
|
||||
|
||||
gsk_rounded_rect_encode(outside, transformed_outside_outline);
|
||||
gsk_rounded_rect_encode(inside, transformed_inside_outline);
|
||||
}
|
||||
@@ -34,10 +37,9 @@ _IN_ _GSK_ROUNDED_RECT_UNIFORM_ transformed_inside_outline;
|
||||
|
||||
void main() {
|
||||
vec2 frag = gsk_get_frag_coord();
|
||||
|
||||
float alpha = clamp(gsk_rounded_rect_coverage(gsk_decode_rect(transformed_outside_outline), frag) -
|
||||
gsk_rounded_rect_coverage(gsk_decode_rect(transformed_inside_outline), frag),
|
||||
0.0, 1.0);
|
||||
float outer_coverage = gsk_rounded_rect_coverage(gsk_decode_rect(transformed_outside_outline), frag);
|
||||
float inner_coverage = gsk_rounded_rect_coverage(gsk_decode_rect(transformed_inside_outline), frag);
|
||||
float alpha = clamp(outer_coverage - inner_coverage, 0.0, 1.0);
|
||||
|
||||
gskSetScaledOutputColor(final_color, alpha);
|
||||
}
|
||||
|
@@ -21,6 +21,9 @@ void main() {
|
||||
gsk_rounded_rect_transform(outside, u_modelview);
|
||||
gsk_rounded_rect_transform(inside, u_modelview);
|
||||
|
||||
gsk_rounded_rect_normalize(outside);
|
||||
gsk_rounded_rect_normalize(inside);
|
||||
|
||||
gsk_rounded_rect_encode(outside, transformed_outside_outline);
|
||||
gsk_rounded_rect_encode(inside, transformed_inside_outline);
|
||||
}
|
||||
|
@@ -22,6 +22,9 @@ void main() {
|
||||
gsk_rounded_rect_transform(outside, u_modelview);
|
||||
gsk_rounded_rect_transform(inside, u_modelview);
|
||||
|
||||
gsk_rounded_rect_normalize(outside);
|
||||
gsk_rounded_rect_normalize(inside);
|
||||
|
||||
gsk_rounded_rect_encode(outside, transformed_outside_outline);
|
||||
gsk_rounded_rect_encode(inside, transformed_inside_outline);
|
||||
}
|
||||
|
@@ -15,6 +15,7 @@ void main() {
|
||||
|
||||
GskRoundedRect outline = gsk_create_rect(u_outline_rect);
|
||||
gsk_rounded_rect_transform(outline, u_modelview);
|
||||
gsk_rounded_rect_normalize(outline);
|
||||
gsk_rounded_rect_encode(outline, transformed_outline);
|
||||
}
|
||||
|
||||
|
@@ -16,11 +16,15 @@ _IN_ vec2 vUv;
|
||||
|
||||
GskRoundedRect gsk_decode_rect(_GSK_ROUNDED_RECT_UNIFORM_ r)
|
||||
{
|
||||
GskRoundedRect rect;
|
||||
#if defined(GSK_GLES) || defined(GSK_LEGACY)
|
||||
return GskRoundedRect(r[0], r[1], r[2]);
|
||||
rect = GskRoundedRect(r[0], r[1], r[2]);
|
||||
#else
|
||||
return r;
|
||||
rect = r;
|
||||
#endif
|
||||
gsk_rounded_rect_normalize (rect);
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
float
|
||||
|
@@ -22,6 +22,55 @@ struct GskRoundedRect
|
||||
vec4 corner_points2; // xy = bottom right, zw = bottom left
|
||||
};
|
||||
|
||||
void gsk_rounded_rect_normalize(inout GskRoundedRect r)
|
||||
{
|
||||
if (r.bounds.x > r.bounds.z)
|
||||
{
|
||||
float t = r.bounds.x;
|
||||
r.bounds.x = r.bounds.z;
|
||||
r.bounds.z = t;
|
||||
|
||||
vec2 c = r.corner_points1.xy;
|
||||
r.corner_points1.xy = r.corner_points1.zw;
|
||||
r.corner_points1.zw = c;
|
||||
|
||||
c = r.corner_points2.xy;
|
||||
r.corner_points2.xy = r.corner_points2.zw;
|
||||
r.corner_points2.zw = c;
|
||||
}
|
||||
|
||||
if (r.bounds.y > r.bounds.w)
|
||||
{
|
||||
float t = r.bounds.y;
|
||||
r.bounds.y = r.bounds.w;
|
||||
r.bounds.w = t;
|
||||
|
||||
vec2 c = r.corner_points1.xy;
|
||||
r.corner_points1.xy = r.corner_points2.xy;
|
||||
r.corner_points2.xy = c;
|
||||
|
||||
c = r.corner_points1.zw;
|
||||
r.corner_points1.zw = r.corner_points2.zw;
|
||||
r.corner_points2.zw = c;
|
||||
}
|
||||
}
|
||||
|
||||
void gsk_bounds_normalize (inout vec4 bounds)
|
||||
{
|
||||
if (bounds.x > bounds.z)
|
||||
{
|
||||
float t = bounds.x;
|
||||
bounds.x = bounds.z;
|
||||
bounds.z = t;
|
||||
}
|
||||
if (bounds.y > bounds.w)
|
||||
{
|
||||
float t = bounds.y;
|
||||
bounds.y = bounds.w;
|
||||
bounds.w = t;
|
||||
}
|
||||
}
|
||||
|
||||
// Transform from a C GskRoundedRect to what we need.
|
||||
GskRoundedRect
|
||||
gsk_create_rect(vec4[3] data)
|
||||
@@ -33,13 +82,21 @@ gsk_create_rect(vec4[3] data)
|
||||
vec4 corner_points2 = vec4(bounds.zw + (data[2].xy * vec2(-1, -1)),
|
||||
bounds.xw + vec2(data[2].zw * vec2(1, -1)));
|
||||
|
||||
return GskRoundedRect(bounds, corner_points1, corner_points2);
|
||||
GskRoundedRect rect = GskRoundedRect(bounds, corner_points1, corner_points2);
|
||||
|
||||
gsk_rounded_rect_normalize (rect);
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
vec4
|
||||
gsk_get_bounds(vec4[3] data)
|
||||
{
|
||||
return vec4(data[0].xy, data[0].xy + data[0].zw);
|
||||
vec4 bounds = vec4(data[0].xy, data[0].xy + data[0].zw);
|
||||
|
||||
gsk_bounds_normalize (bounds);
|
||||
|
||||
return bounds;
|
||||
}
|
||||
|
||||
vec4 gsk_premultiply(vec4 c) {
|
||||
|
@@ -871,7 +871,7 @@ create_ascii_glyphs (PangoFont *font)
|
||||
if (!pango_coverage_get (coverage, i))
|
||||
break;
|
||||
}
|
||||
pango_coverage_unref (coverage);
|
||||
g_object_unref (coverage);
|
||||
if (i < MAX_ASCII_GLYPH)
|
||||
return NULL;
|
||||
|
||||
|
@@ -519,8 +519,174 @@ gsk_rounded_rect_intersects_rect (const GskRoundedRect *self,
|
||||
gsk_rounded_rect_locate_point (self, &GRAPHENE_POINT_INIT (rect->origin.x, rect->origin.y + rect->size.height)) == OUTSIDE_TOP_RIGHT ||
|
||||
gsk_rounded_rect_locate_point (self, &GRAPHENE_POINT_INIT (rect->origin.x + rect->size.width, rect->origin.y + rect->size.height)) == OUTSIDE_TOP_LEFT)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
#define rect_point0(r) ((r)->origin)
|
||||
#define rect_point1(r) (GRAPHENE_POINT_INIT ((r)->origin.x + (r)->size.width, (r)->origin.y))
|
||||
#define rect_point2(r) (GRAPHENE_POINT_INIT ((r)->origin.x + (r)->size.width, (r)->origin.y + (r)->size.height))
|
||||
#define rect_point3(r) (GRAPHENE_POINT_INIT ((r)->origin.x, (r)->origin.y + (r)->size.height))
|
||||
|
||||
#define rounded_rect_corner0(r) \
|
||||
(GRAPHENE_RECT_INIT((r)->bounds.origin.x, \
|
||||
(r)->bounds.origin.y, \
|
||||
(r)->corner[0].width, (r)->corner[0].height))
|
||||
#define rounded_rect_corner1(r) \
|
||||
(GRAPHENE_RECT_INIT((r)->bounds.origin.x + (r)->bounds.size.width - (r)->corner[1].width, \
|
||||
(r)->bounds.origin.y, \
|
||||
(r)->corner[1].width, (r)->corner[1].height))
|
||||
#define rounded_rect_corner2(r) \
|
||||
(GRAPHENE_RECT_INIT((r)->bounds.origin.x + (r)->bounds.size.width - (r)->corner[2].width, \
|
||||
(r)->bounds.origin.y + (r)->bounds.size.height - (r)->corner[2].height, \
|
||||
(r)->corner[2].width, (r)->corner[2].height))
|
||||
#define rounded_rect_corner3(r) \
|
||||
(GRAPHENE_RECT_INIT((r)->bounds.origin.x, \
|
||||
(r)->bounds.origin.y + (r)->bounds.size.height - (r)->corner[3].height, \
|
||||
(r)->corner[3].width, (r)->corner[3].height))
|
||||
|
||||
enum {
|
||||
BELOW,
|
||||
INNER,
|
||||
ABOVE
|
||||
};
|
||||
|
||||
static inline void
|
||||
classify_point (const graphene_point_t *p, const graphene_rect_t *rect, int *px, int *py)
|
||||
{
|
||||
if (p->x <= rect->origin.x)
|
||||
*px = BELOW;
|
||||
else if (p->x >= rect->origin.x + rect->size.width)
|
||||
*px = ABOVE;
|
||||
else
|
||||
*px = INNER;
|
||||
|
||||
if (p->y <= rect->origin.y)
|
||||
*py = BELOW;
|
||||
else if (p->y >= rect->origin.y + rect->size.height)
|
||||
*py = ABOVE;
|
||||
else
|
||||
*py = INNER;
|
||||
}
|
||||
|
||||
GskRoundedRectIntersection
|
||||
gsk_rounded_rect_intersect_with_rect (const GskRoundedRect *self,
|
||||
const graphene_rect_t *rect,
|
||||
GskRoundedRect *result)
|
||||
{
|
||||
int px, py, qx, qy;
|
||||
|
||||
if (!graphene_rect_intersection (&self->bounds, rect, &result->bounds))
|
||||
return GSK_INTERSECTION_EMPTY;
|
||||
|
||||
classify_point (&rect_point0 (rect), &rounded_rect_corner0 (self), &px, &py);
|
||||
|
||||
if (px == BELOW && py == BELOW)
|
||||
{
|
||||
classify_point (&rect_point2 (rect), &rounded_rect_corner0 (self), &qx, &qy);
|
||||
|
||||
if (qx == BELOW || qy == BELOW)
|
||||
return GSK_INTERSECTION_EMPTY;
|
||||
else if (qx == INNER && qy == INNER &&
|
||||
gsk_rounded_rect_locate_point (self, &rect_point2 (rect)) != INSIDE)
|
||||
return GSK_INTERSECTION_EMPTY;
|
||||
else if (qx == ABOVE && qy == ABOVE)
|
||||
result->corner[0] = self->corner[0];
|
||||
else
|
||||
return GSK_INTERSECTION_NOT_REPRESENTABLE;
|
||||
}
|
||||
else if ((px == INNER || py == INNER) &&
|
||||
gsk_rounded_rect_locate_point (self, &rect_point0 (rect)) != INSIDE)
|
||||
{
|
||||
if (gsk_rounded_rect_locate_point (self, &rect_point2 (rect)) == OUTSIDE_TOP_LEFT)
|
||||
return GSK_INTERSECTION_EMPTY;
|
||||
else
|
||||
return GSK_INTERSECTION_NOT_REPRESENTABLE;
|
||||
}
|
||||
else
|
||||
result->corner[0].width = result->corner[0].height = 0;
|
||||
|
||||
classify_point (&rect_point1 (rect), &rounded_rect_corner1 (self), &px, &py);
|
||||
|
||||
if (px == ABOVE && py == BELOW)
|
||||
{
|
||||
classify_point (&rect_point3 (rect), &rounded_rect_corner1 (self), &qx, &qy);
|
||||
|
||||
if (qx == ABOVE || qy == BELOW)
|
||||
return GSK_INTERSECTION_EMPTY;
|
||||
else if (qx == INNER && qy == INNER &&
|
||||
gsk_rounded_rect_locate_point (self, &rect_point3 (rect)) != INSIDE)
|
||||
return GSK_INTERSECTION_EMPTY;
|
||||
else if (qx == BELOW && qy == ABOVE)
|
||||
result->corner[1] = self->corner[1];
|
||||
else
|
||||
return GSK_INTERSECTION_NOT_REPRESENTABLE;
|
||||
}
|
||||
else if ((px == INNER || py == INNER) &&
|
||||
gsk_rounded_rect_locate_point (self, &rect_point1 (rect)) != INSIDE)
|
||||
{
|
||||
if (gsk_rounded_rect_locate_point (self, &rect_point3 (rect)) == OUTSIDE_TOP_RIGHT)
|
||||
return GSK_INTERSECTION_EMPTY;
|
||||
else
|
||||
return GSK_INTERSECTION_NOT_REPRESENTABLE;
|
||||
}
|
||||
else
|
||||
result->corner[1].width = result->corner[1].height = 0;
|
||||
|
||||
classify_point (&rect_point2 (rect), &rounded_rect_corner2 (self), &px, &py);
|
||||
|
||||
if (px == ABOVE && py == ABOVE)
|
||||
{
|
||||
classify_point (&rect_point0 (rect), &rounded_rect_corner2 (self), &qx, &qy);
|
||||
|
||||
if (qx == ABOVE || qy == ABOVE)
|
||||
return GSK_INTERSECTION_EMPTY;
|
||||
else if (qx == INNER && qy == INNER &&
|
||||
gsk_rounded_rect_locate_point (self, &rect_point0 (rect)) != INSIDE)
|
||||
return GSK_INTERSECTION_EMPTY;
|
||||
else if (qx == BELOW && qy == BELOW)
|
||||
result->corner[2] = self->corner[2];
|
||||
else
|
||||
return GSK_INTERSECTION_NOT_REPRESENTABLE;
|
||||
}
|
||||
else if ((px == INNER || py == INNER) &&
|
||||
gsk_rounded_rect_locate_point (self, &rect_point2 (rect)) != INSIDE)
|
||||
{
|
||||
if (gsk_rounded_rect_locate_point (self, &rect_point0 (rect)) == OUTSIDE_BOTTOM_RIGHT)
|
||||
return GSK_INTERSECTION_EMPTY;
|
||||
else
|
||||
return GSK_INTERSECTION_NOT_REPRESENTABLE;
|
||||
}
|
||||
else
|
||||
result->corner[2].width = result->corner[2].height = 0;
|
||||
|
||||
classify_point (&rect_point3 (rect), &rounded_rect_corner3 (self), &px, &py);
|
||||
|
||||
if (px == BELOW && py == ABOVE)
|
||||
{
|
||||
classify_point (&rect_point1 (rect), &rounded_rect_corner3 (self), &qx, &qy);
|
||||
|
||||
if (qx == BELOW || qy == ABOVE)
|
||||
return GSK_INTERSECTION_EMPTY;
|
||||
else if (qx == INNER && qy == INNER &&
|
||||
gsk_rounded_rect_locate_point (self, &rect_point1 (rect)) != INSIDE)
|
||||
return GSK_INTERSECTION_EMPTY;
|
||||
else if (qx == ABOVE && qy == BELOW)
|
||||
result->corner[3] = self->corner[3];
|
||||
else
|
||||
return GSK_INTERSECTION_NOT_REPRESENTABLE;
|
||||
}
|
||||
else if ((px == INNER || py == INNER) &&
|
||||
gsk_rounded_rect_locate_point (self, &rect_point3 (rect)) != INSIDE)
|
||||
{
|
||||
if (gsk_rounded_rect_locate_point (self, &rect_point1 (rect)) == OUTSIDE_BOTTOM_LEFT)
|
||||
return GSK_INTERSECTION_EMPTY;
|
||||
else
|
||||
return GSK_INTERSECTION_NOT_REPRESENTABLE;
|
||||
}
|
||||
else
|
||||
result->corner[3].width = result->corner[3].height = 0;
|
||||
|
||||
return GSK_INTERSECTION_NONEMPTY;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -565,7 +731,7 @@ gsk_rounded_rect_path (const GskRoundedRect *self,
|
||||
self->corner[GSK_CORNER_TOP_LEFT].width,
|
||||
self->corner[GSK_CORNER_TOP_LEFT].height,
|
||||
G_PI, 3 * G_PI_2);
|
||||
_cairo_ellipsis (cr,
|
||||
_cairo_ellipsis (cr,
|
||||
self->bounds.origin.x + self->bounds.size.width - self->corner[GSK_CORNER_TOP_RIGHT].width,
|
||||
self->bounds.origin.y + self->corner[GSK_CORNER_TOP_RIGHT].height,
|
||||
self->corner[GSK_CORNER_TOP_RIGHT].width,
|
||||
@@ -649,5 +815,4 @@ gsk_rounded_rect_to_string (const GskRoundedRect *self)
|
||||
self->corner[2].height,
|
||||
self->corner[3].width,
|
||||
self->corner[3].height);
|
||||
|
||||
}
|
||||
|
@@ -34,6 +34,16 @@ gboolean gsk_rounded_rect_equal (gconstpointer
|
||||
gconstpointer rect2) G_GNUC_PURE;
|
||||
char * gsk_rounded_rect_to_string (const GskRoundedRect *self) G_GNUC_MALLOC;
|
||||
|
||||
typedef enum {
|
||||
GSK_INTERSECTION_EMPTY,
|
||||
GSK_INTERSECTION_NONEMPTY,
|
||||
GSK_INTERSECTION_NOT_REPRESENTABLE
|
||||
} GskRoundedRectIntersection;
|
||||
|
||||
GskRoundedRectIntersection gsk_rounded_rect_intersect_with_rect (const GskRoundedRect *self,
|
||||
const graphene_rect_t *rect,
|
||||
GskRoundedRect *result) G_GNUC_PURE;
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -164,7 +164,7 @@ gskenum_h = gsk_enums[1]
|
||||
gskresources = gnome.compile_resources('gskresources',
|
||||
gsk_resources_xml,
|
||||
dependencies: gsk_private_vulkan_compiled_shaders_deps,
|
||||
source_dir: meson.current_source_dir(),
|
||||
source_dir: [meson.current_build_dir(), meson.current_source_dir()],
|
||||
c_name: '_gsk',
|
||||
extra_args: [ '--manual-register', ],
|
||||
)
|
||||
|
@@ -1012,9 +1012,8 @@ gsk_vulkan_render_pass_get_node_as_texture (GskVulkanRenderPass *self,
|
||||
GskVulkanRender *render,
|
||||
GskVulkanUploader *uploader,
|
||||
GskRenderNode *node,
|
||||
const graphene_rect_t *bounds,
|
||||
GskVulkanClip *current_clip,
|
||||
graphene_rect_t *tex_rect)
|
||||
graphene_rect_t *tex_bounds)
|
||||
{
|
||||
GskVulkanImage *result;
|
||||
cairo_surface_t *surface;
|
||||
@@ -1023,16 +1022,12 @@ gsk_vulkan_render_pass_get_node_as_texture (GskVulkanRenderPass *self,
|
||||
switch ((guint) gsk_render_node_get_node_type (node))
|
||||
{
|
||||
case GSK_TEXTURE_NODE:
|
||||
if (graphene_rect_equal (bounds, &node->bounds))
|
||||
{
|
||||
result = gsk_vulkan_renderer_ref_texture_image (GSK_VULKAN_RENDERER (gsk_vulkan_render_get_renderer (render)),
|
||||
gsk_texture_node_get_texture (node),
|
||||
uploader);
|
||||
gsk_vulkan_render_add_cleanup_image (render, result);
|
||||
*tex_rect = GRAPHENE_RECT_INIT(0, 0, 1, 1);
|
||||
return result;
|
||||
}
|
||||
break;
|
||||
result = gsk_vulkan_renderer_ref_texture_image (GSK_VULKAN_RENDERER (gsk_vulkan_render_get_renderer (render)),
|
||||
gsk_texture_node_get_texture (node),
|
||||
uploader);
|
||||
gsk_vulkan_render_add_cleanup_image (render, result);
|
||||
*tex_bounds = node->bounds;
|
||||
return result;
|
||||
|
||||
case GSK_CAIRO_NODE:
|
||||
/* We're using recording surfaces, so drawing them to an image
|
||||
@@ -1050,9 +1045,9 @@ gsk_vulkan_render_pass_get_node_as_texture (GskVulkanRenderPass *self,
|
||||
graphene_rect_t clipped;
|
||||
|
||||
if (current_clip)
|
||||
graphene_rect_intersection (¤t_clip->rect.bounds, bounds, &clipped);
|
||||
graphene_rect_intersection (¤t_clip->rect.bounds, &node->bounds, &clipped);
|
||||
else
|
||||
clipped = *bounds;
|
||||
clipped = node->bounds;
|
||||
|
||||
if (clipped.size.width == 0 || clipped.size.height == 0)
|
||||
return NULL;
|
||||
@@ -1111,33 +1106,30 @@ gsk_vulkan_render_pass_get_node_as_texture (GskVulkanRenderPass *self,
|
||||
/* assuming the unclipped bounds should go to texture coordinates 0..1,
|
||||
* calculate the coordinates for the clipped texture size
|
||||
*/
|
||||
tex_rect->origin.x = (bounds->origin.x - clipped.origin.x)/clipped.size.width;
|
||||
tex_rect->origin.y = (bounds->origin.y - clipped.origin.y)/clipped.size.height;
|
||||
tex_rect->size.width = bounds->size.width/clipped.size.width;
|
||||
tex_rect->size.height = bounds->size.height/clipped.size.height;
|
||||
*tex_bounds = clipped;
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
GSK_RENDERER_DEBUG (gsk_vulkan_render_get_renderer (render), FALLBACK, "Node as texture not implemented for this case. Using %gx%g fallback surface",
|
||||
ceil (bounds->size.width),
|
||||
ceil (bounds->size.height));
|
||||
ceil (node->bounds.size.width),
|
||||
ceil (node->bounds.size.height));
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
{
|
||||
GskProfiler *profiler = gsk_renderer_get_profiler (gsk_vulkan_render_get_renderer (render));
|
||||
gsk_profiler_counter_add (profiler,
|
||||
self->fallback_pixels,
|
||||
ceil (bounds->size.width) * ceil (bounds->size.height));
|
||||
ceil (node->bounds.size.width) * ceil (node->bounds.size.height));
|
||||
}
|
||||
#endif
|
||||
|
||||
/* XXX: We could intersect bounds with clip bounds here */
|
||||
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
|
||||
ceil (bounds->size.width),
|
||||
ceil (bounds->size.height));
|
||||
ceil (node->bounds.size.width),
|
||||
ceil (node->bounds.size.height));
|
||||
cr = cairo_create (surface);
|
||||
cairo_translate (cr, -bounds->origin.x, -bounds->origin.y);
|
||||
cairo_translate (cr, -node->bounds.origin.x, -node->bounds.origin.y);
|
||||
|
||||
gsk_render_node_draw (node, cr);
|
||||
|
||||
@@ -1153,10 +1145,7 @@ gsk_vulkan_render_pass_get_node_as_texture (GskVulkanRenderPass *self,
|
||||
|
||||
gsk_vulkan_render_add_cleanup_image (render, result);
|
||||
|
||||
tex_rect->origin.x = (node->bounds.origin.x - bounds->origin.x)/bounds->size.width;
|
||||
tex_rect->origin.y = (node->bounds.origin.y - bounds->origin.y)/bounds->size.height;
|
||||
tex_rect->size.width = node->bounds.size.width/bounds->size.width;
|
||||
tex_rect->size.height = node->bounds.size.height/bounds->size.height;
|
||||
*tex_bounds = node->bounds;
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -1250,6 +1239,18 @@ gsk_vulkan_render_pass_upload_fallback (GskVulkanRenderPass *self,
|
||||
gsk_vulkan_render_add_cleanup_image (render, op->source);
|
||||
}
|
||||
|
||||
static void
|
||||
get_tex_rect (graphene_rect_t *tex_coords,
|
||||
const graphene_rect_t *rect,
|
||||
const graphene_rect_t *tex)
|
||||
{
|
||||
graphene_rect_init (tex_coords,
|
||||
(rect->origin.x - tex->origin.x) / tex->size.width,
|
||||
(rect->origin.y - tex->origin.y) / tex->size.height,
|
||||
rect->size.width / tex->size.width,
|
||||
rect->size.height / tex->size.height);
|
||||
}
|
||||
|
||||
void
|
||||
gsk_vulkan_render_pass_upload (GskVulkanRenderPass *self,
|
||||
GskVulkanRender *render,
|
||||
@@ -1294,63 +1295,61 @@ gsk_vulkan_render_pass_upload (GskVulkanRenderPass *self,
|
||||
case GSK_VULKAN_OP_OPACITY:
|
||||
{
|
||||
GskRenderNode *child = gsk_opacity_node_get_child (op->render.node);
|
||||
graphene_rect_t tex_bounds;
|
||||
|
||||
op->render.source = gsk_vulkan_render_pass_get_node_as_texture (self,
|
||||
render,
|
||||
uploader,
|
||||
child,
|
||||
&child->bounds,
|
||||
clip,
|
||||
&op->render.source_rect);
|
||||
&tex_bounds);
|
||||
get_tex_rect (&op->render.source_rect, &op->render.node->bounds, &tex_bounds);
|
||||
}
|
||||
break;
|
||||
|
||||
case GSK_VULKAN_OP_REPEAT:
|
||||
{
|
||||
GskRenderNode *child = gsk_repeat_node_get_child (op->render.node);
|
||||
const graphene_rect_t *bounds = &op->render.node->bounds;
|
||||
const graphene_rect_t *child_bounds = gsk_repeat_node_get_child_bounds (op->render.node);
|
||||
graphene_rect_t tex_bounds;
|
||||
|
||||
op->render.source = gsk_vulkan_render_pass_get_node_as_texture (self,
|
||||
render,
|
||||
uploader,
|
||||
child,
|
||||
child_bounds,
|
||||
NULL,
|
||||
&op->render.source_rect);
|
||||
|
||||
op->render.source_rect.origin.x = (bounds->origin.x - child_bounds->origin.x)/child_bounds->size.width;
|
||||
op->render.source_rect.origin.y = (bounds->origin.y - child_bounds->origin.y)/child_bounds->size.height;
|
||||
op->render.source_rect.size.width = bounds->size.width / child_bounds->size.width;
|
||||
op->render.source_rect.size.height = bounds->size.height / child_bounds->size.height;
|
||||
&tex_bounds);
|
||||
get_tex_rect (&op->render.source_rect, child_bounds, &tex_bounds);
|
||||
}
|
||||
break;
|
||||
|
||||
case GSK_VULKAN_OP_BLUR:
|
||||
{
|
||||
GskRenderNode *child = gsk_blur_node_get_child (op->render.node);
|
||||
graphene_rect_t tex_bounds;
|
||||
|
||||
op->render.source = gsk_vulkan_render_pass_get_node_as_texture (self,
|
||||
render,
|
||||
uploader,
|
||||
child,
|
||||
&child->bounds,
|
||||
clip,
|
||||
&op->render.source_rect);
|
||||
&tex_bounds);
|
||||
get_tex_rect (&op->render.source_rect, &op->render.node->bounds, &tex_bounds);
|
||||
}
|
||||
break;
|
||||
|
||||
case GSK_VULKAN_OP_COLOR_MATRIX:
|
||||
{
|
||||
GskRenderNode *child = gsk_color_matrix_node_get_child (op->render.node);
|
||||
graphene_rect_t tex_bounds;
|
||||
|
||||
op->render.source = gsk_vulkan_render_pass_get_node_as_texture (self,
|
||||
render,
|
||||
uploader,
|
||||
child,
|
||||
&child->bounds,
|
||||
clip,
|
||||
&op->render.source_rect);
|
||||
&tex_bounds);
|
||||
get_tex_rect (&op->render.source_rect, &op->render.node->bounds, &tex_bounds);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1358,31 +1357,23 @@ gsk_vulkan_render_pass_upload (GskVulkanRenderPass *self,
|
||||
{
|
||||
GskRenderNode *start = gsk_cross_fade_node_get_start_child (op->render.node);
|
||||
GskRenderNode *end = gsk_cross_fade_node_get_end_child (op->render.node);
|
||||
const graphene_rect_t *bounds = &op->render.node->bounds;
|
||||
graphene_rect_t tex_bounds;
|
||||
|
||||
op->render.source = gsk_vulkan_render_pass_get_node_as_texture (self,
|
||||
render,
|
||||
uploader,
|
||||
start,
|
||||
&start->bounds,
|
||||
clip,
|
||||
&op->render.source_rect);
|
||||
op->render.source_rect.origin.x = (bounds->origin.x - start->bounds.origin.x)/start->bounds.size.width;
|
||||
op->render.source_rect.origin.y = (bounds->origin.y - start->bounds.origin.y)/start->bounds.size.height;
|
||||
op->render.source_rect.size.width = bounds->size.width / start->bounds.size.width;
|
||||
op->render.source_rect.size.height = bounds->size.height / start->bounds.size.height;
|
||||
&tex_bounds);
|
||||
get_tex_rect (&op->render.source_rect, &op->render.node->bounds, &tex_bounds);
|
||||
|
||||
op->render.source2 = gsk_vulkan_render_pass_get_node_as_texture (self,
|
||||
render,
|
||||
uploader,
|
||||
end,
|
||||
&end->bounds,
|
||||
clip,
|
||||
&op->render.source2_rect);
|
||||
op->render.source2_rect.origin.x = (bounds->origin.x - end->bounds.origin.x)/end->bounds.size.width;
|
||||
op->render.source2_rect.origin.y = (bounds->origin.y - end->bounds.origin.y)/end->bounds.size.height;
|
||||
op->render.source2_rect.size.width = bounds->size.width / end->bounds.size.width;
|
||||
op->render.source2_rect.size.height = bounds->size.height / end->bounds.size.height;
|
||||
&tex_bounds);
|
||||
get_tex_rect (&op->render.source2_rect, &op->render.node->bounds, &tex_bounds);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1390,31 +1381,23 @@ gsk_vulkan_render_pass_upload (GskVulkanRenderPass *self,
|
||||
{
|
||||
GskRenderNode *top = gsk_blend_node_get_top_child (op->render.node);
|
||||
GskRenderNode *bottom = gsk_blend_node_get_bottom_child (op->render.node);
|
||||
const graphene_rect_t *bounds = &op->render.node->bounds;
|
||||
graphene_rect_t tex_bounds;
|
||||
|
||||
op->render.source = gsk_vulkan_render_pass_get_node_as_texture (self,
|
||||
render,
|
||||
uploader,
|
||||
top,
|
||||
&top->bounds,
|
||||
clip,
|
||||
&op->render.source_rect);
|
||||
op->render.source_rect.origin.x = (bounds->origin.x - top->bounds.origin.x)/top->bounds.size.width;
|
||||
op->render.source_rect.origin.y = (bounds->origin.y - top->bounds.origin.y)/top->bounds.size.height;
|
||||
op->render.source_rect.size.width = bounds->size.width / top->bounds.size.width;
|
||||
op->render.source_rect.size.height = bounds->size.height / top->bounds.size.height;
|
||||
&tex_bounds);
|
||||
get_tex_rect (&op->render.source_rect, &op->render.node->bounds, &tex_bounds);
|
||||
|
||||
op->render.source2 = gsk_vulkan_render_pass_get_node_as_texture (self,
|
||||
render,
|
||||
uploader,
|
||||
bottom,
|
||||
&bottom->bounds,
|
||||
clip,
|
||||
&op->render.source2_rect);
|
||||
op->render.source2_rect.origin.x = (bounds->origin.x - bottom->bounds.origin.x)/bottom->bounds.size.width;
|
||||
op->render.source2_rect.origin.y = (bounds->origin.y - bottom->bounds.origin.y)/bottom->bounds.size.height;
|
||||
op->render.source2_rect.size.width = bounds->size.width / bottom->bounds.size.width;
|
||||
op->render.source2_rect.size.height = bounds->size.height / bottom->bounds.size.height;
|
||||
&tex_bounds);
|
||||
get_tex_rect (&op->render.source2_rect, &op->render.node->bounds, &tex_bounds);
|
||||
}
|
||||
break;
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -51,7 +51,7 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
/**
|
||||
* GtkInfoBar:
|
||||
*
|
||||
* `GtkInfoBar` can be show messages to the user without a dialog.
|
||||
* `GtkInfoBar` can be used to show messages to the user without a dialog.
|
||||
*
|
||||
* 
|
||||
*
|
||||
|
@@ -227,7 +227,7 @@ gtk_application_impl_quartz_active_window_changed (GtkApplicationImpl *impl,
|
||||
* Without this, we might hold on to a reference of the window
|
||||
* preventing it from getting disposed.
|
||||
*/
|
||||
if (window != NULL && !g_object_get_data (G_OBJECT (window), "quartz-muxer-umap"))
|
||||
if (window != NULL && !g_object_get_data (G_OBJECT (window), "quartz-muxer-unmap"))
|
||||
{
|
||||
gulong handler_id = g_signal_connect_object (window,
|
||||
"unmap",
|
||||
|
@@ -102,10 +102,10 @@ gtk_css_filter_clear (GtkCssFilter *filter)
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_css_filter_init_identity (GtkCssFilter *filter,
|
||||
GtkCssFilterType type)
|
||||
gtk_css_filter_init_identity (GtkCssFilter *filter,
|
||||
const GtkCssFilter *other)
|
||||
{
|
||||
switch (type)
|
||||
switch (other->type)
|
||||
{
|
||||
case GTK_CSS_FILTER_BRIGHTNESS:
|
||||
filter->brightness.value = _gtk_css_number_value_new (1, GTK_CSS_NUMBER);
|
||||
@@ -135,7 +135,7 @@ gtk_css_filter_init_identity (GtkCssFilter *filter,
|
||||
filter->blur.value = _gtk_css_number_value_new (0, GTK_CSS_PX);
|
||||
break;
|
||||
case GTK_CSS_FILTER_DROP_SHADOW:
|
||||
filter->drop_shadow.value = gtk_css_shadow_value_new_filter ();
|
||||
filter->drop_shadow.value = gtk_css_shadow_value_new_filter (other->drop_shadow.value);
|
||||
break;
|
||||
case GTK_CSS_FILTER_NONE:
|
||||
default:
|
||||
@@ -143,7 +143,7 @@ gtk_css_filter_init_identity (GtkCssFilter *filter,
|
||||
break;
|
||||
}
|
||||
|
||||
filter->type = type;
|
||||
filter->type = other->type;
|
||||
}
|
||||
|
||||
#define R 0.2126
|
||||
@@ -464,7 +464,7 @@ gtk_css_value_filter_equal (const GtkCssValue *value1,
|
||||
{
|
||||
GtkCssFilter filter;
|
||||
|
||||
gtk_css_filter_init_identity (&filter, larger->filters[i].type);
|
||||
gtk_css_filter_init_identity (&filter, &larger->filters[i]);
|
||||
|
||||
if (!gtk_css_filter_equal (&larger->filters[i], &filter))
|
||||
{
|
||||
@@ -588,7 +588,7 @@ gtk_css_value_filter_transition (GtkCssValue *start,
|
||||
{
|
||||
GtkCssFilter filter;
|
||||
|
||||
gtk_css_filter_init_identity (&filter, start->filters[i].type);
|
||||
gtk_css_filter_init_identity (&filter, &start->filters[i]);
|
||||
gtk_css_filter_transition (&result->filters[i],
|
||||
&start->filters[i],
|
||||
&filter,
|
||||
@@ -600,7 +600,7 @@ gtk_css_value_filter_transition (GtkCssValue *start,
|
||||
{
|
||||
GtkCssFilter filter;
|
||||
|
||||
gtk_css_filter_init_identity (&filter, end->filters[i].type);
|
||||
gtk_css_filter_init_identity (&filter, &end->filters[i]);
|
||||
gtk_css_filter_transition (&result->filters[i],
|
||||
&filter,
|
||||
&end->filters[i],
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user