Compare commits
303 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f502d3a6c4 | |||
| c75fba08ea | |||
| f9997de151 | |||
| 501e0ad4eb | |||
| 27d1af6e8e | |||
| d84a17526f | |||
| 4b0d3d8326 | |||
| 26df07717e | |||
| 12d01bc36a | |||
| f83514c639 | |||
| 24b0d08249 | |||
| 3dad92b380 | |||
| a345df255d | |||
| 92862dfeec | |||
| 5a021e229f | |||
| a48424c249 | |||
| 466da30208 | |||
| 58425405d2 | |||
| af984f2503 | |||
| b94a3eeb1c | |||
| 26ff449343 | |||
| 750c2ff7fb | |||
| 48f6ffad7f | |||
| 508970a7fa | |||
| 9d57e9bce4 | |||
| 616a685818 | |||
| a09e6f4f5c | |||
| 1db48174b4 | |||
| 67690f69e9 | |||
| 9ba39ff7aa | |||
| 3420a12104 | |||
| cbb0cbb5bd | |||
| a302672ca8 | |||
| 6e93cd8803 | |||
| 2223abd432 | |||
| 58861ef18e | |||
| fa817ae092 | |||
| 9c804b3fd7 | |||
| db0a97f374 | |||
| a78439a42c | |||
| 0347ea896b | |||
| cf0d017682 | |||
| 9ad7f3cd60 | |||
| 9afe65bc7f | |||
| c1b9a575b7 | |||
| 6854078338 | |||
| a64c2ed6f0 | |||
| a0c632b0d3 | |||
| 38b14c8b0b | |||
| cbc44e202a | |||
| 081b8af597 | |||
| 39f7f8615b | |||
| d310c9dd92 | |||
| dbe1804c3a | |||
| cbf471436a | |||
| 5216670901 | |||
| 274f485248 | |||
| 0345e80770 | |||
| 5ccbcbbec8 | |||
| 7608c5cc88 | |||
| 4774ebca20 | |||
| 2666cc8cba | |||
| b7cda90b5f | |||
| 3447ea8ca3 | |||
| 40c009852d | |||
| 6cdff5ba2b | |||
| 18a18d9e7d | |||
| fbcc280b6a | |||
| 4b350db909 | |||
| 8ec7c3bc21 | |||
| 2bf58d486d | |||
| 58960c890d | |||
| 7a0e8ade38 | |||
| e42befb76b | |||
| f947f23687 | |||
| 322d9e5c3f | |||
| 4b2145475e | |||
| e22cc913c5 | |||
| ba3e8eee8b | |||
| 8f91167c30 | |||
| 8da82c6206 | |||
| e3fb8f341b | |||
| 6772527a3d | |||
| f5a8a09f38 | |||
| e4a6889254 | |||
| 80545f9842 | |||
| fd96444174 | |||
| 1691df5234 | |||
| f78e5ad8c2 | |||
| 01a373eca6 | |||
| e1ed8fd8f6 | |||
| 3aaa1724b0 | |||
| 5ac70b2662 | |||
| 66ed0c11c2 | |||
| 0cdb58af49 | |||
| 103a9ed396 | |||
| 674071a981 | |||
| 6937fcad9e | |||
| a159293c69 | |||
| 64ecfd656e | |||
| 84343d30fb | |||
| 5587ee1027 | |||
| 3b30862e00 | |||
| 9f8cf5b0bd | |||
| 013a06f596 | |||
| b88a652567 | |||
| e2b6433799 | |||
| ec200a333b | |||
| ff1c503735 | |||
| d4b0d395a1 | |||
| e660e922fe | |||
| 287436a26d | |||
| cb644a6d23 | |||
| 8d92e0fb6f | |||
| 0bf68f1372 | |||
| 722953737d | |||
| d17eca052d | |||
| 101296ac0e | |||
| 7c9ef05c7c | |||
| 1afad435a7 | |||
| e935b25a57 | |||
| c69e19c9c5 | |||
| fe9abc78c0 | |||
| a65dc12392 | |||
| f725e3f992 | |||
| 5ff9316ec2 | |||
| 41dbb7a757 | |||
| 9c6a4c3d28 | |||
| 3b8c1189f4 | |||
| aaea063c96 | |||
| 24670df0f0 | |||
| 9753fc3b82 | |||
| 1c58913f6a | |||
| 0f8b9c73cd | |||
| b108e8b91a | |||
| 06b39de159 | |||
| 761af75b1d | |||
| 3e2ef5037a | |||
| f0448a3708 | |||
| 7df8dbc64d | |||
| d6fecef605 | |||
| 02a94c9462 | |||
| 11ef4c8f43 | |||
| 03679fe6bf | |||
| 0030c572d4 | |||
| 28e97f028a | |||
| 6d371f0594 | |||
| cbfbaef4cb | |||
| 39560c0914 | |||
| 29a243e3d7 | |||
| d4d0883a92 | |||
| 3698cadcd2 | |||
| 412a12032f | |||
| 9c4edaa5a0 | |||
| 098796e0e6 | |||
| 6938d5aff2 | |||
| 17c979caf1 | |||
| bbe7e8555d | |||
| df4f716ea0 | |||
| 3942590e7f | |||
| 9fb934b9fc | |||
| 60d0213ce0 | |||
| 88013bbdab | |||
| 3ab67d852b | |||
| f3daa0ee08 | |||
| 60560e5277 | |||
| 8cb6b9b385 | |||
| cfd9cb3e9f | |||
| 61276e9a76 | |||
| 90b8dcdf33 | |||
| 38bd0b07f3 | |||
| ecc42c506b | |||
| 052c2c1d16 | |||
| 28099aa1b5 | |||
| dea3324217 | |||
| 8e090a8a0c | |||
| f6d4b7b04b | |||
| b4c7d1d065 | |||
| b440ba8e8c | |||
| 9be96c8f5d | |||
| f6488b83cc | |||
| 5e17b56135 | |||
| 0c3d86865b | |||
| f814b2f636 | |||
| ffdce120e7 | |||
| 5ac7778407 | |||
| d6b966ba32 | |||
| 0a72ca9cc1 | |||
| 1f774e2044 | |||
| abf22e3edd | |||
| ff0d7443ee | |||
| 70bf8ca928 | |||
| c071c73ce0 | |||
| 83112f942c | |||
| 152c09ee86 | |||
| 521f8a11d8 | |||
| 5a8f1a7aa0 | |||
| 122a989009 | |||
| 4305adf9e0 | |||
| e711c92196 | |||
| 6f89d258b0 | |||
| 17c3a1ed73 | |||
| a0bd59e76d | |||
| 77d5b5e94f | |||
| 2873d7e046 | |||
| 86d2bf746c | |||
| ca02190e47 | |||
| 09de769304 | |||
| 53cb64351d | |||
| 6f0a2bd973 | |||
| f6b96186d8 | |||
| 5a6074814c | |||
| 56edb0c9fb | |||
| 373d2d2682 | |||
| 552a7dc308 | |||
| 6ffbaa6bb0 | |||
| 317b64e599 | |||
| b0c1658642 | |||
| 0df887014f | |||
| 8957f9f5a8 | |||
| f495f9cf7d | |||
| f1e09eb692 | |||
| 2eb6194604 | |||
| 6171070153 | |||
| 7e931fca41 | |||
| 2117afbbb5 | |||
| 7062a374ee | |||
| d66f590a86 | |||
| 1f00d62610 | |||
| b6458ebe8c | |||
| 7b6b31f0d8 | |||
| f0e0332ada | |||
| 41bf17dd45 | |||
| a590ee5412 | |||
| 01ab69659d | |||
| 71116b3e60 | |||
| 066b101c57 | |||
| e36e55c78b | |||
| 5677c6b932 | |||
| 1abfeff0d1 | |||
| c781acb084 | |||
| 93f7fe39e5 | |||
| db6b68a0f3 | |||
| 5d54bb1359 | |||
| cc4d94d197 | |||
| 222ef97d3a | |||
| 03f6684dc3 | |||
| e001b421ad | |||
| 1145504075 | |||
| 065769eb42 | |||
| 8de2a8f40a | |||
| 7cf377ee61 | |||
| dbf2432114 | |||
| 54bee945c6 | |||
| 05bf962b20 | |||
| 1d4ab0681f | |||
| d1c634586a | |||
| b51a3980f3 | |||
| 77adacae8d | |||
| e6ad258b06 | |||
| b9c88bd6c0 | |||
| 8f1a2820b7 | |||
| beb5ede18a | |||
| 2e2857df32 | |||
| 8a4bde62da | |||
| ff56029ccc | |||
| 0f67d61379 | |||
| 8605a073ea | |||
| c6302477c0 | |||
| 6cabd44a2b | |||
| 012388da32 | |||
| 004f061dca | |||
| cf644739e4 | |||
| cb89b3a9e7 | |||
| c018af3023 | |||
| acd874ec55 | |||
| 70733d60f6 | |||
| e3d18ad7a1 | |||
| 3a55f750bc | |||
| e069a8053f | |||
| 582d368653 | |||
| 294bc262cd | |||
| 494b25388a | |||
| f87426f7eb | |||
| 1be06ea339 | |||
| 05f39307b2 | |||
| 0a50e1e663 | |||
| 0270c9e5a9 | |||
| c2c92b8335 | |||
| 6acb8c4e9c | |||
| 84204a0215 | |||
| db545439c0 | |||
| 5f02d8fac5 | |||
| 7dba2a021e | |||
| 1394a82507 | |||
| 0997d39a06 | |||
| efb3477dc9 | |||
| 23f055f7b0 | |||
| 4d99dbc48d | |||
| 6b8e098f34 | |||
| 5844ed5b12 | |||
| 44ef8db93a | |||
| 9e4f2b16e0 |
+35
-11
@@ -30,8 +30,16 @@ variables:
|
||||
|
||||
workflow:
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
# run merge request pipelines
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
# do not run branch pipelines if corresponding merge requests exist...
|
||||
# (this avoids duplicate pipelines)
|
||||
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
|
||||
when: never
|
||||
# ...but otherwise run branch pipelines
|
||||
- if: $CI_COMMIT_BRANCH
|
||||
# run tag pipelines
|
||||
- if: $CI_COMMIT_TAG
|
||||
|
||||
default:
|
||||
retry:
|
||||
@@ -197,28 +205,44 @@ msys2-mingw64:
|
||||
paths:
|
||||
- "${CI_PROJECT_DIR}/_build/gtkdll.tar.gz"
|
||||
|
||||
macos:
|
||||
# Sadly, this fails regularly, and its failure is never enlightening
|
||||
allow_failure: true
|
||||
macos-x86_64:
|
||||
rules:
|
||||
# Do not run in forks as the runner is not available there.
|
||||
- if: $CI_PROJECT_NAMESPACE == "GNOME"
|
||||
stage: build
|
||||
tags:
|
||||
- macos
|
||||
- macosintel
|
||||
needs: []
|
||||
variables:
|
||||
MESON_FORCE_BACKTRACKE: 1
|
||||
TMPDIR: /Users/Shared/work/tmp
|
||||
SDKROOT: /opt/sdks/MacOSX10.13.4.sdk
|
||||
PIP_CACHE_DIR: /Users/Shared/build/cache
|
||||
PIPENV_CACHE_DIR: $PIP_CACHE_DIR
|
||||
PYTHONPYCACHEPREFIX: $PIP_CACHE_DIR
|
||||
EXTRA_MESON_FLAGS: "-Dgobject-introspection:werror=false"
|
||||
before_script:
|
||||
# Not using ccache on purpose as it accelerates the build so much that it
|
||||
# can trigger race conditions in the gobject-introspection subproject.
|
||||
- bash .gitlab-ci/show-info-osx.sh
|
||||
- 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
|
||||
- /opt/macports/bin/python3.10 -m venv .venv
|
||||
- ln -s /opt/cmake/CMake.app/Contents/bin/cmake .venv/bin
|
||||
- ln -s /opt/pkg-config/bin/pkg-config .venv/bin
|
||||
- ln -s /opt/bison/bin/bison .venv/bin
|
||||
- source .venv/bin/activate
|
||||
- pip3 install meson==1.2.0
|
||||
- pip3 install ninja==1.11.1
|
||||
- pip3 install /Users/Shared/build/pkgs/PyGObject-3.44.0-cp310-cp310-macosx_10_13_x86_64.whl
|
||||
/Users/Shared/build/pkgs/pycairo-1.23.0-cp310-cp310-macosx_10_13_x86_64.whl
|
||||
script:
|
||||
- meson setup ${COMMON_MESON_FLAGS}
|
||||
- meson setup
|
||||
${COMMON_MESON_FLAGS}
|
||||
${EXTRA_MESON_FLAGS}
|
||||
-Dx11-backend=false
|
||||
-Dbroadway-backend=true
|
||||
-Dmacos-backend=true
|
||||
-Dmedia-gstreamer=disabled
|
||||
-Dintrospection=disabled
|
||||
-Dintrospection=enabled
|
||||
-Dcpp_std=c++11
|
||||
-Dpixman:tests=disabled
|
||||
-Dlibjpeg-turbo:simd=disabled
|
||||
|
||||
@@ -6,7 +6,7 @@ call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliar
|
||||
|
||||
:: FIXME: make warnings fatal
|
||||
pip3 install --upgrade --user meson~=0.64 || goto :error
|
||||
meson -Ddebug=false -Dmedia-gstreamer=disabled _build || goto :error
|
||||
meson setup -Dbackend_max_links=1 -Ddebug=false -Dmedia-gstreamer=disabled _build || goto :error
|
||||
ninja -C _build || goto :error
|
||||
|
||||
goto :EOF
|
||||
|
||||
+1
-1
@@ -214,7 +214,7 @@ Closes #1234
|
||||
`git commit -a --author "Joe Coder <joe@coder.org>"` and `--signoff`.
|
||||
|
||||
- If your commit is addressing an issue, use the
|
||||
[GitLab syntax](https://docs.gitlab.com/ce/user/project/issues/automatic_issue_closing.html)
|
||||
[GitLab syntax](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
|
||||
to automatically close the issue when merging the commit with the upstream
|
||||
repository:
|
||||
|
||||
|
||||
@@ -1,3 +1,218 @@
|
||||
Overview of Changes in 4.12.6, xx-xx-xxxx
|
||||
=========================================
|
||||
|
||||
Overview of Changes in 4.12.5, 17-01-2024
|
||||
=========================================
|
||||
|
||||
* GtkColumnView:
|
||||
- Fix a crash on dispose
|
||||
|
||||
* GtkEmojiChooser:
|
||||
- Update to CLDR v44
|
||||
- Add more translations
|
||||
|
||||
* GtkFileDialog:
|
||||
- Return an error if no file is selected
|
||||
- Make closing the portal file chooser work
|
||||
|
||||
* GtkDropDown:
|
||||
- Fix display of the initial checkmark
|
||||
|
||||
* GtkShortcutsWindow:
|
||||
- Reduce the minimum width
|
||||
|
||||
* GDK:
|
||||
- Make the png loader safer against overflow
|
||||
|
||||
* Windows:
|
||||
- Use new clipboard api
|
||||
|
||||
* Wayland:
|
||||
- Fix cursor handling with graphics tablets
|
||||
|
||||
* macOS:
|
||||
- Silence secure-restore message
|
||||
- Fix build on macOS < 10.13
|
||||
|
||||
* Translation updates
|
||||
Basque
|
||||
British English
|
||||
Catalan
|
||||
Chinese (China)
|
||||
Czech
|
||||
Georgian
|
||||
German
|
||||
Hebrew
|
||||
Indonesian
|
||||
Lithuanian
|
||||
Persian
|
||||
Polish
|
||||
Romanian
|
||||
Russian
|
||||
Slovenian
|
||||
Swedish
|
||||
Turkish
|
||||
Ukrainian
|
||||
Vietnamese
|
||||
|
||||
|
||||
Overview of Changes in 4.12.4, 17-11-2023
|
||||
=========================================
|
||||
|
||||
* a11y:
|
||||
- Tweak name computation for some corner cases
|
||||
|
||||
* gdk:
|
||||
- gl: Improve our use of GLES a bit (use vertex arrays and
|
||||
GL_BGRA if available)
|
||||
- Fix some errors in our memory format tables
|
||||
|
||||
* gsk:
|
||||
- gl: handle texture-scale nodes more faithfully
|
||||
- gl: Fix icon padding in the atlas
|
||||
|
||||
* Windows:
|
||||
- Stop relying on glib for build configuration
|
||||
|
||||
* Tools:
|
||||
- Add a --undecorated option to gtk4-rendernode-tool
|
||||
|
||||
* Translation updates
|
||||
Catalan
|
||||
French
|
||||
Romanian
|
||||
Russian
|
||||
Spanish
|
||||
Turkish
|
||||
|
||||
|
||||
Overview of Changes in 4.12.3, 28-09-2023
|
||||
=========================================
|
||||
|
||||
* GtkWindow:
|
||||
- Don't assume titlebars are GtkHeaderBar
|
||||
|
||||
* GtkTreeView:
|
||||
- Fix a crash in gtk_tree_view_is_blank_at_pos
|
||||
|
||||
* printing:
|
||||
- Fix some issues with the portal implementation
|
||||
|
||||
* GSK:
|
||||
- Some optimizations in the GL renderer
|
||||
- Fix memory leaks in the Broadway renderer
|
||||
|
||||
* demos:
|
||||
- Fix a crash in gtk4-demo
|
||||
|
||||
* Translation updates
|
||||
Basque
|
||||
Brazilian Portuguese
|
||||
Czech
|
||||
Galician
|
||||
Georgian
|
||||
German
|
||||
Hungarian
|
||||
Kazakh
|
||||
Lithuanian
|
||||
Persian
|
||||
Polish
|
||||
Spanish
|
||||
Swedish
|
||||
Turkish
|
||||
|
||||
|
||||
Overview of Changes in 4.12.2, 20-09-2023
|
||||
=========================================
|
||||
|
||||
* GtkTooltip:
|
||||
- Don't cross native boundaries when looking for tooltips
|
||||
|
||||
* GtkCenterLayout, GtkEntry, GtkSearchEntry:
|
||||
- Fix some issues with baseline handling
|
||||
|
||||
* GtkSwitch:
|
||||
- Respect text direction
|
||||
|
||||
* Theme:
|
||||
- Use relative font sizes
|
||||
|
||||
* GSK:
|
||||
- Make repeated gradients match between GL and cairo
|
||||
- Make rounded rect shrinking match between Vulkan, GL and cairo
|
||||
- Fix parsing of text nodes with color glyphs
|
||||
- Restrict an optimization to the cases where it is correct
|
||||
- Fix rendering of shadows with opacity
|
||||
|
||||
* macOS:
|
||||
- Clamp damage regions to the surface size
|
||||
|
||||
* Windows:
|
||||
- Fix missing minimize and maximize buttons
|
||||
|
||||
* Translation updates
|
||||
Basque
|
||||
Brazilian Portuguese
|
||||
Catalan
|
||||
Chinese (China)
|
||||
Czech
|
||||
Danish
|
||||
Dutch
|
||||
Finnish
|
||||
Galician
|
||||
German
|
||||
Hungarian
|
||||
Italian
|
||||
Kazakh
|
||||
Latvian
|
||||
Lithuanian
|
||||
Slovenian
|
||||
Spanish
|
||||
Turkish
|
||||
|
||||
|
||||
Overview of Changes in 4.12.1, 25-08-2023
|
||||
=========================================
|
||||
|
||||
* GtkGridView:
|
||||
- Fix a crash when scrolling
|
||||
|
||||
* GtkColumnView:
|
||||
- Fix a refcounting issue in the new scroll_to api
|
||||
|
||||
* GtkTreeView
|
||||
- Fix style classes for sort arrows
|
||||
|
||||
* GtkEntry:
|
||||
- Improve tracking of user changes (for undo)
|
||||
|
||||
* GtkNotebook:
|
||||
- Fix a critical when switching pages
|
||||
|
||||
* GtkColor/FontDialogButton:
|
||||
- Make these widgets activatable
|
||||
|
||||
* GtkMenuButton:
|
||||
- Fix problems with focus handling
|
||||
- Fix problems with DND
|
||||
|
||||
* Printing
|
||||
- Fix the cpdb backend build
|
||||
|
||||
* MacOS:
|
||||
- Make file filters work again
|
||||
|
||||
* GSK:
|
||||
- Fix issues with color matrix nodes
|
||||
|
||||
* Wayland:
|
||||
- Fix a crash with compositors other than gnome-shell
|
||||
|
||||
* Translation updates:
|
||||
Polish
|
||||
Swedish
|
||||
|
||||
|
||||
Overview of Changes in 4.12.0, 05-08-2023
|
||||
=========================================
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
#ifndef _MSC_VER
|
||||
#pragma error "This header is for Microsoft VC or clang-cl only."
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
/* Make MSVC more pedantic, this is a recommended pragma list
|
||||
* from _Win32_Programming_ by Rector and Newcomer.
|
||||
*/
|
||||
#ifndef __clang__
|
||||
#pragma warning(error:4002) /* too many actual parameters for macro */
|
||||
#pragma warning(error:4003) /* not enough actual parameters for macro */
|
||||
#pragma warning(1:4010) /* single-line comment contains line-continuation character */
|
||||
#pragma warning(error:4013) /* 'function' undefined; assuming extern returning int */
|
||||
#pragma warning(1:4016) /* no function return type; using int as default */
|
||||
#pragma warning(error:4020) /* too many actual parameters */
|
||||
#pragma warning(error:4021) /* too few actual parameters */
|
||||
#pragma warning(error:4027) /* function declared without formal parameter list */
|
||||
#pragma warning(error:4029) /* declared formal parameter list different from definition */
|
||||
#pragma warning(error:4033) /* 'function' must return a value */
|
||||
#pragma warning(error:4035) /* 'function' : no return value */
|
||||
#pragma warning(error:4045) /* array bounds overflow */
|
||||
#pragma warning(error:4047) /* different levels of indirection */
|
||||
#pragma warning(error:4049) /* terminating line number emission */
|
||||
#pragma warning(error:4053) /* An expression of type void was used as an operand */
|
||||
#pragma warning(error:4071) /* no function prototype given */
|
||||
#pragma warning(disable:4101) /* unreferenced local variable */
|
||||
#pragma warning(error:4150)
|
||||
|
||||
/* G_NORETURN */
|
||||
#pragma warning(error:4646) /* function declared with __declspec(noreturn) has non-void return type */
|
||||
#pragma warning(error:4715) /* 'function': not all control paths return a value */
|
||||
#pragma warning(error:4098) /* 'void' function returning a value */
|
||||
|
||||
#pragma warning(disable:4244) /* No possible loss of data warnings */
|
||||
#pragma warning(disable:4305) /* No truncation from int to char warnings */
|
||||
|
||||
#pragma warning(error:4819) /* The file contains a character that cannot be represented in the current code page */
|
||||
#endif /* __clang__ */
|
||||
|
||||
/* work around Microsoft's premature attempt to deprecate the C-Library */
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#define _CRT_NONSTDC_NO_WARNINGS
|
||||
@@ -35,7 +35,7 @@ show_action_dialog (GSimpleAction *action)
|
||||
{
|
||||
GtkAlertDialog *dialog;
|
||||
|
||||
dialog = gtk_alert_dialog_new ("You activated action: \"%s\n",
|
||||
dialog = gtk_alert_dialog_new ("You activated action: \"%s\"",
|
||||
g_action_get_name (G_ACTION (action)));
|
||||
gtk_alert_dialog_show (dialog, NULL);
|
||||
g_object_unref (dialog);
|
||||
@@ -223,7 +223,7 @@ delete_messages (gpointer data)
|
||||
static void
|
||||
pop_message (GtkWidget *status)
|
||||
{
|
||||
GList *messages = (GList *) g_object_get_data (G_OBJECT (status), "messages");
|
||||
GList *messages = (GList *) g_object_steal_data (G_OBJECT (status), "messages");
|
||||
|
||||
if (messages)
|
||||
{
|
||||
@@ -241,7 +241,7 @@ static void
|
||||
push_message (GtkWidget *status,
|
||||
const char *message)
|
||||
{
|
||||
GList *messages = (GList *) g_object_get_data (G_OBJECT (status), "messages");
|
||||
GList *messages = (GList *) g_object_steal_data (G_OBJECT (status), "messages");
|
||||
|
||||
gtk_label_set_label (GTK_LABEL (status), message);
|
||||
messages = g_list_prepend (messages, g_strdup (message));
|
||||
|
||||
@@ -71,14 +71,7 @@ create_blurred_button (void)
|
||||
static GtkWidget *
|
||||
create_font_button (void)
|
||||
{
|
||||
GtkFontDialog *dialog;
|
||||
GtkWidget *button;
|
||||
|
||||
dialog = gtk_font_dialog_new ();
|
||||
button = gtk_font_dialog_button_new (dialog);
|
||||
g_object_unref (dialog);
|
||||
|
||||
return button;
|
||||
return gtk_font_dialog_button_new (gtk_font_dialog_new ());
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
|
||||
+14
-14
@@ -840,24 +840,24 @@ gtk_gears_unrealize (GtkWidget *widget)
|
||||
GtkGearsPrivate *priv = gtk_gears_get_instance_private ((GtkGears *) widget);
|
||||
|
||||
gtk_gl_area_make_current (glarea);
|
||||
if (gtk_gl_area_get_error (glarea) != NULL)
|
||||
return;
|
||||
if (gtk_gl_area_get_error (glarea) == NULL)
|
||||
{
|
||||
/* Release the resources associated with OpenGL */
|
||||
if (priv->gear_vbo[0] != 0)
|
||||
glDeleteBuffers (1, &(priv->gear_vbo[0]));
|
||||
|
||||
/* Release the resources associated with OpenGL */
|
||||
if (priv->gear_vbo[0] != 0)
|
||||
glDeleteBuffers (1, &(priv->gear_vbo[0]));
|
||||
if (priv->gear_vbo[1] != 0)
|
||||
glDeleteBuffers (1, &(priv->gear_vbo[1]));
|
||||
|
||||
if (priv->gear_vbo[1] != 0)
|
||||
glDeleteBuffers (1, &(priv->gear_vbo[1]));
|
||||
if (priv->gear_vbo[2] != 0)
|
||||
glDeleteBuffers (1, &(priv->gear_vbo[2]));
|
||||
|
||||
if (priv->gear_vbo[2] != 0)
|
||||
glDeleteBuffers (1, &(priv->gear_vbo[2]));
|
||||
if (priv->vao != 0)
|
||||
glDeleteVertexArrays (1, &priv->vao);
|
||||
|
||||
if (priv->vao != 0)
|
||||
glDeleteVertexArrays (1, &priv->vao);
|
||||
|
||||
if (priv->program != 0)
|
||||
glDeleteProgram (priv->program);
|
||||
if (priv->program != 0)
|
||||
glDeleteProgram (priv->program);
|
||||
}
|
||||
|
||||
priv->ModelViewProjectionMatrix_location = 0;
|
||||
priv->NormalMatrix_location = 0;
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 533 B |
Binary file not shown.
|
Before Width: | Height: | Size: 127 B |
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M3.384 3h3.231c.213 0 .385.224.385.502v2.996C7 6.776 6.828 7 6.615 7h-3.23C3.17 7 3 6.776 3 6.498V3.502C3 3.224 3.17 3 3.384 3zm6 0h3.231c.213 0 .385.224.385.502v2.996c0 .278-.172.502-.385.502h-3.23C9.17 7 9 6.776 9 6.498V3.502C9 3.224 9.17 3 9.384 3zm-6 6h3.231c.213 0 .385.224.385.502v2.996c0 .278-.172.502-.385.502h-3.23C3.17 13 3 12.776 3 12.498V9.502C3 9.224 3.17 9 3.384 9zm6 0h3.231c.213 0 .385.224.385.502v2.996c0 .278-.172.502-.385.502h-3.23C9.17 13 9 12.776 9 12.498V9.502C9 9.224 9.17 9 9.384 9z" style="marker:none" overflow="visible" color="#000" fill="#474747"/></svg>
|
||||
|
Before Width: | Height: | Size: 654 B |
@@ -25,14 +25,12 @@
|
||||
<file>icons/16x16/actions/format-justify-fill-symbolic.symbolic.png</file>
|
||||
<file>icons/16x16/actions/format-justify-left-symbolic.symbolic.png</file>
|
||||
<file>icons/16x16/actions/format-justify-right-symbolic.symbolic.png</file>
|
||||
<file>icons/16x16/actions/insert-image.png</file>
|
||||
<file>icons/16x16/actions/insert-link-symbolic.symbolic.png</file>
|
||||
<file>icons/16x16/actions/send-to-symbolic.symbolic.png</file>
|
||||
<file>icons/16x16/actions/star-new-symbolic.symbolic.png</file>
|
||||
<file>icons/16x16/actions/view-continuous-symbolic.symbolic.png</file>
|
||||
<file>icons/16x16/actions/view-dual-symbolic.symbolic.png</file>
|
||||
<file>icons/16x16/actions/view-fullscreen-symbolic.symbolic.png</file>
|
||||
<file>icons/16x16/actions/view-grid-symbolic.symbolic.png</file>
|
||||
<file>icons/16x16/actions/view-paged-symbolic.symbolic.png</file>
|
||||
<file>icons/16x16/actions/zoom-in-symbolic.symbolic.png</file>
|
||||
<file>icons/16x16/actions/zoom-in.png</file>
|
||||
@@ -88,7 +86,6 @@
|
||||
<file>icons/scalable/actions/view-dual-symbolic.svg</file>
|
||||
<file>icons/scalable/actions/view-paged-symbolic.svg</file>
|
||||
<file>icons/scalable/actions/view-fullscreen-symbolic.svg</file>
|
||||
<file>icons/scalable/actions/view-grid-symbolic.svg</file>
|
||||
<file>icons/scalable/actions/zoom-in-symbolic.svg</file>
|
||||
<file>icons/scalable/actions/zoom-original-symbolic.svg</file>
|
||||
<file>icons/scalable/actions/zoom-out-symbolic.svg</file>
|
||||
|
||||
@@ -41,7 +41,7 @@ activate (GtkApplication* app,
|
||||
window = gtk_application_window_new (app);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Window");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);
|
||||
gtk_widget_show (window);
|
||||
gtk_widget_set_visible (window, TRUE);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -183,7 +183,7 @@ activate (GtkApplication *app,
|
||||
|
||||
gtk_box_append (GTK_BOX (box), button);
|
||||
|
||||
gtk_widget_show (window);
|
||||
gtk_widget_set_visible (window, TRUE);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -331,8 +331,7 @@ activate (GtkApplication *app,
|
||||
*/
|
||||
gtk_grid_attach (GTK_GRID (grid), button, 0, 1, 2, 1);
|
||||
|
||||
gtk_widget_show (window);
|
||||
|
||||
gtk_widget_set_visible (window, TRUE);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -554,7 +553,7 @@ activate (GtkApplication *app,
|
||||
|
||||
g_signal_connect (press, "pressed", G_CALLBACK (pressed), drawing_area);
|
||||
|
||||
gtk_widget_show (window);
|
||||
gtk_widget_set_visible (window, TRUE);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -631,7 +630,7 @@ activate (GtkApplication *app,
|
||||
button = gtk_builder_get_object (builder, "quit");
|
||||
g_signal_connect_swapped (button, "clicked", G_CALLBACK (quit_cb), window);
|
||||
|
||||
gtk_widget_show (GTK_WIDGET (window));
|
||||
gtk_widget_set_visible (GTK_WIDGET (window), TRUE);
|
||||
|
||||
/* We do not need the builder any more */
|
||||
g_object_unref (builder);
|
||||
|
||||
@@ -35,6 +35,11 @@ Showing
|
||||
|
||||
The ``show`` command displays the rendernode.
|
||||
|
||||
``--undecorated``
|
||||
|
||||
Removes window decorations. This is meant for rendering of exactly the rendernode
|
||||
without any titlebar.
|
||||
|
||||
Rendering
|
||||
^^^^^^^^^
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ main (int argc, char **argv)
|
||||
// ...
|
||||
|
||||
// Show the application window
|
||||
gtk_widget_show (window);
|
||||
gtk_widget_set_visible (window, TRUE);
|
||||
|
||||
// Enter the main event loop, and wait for user interaction
|
||||
while (!done)
|
||||
|
||||
@@ -222,7 +222,7 @@ It is possible to set accessible attributes in UI files as well:
|
||||
<accessibility>
|
||||
<property name="label">Download</property>
|
||||
<relation name="labelled-by">label1</relation>
|
||||
/accessibility>
|
||||
</accessibility>
|
||||
</object>
|
||||
```
|
||||
|
||||
|
||||
@@ -263,7 +263,7 @@ gdk_parse_debug_var (const char *variable,
|
||||
if (debug_enabled || keys[i].always_enabled)
|
||||
fprintf (stderr, " %s%*s%s\n", keys[i].key, (int)(max_width - strlen (keys[i].key)), " ", keys[i].help);
|
||||
}
|
||||
fprintf (stderr, " %s%*s%s\n", "all", max_width - 3, " ", "Enable all values");
|
||||
fprintf (stderr, " %s%*s%s\n", "all", max_width - 3, " ", "Enable all values. Other given values are subtracted");
|
||||
fprintf (stderr, " %s%*s%s\n", "help", max_width - 4, " ", "Print this help");
|
||||
fprintf (stderr, "\nMultiple values can be given, separated by : or space.\n");
|
||||
}
|
||||
|
||||
+3
-1
@@ -151,7 +151,7 @@ gdk_array(reserve) (GdkArray *self,
|
||||
return;
|
||||
|
||||
size = gdk_array(get_size) (self);
|
||||
new_size = 1 << g_bit_storage (MAX (GDK_ARRAY_REAL_SIZE (n), 16) - 1);
|
||||
new_size = ((gsize) 1) << g_bit_storage (MAX (GDK_ARRAY_REAL_SIZE (n), 16) - 1);
|
||||
|
||||
#ifdef GDK_ARRAY_PREALLOC
|
||||
if (self->start == self->preallocated)
|
||||
@@ -286,3 +286,5 @@ gdk_array(get) (const GdkArray *self,
|
||||
#undef GDK_ARRAY_TYPE_NAME
|
||||
#undef GDK_ARRAY_NO_MEMSET
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
+3
-2
@@ -529,8 +529,9 @@ gdk_clipboard_get_content (GdkClipboard *clipboard)
|
||||
* exit. Depending on the platform, the functionality may not be available
|
||||
* unless a "clipboard manager" is running.
|
||||
*
|
||||
* This function is called automatically when a [class@Gtk.Application] is
|
||||
* shut down, so you likely don't need to call it.
|
||||
* This function is called automatically when a
|
||||
* [GtkApplication](../gtk4/class.Application.html)
|
||||
* is shut down, so you likely don't need to call it.
|
||||
*/
|
||||
void
|
||||
gdk_clipboard_store_async (GdkClipboard *clipboard,
|
||||
|
||||
+2
-1
@@ -47,7 +47,8 @@
|
||||
* Cursors by themselves are not very interesting: they must be bound to a
|
||||
* window for users to see them. This is done with [method@Gdk.Surface.set_cursor]
|
||||
* or [method@Gdk.Surface.set_device_cursor]. Applications will typically
|
||||
* use higher-level GTK functions such as [method@Gtk.Widget.set_cursor] instead.
|
||||
* use higher-level GTK functions such as [gtk_widget_set_cursor()](../gtk4/method.Widget.set_cursor.html)
|
||||
* instead.
|
||||
*
|
||||
* Cursors are not bound to a given [class@Gdk.Display], so they can be shared.
|
||||
* However, the appearance of cursors may vary when used on different
|
||||
|
||||
+3
-4
@@ -473,8 +473,7 @@ gdk_display_get_event (GdkDisplay *display)
|
||||
* @display: a `GdkDisplay`
|
||||
* @event: (transfer none): a `GdkEvent`
|
||||
*
|
||||
* Appends the given event onto the front of the event
|
||||
* queue for @display.
|
||||
* Adds the given event to the event queue for @display.
|
||||
*
|
||||
* Deprecated: 4.10: This function is only useful in very
|
||||
* special situations and should not be used by applications.
|
||||
@@ -1149,9 +1148,9 @@ _gdk_display_get_next_serial (GdkDisplay *display)
|
||||
* Indicates to the GUI environment that the application has
|
||||
* finished loading, using a given identifier.
|
||||
*
|
||||
* GTK will call this function automatically for [class@Gtk.Window]
|
||||
* GTK will call this function automatically for [GtkWindow](../gtk4/class.Window.html)
|
||||
* with custom startup-notification identifier unless
|
||||
* [method@Gtk.Window.set_auto_startup_notification]
|
||||
* [gtk_window_set_auto_startup_notification()](../gtk4/method.Window.set_auto_startup_notification.html)
|
||||
* is called to disable that feature.
|
||||
*
|
||||
* Deprecated: 4.10: Using [method@Gdk.Toplevel.set_startup_id] is sufficient
|
||||
|
||||
@@ -298,8 +298,8 @@ gdk_draw_context_get_surface (GdkDrawContext *context)
|
||||
*
|
||||
* When using GTK, the widget system automatically places calls to
|
||||
* gdk_draw_context_begin_frame() and gdk_draw_context_end_frame() via the
|
||||
* use of [class@Gsk.Renderer]s, so application code does not need to call
|
||||
* these functions explicitly.
|
||||
* use of [GskRenderer](../gsk4/class.Renderer.html)s, so application code
|
||||
* does not need to call these functions explicitly.
|
||||
*/
|
||||
void
|
||||
gdk_draw_context_begin_frame (GdkDrawContext *context,
|
||||
|
||||
+4
-2
@@ -166,7 +166,8 @@ gdk_frame_clock_class_init (GdkFrameClockClass *klass)
|
||||
*
|
||||
* Animations should be updated using [method@Gdk.FrameClock.get_frame_time].
|
||||
* Applications can connect directly to this signal, or use
|
||||
* [method@Gtk.Widget.add_tick_callback] as a more convenient interface.
|
||||
* [gtk_widget_add_tick_callback()](../gtk4/method.Widget.add_tick_callback.html)
|
||||
* as a more convenient interface.
|
||||
*/
|
||||
signals[UPDATE] =
|
||||
g_signal_new (g_intern_static_string ("update"),
|
||||
@@ -203,7 +204,8 @@ gdk_frame_clock_class_init (GdkFrameClockClass *klass)
|
||||
*
|
||||
* The frame is repainted. GDK normally handles this internally and
|
||||
* emits [signal@Gdk.Surface::render] signals which are turned into
|
||||
* [signal@Gtk.Widget::snapshot] signals by GTK.
|
||||
* [GtkWidget::snapshot](../gtk4/signal.Widget.snapshot.html) signals
|
||||
* by GTK.
|
||||
*/
|
||||
signals[PAINT] =
|
||||
g_signal_new (g_intern_static_string ("paint"),
|
||||
|
||||
+39
-3
@@ -109,6 +109,7 @@ typedef struct {
|
||||
guint has_sync : 1;
|
||||
guint has_unpack_subimage : 1;
|
||||
guint has_debug_output : 1;
|
||||
guint has_bgra : 1;
|
||||
guint extensions_checked : 1;
|
||||
guint debug_enabled : 1;
|
||||
guint forward_compatible : 1;
|
||||
@@ -1528,13 +1529,16 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
|
||||
|
||||
if (gdk_gl_context_get_use_es (context))
|
||||
{
|
||||
priv->has_unpack_subimage = epoxy_has_gl_extension ("GL_EXT_unpack_subimage");
|
||||
priv->has_unpack_subimage = gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (3, 0)) ||
|
||||
epoxy_has_gl_extension ("GL_EXT_unpack_subimage");
|
||||
priv->has_khr_debug = epoxy_has_gl_extension ("GL_KHR_debug");
|
||||
priv->has_bgra = epoxy_has_gl_extension ("GL_EXT_texture_format_BGRA8888");
|
||||
}
|
||||
else
|
||||
{
|
||||
priv->has_unpack_subimage = TRUE;
|
||||
priv->has_khr_debug = epoxy_has_gl_extension ("GL_KHR_debug");
|
||||
priv->has_bgra = TRUE;
|
||||
|
||||
/* We asked for a core profile, but we didn't get one, so we're in legacy mode */
|
||||
if (!gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (3, 2)))
|
||||
@@ -1566,7 +1570,8 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
|
||||
" - GL_KHR_debug: %s\n"
|
||||
" - GL_EXT_unpack_subimage: %s\n"
|
||||
" - half float: %s\n"
|
||||
" - sync: %s",
|
||||
" - sync: %s\n"
|
||||
" - bgra: %s",
|
||||
gdk_gl_context_get_use_es (context) ? "OpenGL ES" : "OpenGL",
|
||||
gdk_gl_version_get_major (&priv->gl_version), gdk_gl_version_get_minor (&priv->gl_version),
|
||||
priv->is_legacy ? "legacy" : "core",
|
||||
@@ -1575,7 +1580,8 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
|
||||
priv->has_khr_debug ? "yes" : "no",
|
||||
priv->has_unpack_subimage ? "yes" : "no",
|
||||
priv->has_half_float ? "yes" : "no",
|
||||
priv->has_sync ? "yes" : "no");
|
||||
priv->has_sync ? "yes" : "no",
|
||||
priv->has_bgra ? "yes" : "no");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1811,6 +1817,36 @@ gdk_gl_context_has_sync (GdkGLContext *self)
|
||||
return priv->has_sync;
|
||||
}
|
||||
|
||||
/* Return if GL_BGRA works with glTexImage2D */
|
||||
gboolean
|
||||
gdk_gl_context_has_bgra (GdkGLContext *self)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (self);
|
||||
|
||||
return priv->has_bgra;
|
||||
}
|
||||
|
||||
/* Return if glGenVertexArrays, glBindVertexArray and glDeleteVertexArrays
|
||||
* can be used
|
||||
*/
|
||||
gboolean
|
||||
gdk_gl_context_has_vertex_arrays (GdkGLContext *self)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (self);
|
||||
|
||||
switch (priv->api)
|
||||
{
|
||||
case GDK_GL_API_GL:
|
||||
return TRUE;
|
||||
|
||||
case GDK_GL_API_GLES:
|
||||
return gdk_gl_version_get_major (&priv->gl_version) >= 3;
|
||||
|
||||
default:
|
||||
g_return_val_if_reached (FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
/* This is currently private! */
|
||||
/* When using GL/ES, don't flip the 'R' and 'B' bits on Windows/ANGLE for glReadPixels() */
|
||||
gboolean
|
||||
|
||||
@@ -155,6 +155,10 @@ gboolean gdk_gl_context_has_vertex_half_float (GdkGLContext
|
||||
|
||||
gboolean gdk_gl_context_has_sync (GdkGLContext *self) G_GNUC_PURE;
|
||||
|
||||
gboolean gdk_gl_context_has_bgra (GdkGLContext *self) G_GNUC_PURE;
|
||||
|
||||
gboolean gdk_gl_context_has_vertex_arrays (GdkGLContext *self) G_GNUC_PURE;
|
||||
|
||||
double gdk_gl_context_get_scale (GdkGLContext *self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
+2
-2
@@ -153,7 +153,7 @@ gdk_gl_texture_find_format (gboolean use_es,
|
||||
if (gdk_memory_format_alpha (format) != alpha)
|
||||
continue;
|
||||
|
||||
if (!gdk_memory_format_gl_format (format, use_es, gl_major, gl_minor, &q_internal_format, &q_format, &q_type, &q_swizzle))
|
||||
if (!gdk_memory_format_gl_format (format, use_es, gl_major, gl_minor, &q_internal_format, &q_format, &q_type, q_swizzle))
|
||||
continue;
|
||||
|
||||
if (q_format != gl_format || q_type != gl_type)
|
||||
@@ -188,7 +188,7 @@ gdk_gl_texture_do_download (GdkGLTexture *self,
|
||||
FALSE,
|
||||
major, minor,
|
||||
&gl_internal_format,
|
||||
&gl_format, &gl_type, &gl_swizzle))
|
||||
&gl_format, &gl_type, gl_swizzle))
|
||||
{
|
||||
if (download->stride == expected_stride &&
|
||||
download->format == format)
|
||||
|
||||
@@ -423,7 +423,7 @@ static const GdkMemoryFormatDescription memory_formats[] = {
|
||||
G_ALIGNOF (guchar),
|
||||
GDK_MEMORY_U8,
|
||||
{ 0, 0, 0, 0 },
|
||||
{ GL_RGB8, GL_RGB, GL_UNSIGNED_BYTE, { GL_RED, GL_GREEN, GL_BLUE, GL_ONE } },
|
||||
{ GL_RGB8, GL_RGB, GL_UNSIGNED_BYTE, { GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA } },
|
||||
r8g8b8_to_float,
|
||||
r8g8b8_from_float,
|
||||
},
|
||||
@@ -433,7 +433,7 @@ static const GdkMemoryFormatDescription memory_formats[] = {
|
||||
G_ALIGNOF (guchar),
|
||||
GDK_MEMORY_U8,
|
||||
{ 0, 0, G_MAXUINT, G_MAXUINT },
|
||||
{ GL_RGB8, GL_BGR, GL_UNSIGNED_BYTE, { GL_RED, GL_GREEN, GL_BLUE, GL_ONE } },
|
||||
{ GL_RGB8, GL_BGR, GL_UNSIGNED_BYTE, { GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA } },
|
||||
b8g8r8_to_float,
|
||||
b8g8r8_from_float,
|
||||
},
|
||||
@@ -443,7 +443,7 @@ static const GdkMemoryFormatDescription memory_formats[] = {
|
||||
G_ALIGNOF (guint16),
|
||||
GDK_MEMORY_U16,
|
||||
{ 0, 0, 3, 0 },
|
||||
{ GL_RGB16, GL_RGB, GL_UNSIGNED_SHORT, { GL_RED, GL_GREEN, GL_BLUE, GL_ONE } },
|
||||
{ GL_RGB16, GL_RGB, GL_UNSIGNED_SHORT, { GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA } },
|
||||
r16g16b16_to_float,
|
||||
r16g16b16_from_float,
|
||||
},
|
||||
@@ -473,7 +473,7 @@ static const GdkMemoryFormatDescription memory_formats[] = {
|
||||
G_ALIGNOF (guint16),
|
||||
GDK_MEMORY_FLOAT16,
|
||||
{ 0, 0, 3, 0 },
|
||||
{ GL_RGB16F, GL_RGB, GL_HALF_FLOAT, { GL_RED, GL_GREEN, GL_BLUE, GL_ONE } },
|
||||
{ GL_RGB16F, GL_RGB, GL_HALF_FLOAT, { GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA } },
|
||||
r16g16b16_float_to_float,
|
||||
r16g16b16_float_from_float,
|
||||
},
|
||||
@@ -503,7 +503,7 @@ static const GdkMemoryFormatDescription memory_formats[] = {
|
||||
G_ALIGNOF (float),
|
||||
GDK_MEMORY_FLOAT32,
|
||||
{ 0, 0, 3, 0 },
|
||||
{ GL_RGB32F, GL_RGB, GL_FLOAT, { GL_RED, GL_GREEN, GL_BLUE, GL_ONE } },
|
||||
{ GL_RGB32F, GL_RGB, GL_FLOAT, { GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA } },
|
||||
r32g32b32_float_to_float,
|
||||
r32g32b32_float_from_float,
|
||||
},
|
||||
@@ -511,7 +511,7 @@ static const GdkMemoryFormatDescription memory_formats[] = {
|
||||
GDK_MEMORY_ALPHA_PREMULTIPLIED,
|
||||
16,
|
||||
G_ALIGNOF (float),
|
||||
TRUE,
|
||||
GDK_MEMORY_FLOAT32,
|
||||
{ 0, 0, 3, 0 },
|
||||
{ GL_RGBA32F, GL_RGBA, GL_FLOAT, { GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA } },
|
||||
r32g32b32a32_float_to_float,
|
||||
@@ -739,12 +739,12 @@ gdk_memory_format_gl_format (GdkMemoryFormat format,
|
||||
guint *out_internal_format,
|
||||
guint *out_format,
|
||||
guint *out_type,
|
||||
GLint (*out_swizzle)[4])
|
||||
GLint out_swizzle[4])
|
||||
{
|
||||
*out_internal_format = memory_formats[format].gl.internal_format;
|
||||
*out_format = memory_formats[format].gl.format;
|
||||
*out_type = memory_formats[format].gl.type;
|
||||
memcpy (out_swizzle, &memory_formats[format].gl.swizzle, sizeof(GLint) * 4);
|
||||
memcpy (out_swizzle, memory_formats[format].gl.swizzle, sizeof(GLint) * 4);
|
||||
|
||||
if (gles)
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ gboolean gdk_memory_format_gl_format (GdkMemoryFormat
|
||||
guint *out_internal_format,
|
||||
guint *out_format,
|
||||
guint *out_type,
|
||||
GLint (*out_gizzle)[4]);
|
||||
GLint out_gizzle[4]);
|
||||
|
||||
void gdk_memory_convert (guchar *dest_data,
|
||||
gsize dest_stride,
|
||||
|
||||
+21
-3
@@ -24,11 +24,16 @@
|
||||
#include "gdksnapshotprivate.h"
|
||||
#include "gdkprivate.h"
|
||||
|
||||
#include <graphene.h>
|
||||
|
||||
/* HACK: So we don't need to include any (not-yet-created) GSK or GTK headers */
|
||||
GdkSnapshot * gtk_snapshot_new (void);
|
||||
void gtk_snapshot_push_debug (GdkSnapshot *snapshot,
|
||||
const char *message,
|
||||
...) G_GNUC_PRINTF (2, 3);
|
||||
void gtk_snapshot_pop (GdkSnapshot *snapshot);
|
||||
GdkPaintable * gtk_snapshot_free_to_paintable (GdkSnapshot *snapshot,
|
||||
const graphene_size_t *size);
|
||||
|
||||
/**
|
||||
* GdkPaintable:
|
||||
@@ -102,9 +107,21 @@ gdk_paintable_default_snapshot (GdkPaintable *paintable,
|
||||
static GdkPaintable *
|
||||
gdk_paintable_default_get_current_image (GdkPaintable *paintable)
|
||||
{
|
||||
g_warning ("FIXME: implement by snapshotting at default size and returning a GskRendererNodePaintable");
|
||||
int width, height;
|
||||
GdkSnapshot *snapshot;
|
||||
|
||||
return paintable;
|
||||
/* No need to check whether the paintable is static, as
|
||||
* gdk_paintable_get_current_image () takes care of that already. */
|
||||
|
||||
width = gdk_paintable_get_intrinsic_width (paintable);
|
||||
height = gdk_paintable_get_intrinsic_height (paintable);
|
||||
|
||||
if (width <= 0 || height <= 0)
|
||||
return gdk_paintable_new_empty (width, height);
|
||||
|
||||
snapshot = gtk_snapshot_new ();
|
||||
gdk_paintable_snapshot (paintable, snapshot, width, height);
|
||||
return gtk_snapshot_free_to_paintable (snapshot, NULL);
|
||||
}
|
||||
|
||||
static GdkPaintableFlags
|
||||
@@ -664,7 +681,8 @@ gdk_empty_paintable_init (GdkEmptyPaintable *self)
|
||||
* This is often useful for implementing the
|
||||
* [vfunc@Gdk.Paintable.get_current_image] virtual function
|
||||
* when the paintable is in an incomplete state (like a
|
||||
* [class@Gtk.MediaStream] before receiving the first frame).
|
||||
* [GtkMediaStream](../gtk4/class.MediaStream.html) before receiving
|
||||
* the first frame).
|
||||
*
|
||||
* Returns: (transfer full): a `GdkPaintable`
|
||||
*/
|
||||
|
||||
@@ -40,7 +40,7 @@ struct _GdkIOPipe
|
||||
GCond cond;
|
||||
guchar *buffer;
|
||||
gsize size;
|
||||
GdkIOPipeState state : 2;
|
||||
guint state : 2; /* GdkIOPipeState */
|
||||
guint input_closed : 1;
|
||||
guint output_closed : 1;
|
||||
};
|
||||
|
||||
@@ -56,9 +56,9 @@
|
||||
* [method@Gdk.Popup.get_position_x], [method@Gdk.Popup.get_position_y],
|
||||
* [method@Gdk.Popup.get_rect_anchor] and [method@Gdk.Popup.get_surface_anchor]
|
||||
* after the popup has been presented. This can be used to adjust the rendering.
|
||||
* For example, [class@Gtk.Popover] changes its arrow position accordingly.
|
||||
* But you have to be careful avoid changing the size of the popover, or it
|
||||
* has to be presented again.
|
||||
* For example, [GtkPopover](../gtk4/class.Popover.html) changes its arrow position
|
||||
* accordingly. But you have to be careful avoid changing the size of the popover,
|
||||
* or it has to be presented again.
|
||||
*/
|
||||
|
||||
struct _GdkPopupLayout
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@
|
||||
*
|
||||
* Base type for snapshot operations.
|
||||
*
|
||||
* The subclass of `GdkSnapshot` used by GTK is [class@Gtk.Snapshot].
|
||||
* The subclass of `GdkSnapshot` used by GTK is [GtkSnapshot](../gtk4/class.Snapshot.html).
|
||||
*/
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE (GdkSnapshot, gdk_snapshot, G_TYPE_OBJECT)
|
||||
|
||||
+3
-3
@@ -56,7 +56,7 @@
|
||||
* A `GdkSurface` is a rectangular region on the screen.
|
||||
*
|
||||
* It’s a low-level object, used to implement high-level objects
|
||||
* such as [class@Gtk.Window] or [class@Gtk.Dialog] in GTK.
|
||||
* such as [GtkWindow](../gtk4/class.Window.html).
|
||||
*
|
||||
* The surfaces you see in practice are either [iface@Gdk.Toplevel] or
|
||||
* [iface@Gdk.Popup], and those interfaces provide much of the required
|
||||
@@ -1700,7 +1700,7 @@ gdk_surface_get_device_position (GdkSurface *surface,
|
||||
* For toplevel surfaces, withdraws them, so they will no longer be
|
||||
* known to the window manager; for all surfaces, unmaps them, so
|
||||
* they won’t be displayed. Normally done automatically as
|
||||
* part of [method@Gtk.Widget.hide].
|
||||
* part of [gtk_widget_hide()](../gtk4/method.Widget.hide.html).
|
||||
*/
|
||||
void
|
||||
gdk_surface_hide (GdkSurface *surface)
|
||||
@@ -2620,7 +2620,7 @@ gdk_surface_get_scale (GdkSurface *surface)
|
||||
* GTK will update this property automatically if the @surface background
|
||||
* is opaque, as we know where the opaque regions are. If your surface
|
||||
* background is not opaque, please update this property in your
|
||||
* [vfunc@Gtk.Widget.css_changed] handler.
|
||||
* [GtkWidgetClass.css_changed](../gtk4/vfunc.Widget.css_changed.html) handler.
|
||||
*/
|
||||
void
|
||||
gdk_surface_set_opaque_region (GdkSurface *surface,
|
||||
|
||||
+5
-3
@@ -345,7 +345,9 @@ gdk_texture_init (GdkTexture *self)
|
||||
*
|
||||
* Creates a new texture object representing the surface.
|
||||
*
|
||||
* @surface must be an image surface with format `CAIRO_FORMAT_ARGB32`.
|
||||
* The @surface must be an image surface with format `CAIRO_FORMAT_ARGB32`.
|
||||
*
|
||||
* The newly created texture will acquire a reference on the @surface.
|
||||
*
|
||||
* Returns: a new `GdkTexture`
|
||||
*/
|
||||
@@ -364,7 +366,7 @@ gdk_texture_new_for_surface (cairo_surface_t *surface)
|
||||
* cairo_image_surface_get_stride (surface),
|
||||
(GDestroyNotify) cairo_surface_destroy,
|
||||
cairo_surface_reference (surface));
|
||||
|
||||
|
||||
texture = gdk_memory_texture_new (cairo_image_surface_get_width (surface),
|
||||
cairo_image_surface_get_height (surface),
|
||||
GDK_MEMORY_DEFAULT,
|
||||
@@ -819,7 +821,7 @@ gdk_texture_set_render_data (GdkTexture *self,
|
||||
GDestroyNotify notify)
|
||||
{
|
||||
g_return_val_if_fail (data != NULL, FALSE);
|
||||
|
||||
|
||||
if (self->render_key != NULL)
|
||||
return FALSE;
|
||||
|
||||
|
||||
+7
-6
@@ -377,8 +377,9 @@ gdk_toplevel_lower (GdkToplevel *toplevel)
|
||||
*
|
||||
* Sets keyboard focus to @surface.
|
||||
*
|
||||
* In most cases, [method@Gtk.Window.present_with_time] should be
|
||||
* used on a [class@Gtk.Window], rather than calling this function.
|
||||
* In most cases, [gtk_window_present_with_time()](../gtk4/method.Window.present_with_time.html)
|
||||
* should be used on a [GtkWindow](../gtk4/class.Window.html), rather than
|
||||
* calling this function.
|
||||
*/
|
||||
void
|
||||
gdk_toplevel_focus (GdkToplevel *toplevel,
|
||||
@@ -437,8 +438,8 @@ gdk_toplevel_set_title (GdkToplevel *toplevel,
|
||||
* Sets the startup notification ID.
|
||||
*
|
||||
* When using GTK, typically you should use
|
||||
* [method@Gtk.Window.set_startup_id] instead of this
|
||||
* low-level function.
|
||||
* [gtk_window_set_startup_id()](../gtk4/method.Window.set_startup_id.html)
|
||||
* instead of this low-level function.
|
||||
*/
|
||||
void
|
||||
gdk_toplevel_set_startup_id (GdkToplevel *toplevel,
|
||||
@@ -461,8 +462,8 @@ gdk_toplevel_set_startup_id (GdkToplevel *toplevel,
|
||||
* allows the window manager to do things like center @surface
|
||||
* on @parent and keep @surface above @parent.
|
||||
*
|
||||
* See [method@Gtk.Window.set_transient_for] if you’re using
|
||||
* [class@Gtk.Window] or [class@Gtk.Dialog].
|
||||
* See [gtk_window_set_transient_for()](../gtk4/method.Window.set_transient_for.html)
|
||||
* if you’re using [GtkWindow](../gtk4/class.Window.html).
|
||||
*/
|
||||
void
|
||||
gdk_toplevel_set_transient_for (GdkToplevel *toplevel,
|
||||
|
||||
+11
-5
@@ -137,8 +137,9 @@ gdk_load_png (GBytes *bytes,
|
||||
png_struct *png = NULL;
|
||||
png_info *info;
|
||||
guint width, height;
|
||||
gsize i, stride;
|
||||
int depth, color_type;
|
||||
int interlace, stride;
|
||||
int interlace;
|
||||
GdkMemoryFormat format;
|
||||
guchar *buffer = NULL;
|
||||
guchar **row_pointers = NULL;
|
||||
@@ -263,9 +264,14 @@ gdk_load_png (GBytes *bytes,
|
||||
}
|
||||
|
||||
bpp = gdk_memory_format_bytes_per_pixel (format);
|
||||
stride = width * bpp;
|
||||
if (stride % 8)
|
||||
stride += 8 - stride % 8;
|
||||
if (!g_size_checked_mul (&stride, width, bpp) ||
|
||||
!g_size_checked_add (&stride, stride, (8 - stride % 8) % 8))
|
||||
{
|
||||
g_set_error (error,
|
||||
GDK_TEXTURE_ERROR, GDK_TEXTURE_ERROR_TOO_LARGE,
|
||||
_("Image stride too large for image size %ux%u"), width, height);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
buffer = g_try_malloc_n (height, stride);
|
||||
row_pointers = g_try_malloc_n (height, sizeof (char *));
|
||||
@@ -281,7 +287,7 @@ gdk_load_png (GBytes *bytes,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (int i = 0; i < height; i++)
|
||||
for (i = 0; i < height; i++)
|
||||
row_pointers[i] = &buffer[i * stride];
|
||||
|
||||
png_read_image (png, row_pointers);
|
||||
|
||||
@@ -188,6 +188,14 @@ copy_surface_data (GdkMacosBuffer *from,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
clamp_region_to_surface (cairo_region_t *region,
|
||||
GdkSurface *surface)
|
||||
{
|
||||
cairo_rectangle_int_t rectangle = {0, 0, surface->width, surface->height};
|
||||
cairo_region_intersect_rectangle (region, &rectangle);
|
||||
}
|
||||
|
||||
static void
|
||||
_gdk_macos_cairo_context_begin_frame (GdkDrawContext *draw_context,
|
||||
GdkMemoryDepth depth,
|
||||
@@ -205,6 +213,8 @@ _gdk_macos_cairo_context_begin_frame (GdkDrawContext *draw_context,
|
||||
surface = GDK_MACOS_SURFACE (gdk_draw_context_get_surface (draw_context));
|
||||
buffer = _gdk_macos_surface_get_buffer (surface);
|
||||
|
||||
clamp_region_to_surface (region, GDK_SURFACE (surface));
|
||||
|
||||
_gdk_macos_buffer_set_damage (buffer, region);
|
||||
_gdk_macos_buffer_set_flipped (buffer, FALSE);
|
||||
|
||||
|
||||
@@ -27,10 +27,6 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#ifndef AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER
|
||||
typedef NSString *NSPasteboardType;
|
||||
#endif
|
||||
|
||||
#define GDK_TYPE_MACOS_CLIPBOARD (_gdk_macos_clipboard_get_type())
|
||||
|
||||
G_DECLARE_FINAL_TYPE (GdkMacosClipboard, _gdk_macos_clipboard, GDK, MACOS_CLIPBOARD, GdkClipboard)
|
||||
|
||||
@@ -90,7 +90,7 @@ struct _GdkMacosDisplay
|
||||
/* Note if we have a key window that is not a GdkMacosWindow
|
||||
* such as a NSPanel used for native dialogs.
|
||||
*/
|
||||
guint key_window_is_foregin : 1;
|
||||
guint key_window_is_foreign : 1;
|
||||
};
|
||||
|
||||
struct _GdkMacosDisplayClass
|
||||
|
||||
@@ -1265,6 +1265,14 @@ _gdk_macos_display_translate (GdkMacosDisplay *self,
|
||||
_gdk_macos_display_clear_sorting (self);
|
||||
}
|
||||
}
|
||||
else if (is_motion_event(event_type))
|
||||
{
|
||||
NSWindow *orig_window = [nsevent window];
|
||||
|
||||
if (orig_window && GDK_IS_MACOS_WINDOW (orig_window))
|
||||
[NSApp sendEvent:nsevent];
|
||||
}
|
||||
|
||||
return fill_event (self, window, nsevent, x, y);
|
||||
}
|
||||
|
||||
|
||||
@@ -424,7 +424,7 @@ select_key_in_idle_cb (gpointer data)
|
||||
self->select_key_in_idle = 0;
|
||||
|
||||
/* Don't steal focus from NSPanel, etc */
|
||||
if (self->key_window_is_foregin)
|
||||
if (self->key_window_is_foreign)
|
||||
return G_SOURCE_REMOVE;
|
||||
|
||||
if (self->keyboard_surface == NULL)
|
||||
@@ -941,7 +941,7 @@ _gdk_macos_display_get_surfaces (GdkMacosDisplay *self)
|
||||
NSArray *array = [NSApp orderedWindows];
|
||||
GQueue sorted = G_QUEUE_INIT;
|
||||
|
||||
self->key_window_is_foregin = FALSE;
|
||||
self->key_window_is_foreign = FALSE;
|
||||
|
||||
for (id obj in array)
|
||||
{
|
||||
@@ -949,7 +949,7 @@ _gdk_macos_display_get_surfaces (GdkMacosDisplay *self)
|
||||
GdkMacosSurface *surface;
|
||||
|
||||
if ([nswindow isKeyWindow])
|
||||
self->key_window_is_foregin = !GDK_IS_MACOS_WINDOW (nswindow);
|
||||
self->key_window_is_foreign = !GDK_IS_MACOS_WINDOW (nswindow);
|
||||
|
||||
if (!GDK_IS_MACOS_WINDOW (nswindow))
|
||||
continue;
|
||||
|
||||
@@ -27,9 +27,7 @@
|
||||
#include "gdkmacosdisplay.h"
|
||||
#include "gdkmacossurface.h"
|
||||
|
||||
#import <OpenGL/OpenGL.h>
|
||||
#import <OpenGL/gl3.h>
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <epoxy/gl.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
#include "gdkconfig.h"
|
||||
|
||||
#include <OpenGL/gl3.h>
|
||||
#include <OpenGL/CGLIOSurface.h>
|
||||
#include <QuartzCore/QuartzCore.h>
|
||||
|
||||
@@ -499,7 +498,7 @@ gdk_macos_gl_context_begin_frame (GdkDrawContext *context,
|
||||
gdk_gl_context_make_current (GDK_GL_CONTEXT (self));
|
||||
gdk_macos_gl_context_allocate (self);
|
||||
|
||||
GDK_DRAW_CONTEXT_CLASS (gdk_macos_gl_context_parent_class)->begin_frame (context, prefers_high_depth, region);
|
||||
GDK_DRAW_CONTEXT_CLASS (gdk_macos_gl_context_parent_class)->begin_frame (context, depth, region);
|
||||
|
||||
gdk_gl_context_make_current (GDK_GL_CONTEXT (self));
|
||||
CHECK_GL (NULL, glBindFramebuffer (GL_FRAMEBUFFER, self->fbo));
|
||||
|
||||
@@ -331,7 +331,7 @@ _gdk_macos_monitor_reconfigure (GdkMacosMonitor *self)
|
||||
gdk_monitor_set_physical_size (GDK_MONITOR (self), width_mm, height_mm);
|
||||
gdk_monitor_set_scale_factor (GDK_MONITOR (self), scale_factor);
|
||||
gdk_monitor_set_refresh_rate (GDK_MONITOR (self), refresh_rate);
|
||||
gdk_monitor_set_subpixel_layout (GDK_MONITOR (self), GDK_SUBPIXEL_LAYOUT_UNKNOWN);
|
||||
gdk_monitor_set_subpixel_layout (GDK_MONITOR (self), subpixel_layout);
|
||||
|
||||
self->workarea = [screen visibleFrame];
|
||||
|
||||
|
||||
@@ -26,6 +26,10 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#ifndef AVAILABLE_MAC_OS_X_VERSION_10_13_AND_LATER
|
||||
typedef NSString *NSPasteboardType;
|
||||
#endif
|
||||
|
||||
@interface GdkMacosPasteboardItemDataProvider : NSObject <NSPasteboardItemDataProvider>
|
||||
{
|
||||
GdkContentProvider *_contentProvider;
|
||||
|
||||
@@ -400,7 +400,7 @@ _gdk_macos_pasteboard_register_drag_types (NSWindow *window)
|
||||
gdk_content_formats_get_gtypes (formats, &n_gtypes);
|
||||
|
||||
if (n_gtypes)
|
||||
[ret addObject:NSPasteboardTypeURL];
|
||||
[ret addObject:PTYPE(URL)];
|
||||
|
||||
gdk_content_formats_unref (formats);
|
||||
}
|
||||
|
||||
@@ -46,6 +46,21 @@ static const struct xdg_activation_token_v1_listener token_listener = {
|
||||
token_done,
|
||||
};
|
||||
|
||||
static struct wl_surface *
|
||||
peek_launcher_toplevel (GdkSeat *seat)
|
||||
{
|
||||
struct wl_surface *wl_surface = NULL;
|
||||
GdkSurface *focus_surface;
|
||||
|
||||
focus_surface = gdk_wayland_device_get_focus (gdk_seat_get_keyboard (seat));
|
||||
while (focus_surface && focus_surface->parent)
|
||||
focus_surface = focus_surface->parent;
|
||||
if (focus_surface)
|
||||
wl_surface = gdk_wayland_surface_get_wl_surface (focus_surface);
|
||||
|
||||
return wl_surface;
|
||||
}
|
||||
|
||||
static char *
|
||||
gdk_wayland_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
|
||||
GAppInfo *info,
|
||||
@@ -62,7 +77,6 @@ gdk_wayland_app_launch_context_get_startup_notify_id (GAppLaunchContext *context
|
||||
struct wl_event_queue *event_queue;
|
||||
struct wl_surface *wl_surface = NULL;
|
||||
GdkWaylandSeat *seat;
|
||||
GdkSurface *focus_surface;
|
||||
AppLaunchData app_launch_data = { 0 };
|
||||
|
||||
event_queue = wl_display_create_queue (display->wl_display);
|
||||
@@ -78,9 +92,7 @@ gdk_wayland_app_launch_context_get_startup_notify_id (GAppLaunchContext *context
|
||||
_gdk_wayland_seat_get_last_implicit_grab_serial (seat, NULL),
|
||||
gdk_wayland_seat_get_wl_seat (GDK_SEAT (seat)));
|
||||
|
||||
focus_surface = gdk_wayland_device_get_focus (gdk_seat_get_keyboard (GDK_SEAT (seat)));
|
||||
if (focus_surface)
|
||||
wl_surface = gdk_wayland_surface_get_wl_surface (focus_surface);
|
||||
wl_surface = peek_launcher_toplevel (GDK_SEAT (seat));
|
||||
if (wl_surface)
|
||||
xdg_activation_token_v1_set_surface (token, wl_surface);
|
||||
|
||||
@@ -93,7 +105,8 @@ gdk_wayland_app_launch_context_get_startup_notify_id (GAppLaunchContext *context
|
||||
id = app_launch_data.token;
|
||||
wl_event_queue_destroy (event_queue);
|
||||
}
|
||||
else if (gtk_shell1_get_version (display->gtk_shell) >= GTK_SHELL1_NOTIFY_LAUNCH_SINCE_VERSION)
|
||||
else if (display->gtk_shell &&
|
||||
gtk_shell1_get_version (display->gtk_shell) >= GTK_SHELL1_NOTIFY_LAUNCH_SINCE_VERSION)
|
||||
{
|
||||
id = g_uuid_string_random ();
|
||||
gtk_shell1_notify_launch (display->gtk_shell, id);
|
||||
|
||||
@@ -245,7 +245,7 @@ gdk_wayland_clipboard_read_async (GdkClipboard *clipboard,
|
||||
|
||||
g_task_set_task_data (task, (gpointer) mime_type, NULL);
|
||||
|
||||
if (!g_unix_open_pipe (pipe_fd, FD_CLOEXEC, &error))
|
||||
if (!g_unix_open_pipe (pipe_fd, O_CLOEXEC, &error))
|
||||
{
|
||||
g_task_return_error (task, error);
|
||||
return;
|
||||
|
||||
@@ -175,7 +175,7 @@ _gdk_wayland_cursor_get_buffer (GdkWaylandDisplay *display,
|
||||
_gdk_wayland_display_get_cursor_theme (display),
|
||||
desired_scale,
|
||||
gdk_cursor_get_name (cursor));
|
||||
if (c)
|
||||
if (c && c->image_count > 0)
|
||||
{
|
||||
struct wl_cursor_image *image;
|
||||
int cursor_scale;
|
||||
|
||||
@@ -96,6 +96,12 @@
|
||||
#define XDG_ACTIVATION_VERSION 1
|
||||
#define OUTPUT_VERSION 3
|
||||
|
||||
#ifdef HAVE_TOPLEVEL_STATE_SUSPENDED
|
||||
#define XDG_WM_BASE_VERSION 6
|
||||
#else
|
||||
#define XDG_WM_BASE_VERSION 5
|
||||
#endif
|
||||
|
||||
static void _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *display_wayland);
|
||||
|
||||
G_DEFINE_TYPE (GdkWaylandDisplay, gdk_wayland_display, GDK_TYPE_DISPLAY)
|
||||
@@ -638,7 +644,8 @@ _gdk_wayland_display_open (const char *display_name)
|
||||
wl_registry_bind (display_wayland->wl_registry,
|
||||
display_wayland->xdg_wm_base_id,
|
||||
&xdg_wm_base_interface,
|
||||
MIN (display_wayland->xdg_wm_base_version, 4));
|
||||
MIN (display_wayland->xdg_wm_base_version,
|
||||
XDG_WM_BASE_VERSION));
|
||||
xdg_wm_base_add_listener (display_wayland->xdg_wm_base,
|
||||
&xdg_wm_base_listener,
|
||||
display_wayland);
|
||||
|
||||
@@ -210,7 +210,7 @@ gdk_wayland_drop_read_async (GdkDrop *drop,
|
||||
|
||||
g_task_set_task_data (task, (gpointer) mime_type, NULL);
|
||||
|
||||
if (!g_unix_open_pipe (pipe_fd, FD_CLOEXEC, &error))
|
||||
if (!g_unix_open_pipe (pipe_fd, O_CLOEXEC, &error))
|
||||
{
|
||||
g_task_return_error (task, error);
|
||||
return;
|
||||
|
||||
@@ -348,7 +348,7 @@ gdk_wayland_primary_read_async (GdkClipboard *clipboard,
|
||||
|
||||
g_task_set_task_data (task, (gpointer) mime_type, NULL);
|
||||
|
||||
if (!g_unix_open_pipe (pipe_fd, FD_CLOEXEC, &error))
|
||||
if (!g_unix_open_pipe (pipe_fd, O_CLOEXEC, &error))
|
||||
{
|
||||
g_task_return_error (task, error);
|
||||
return;
|
||||
|
||||
@@ -2880,6 +2880,7 @@ tablet_tool_handle_proximity_out (void *data,
|
||||
|
||||
gdk_device_update_tool (tablet->stylus_device, NULL);
|
||||
g_clear_object (&tablet->pointer_info.cursor);
|
||||
tablet->pointer_info.cursor_is_default = FALSE;
|
||||
}
|
||||
|
||||
static double *
|
||||
|
||||
@@ -672,10 +672,18 @@ xdg_toplevel_configure_bounds (void *data,
|
||||
toplevel->pending.has_bounds = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
xdg_toplevel_wm_capabilities (void *data,
|
||||
struct xdg_toplevel *xdg_toplevel,
|
||||
struct wl_array *capabilities)
|
||||
{
|
||||
}
|
||||
|
||||
static const struct xdg_toplevel_listener xdg_toplevel_listener = {
|
||||
xdg_toplevel_configure,
|
||||
xdg_toplevel_close,
|
||||
xdg_toplevel_configure_bounds,
|
||||
xdg_toplevel_wm_capabilities,
|
||||
};
|
||||
|
||||
static void
|
||||
|
||||
@@ -127,3 +127,6 @@ libgdk_wayland = static_library('gdk-wayland',
|
||||
link_with: [ libwayland_cursor, ],
|
||||
dependencies: [ gdk_deps, gdk_wayland_deps ],
|
||||
)
|
||||
|
||||
# Used to generate pkg-config Requires
|
||||
wayland_public_deps = [wlclientdep]
|
||||
|
||||
@@ -149,7 +149,7 @@ GTK might also call gdk_clipboard_store_async(), which instructs
|
||||
the W32 backend to put the data into the OS clipboard manager by
|
||||
sending WM_RENDERALLFORMATS to itself and then handling it normally.
|
||||
|
||||
Every time W32 backend gets WM_DRAWCLIPBOARD or WM_CLIPBOARDUPDATE,
|
||||
Every time W32 backend gets WM_CLIPBOARDUPDATE,
|
||||
it calls GetUpdatedClipboardFormats() and GetClipboardSequenceNumber()
|
||||
and caches the results of both. These calls do not require the clipboard
|
||||
to be opened.
|
||||
@@ -245,7 +245,7 @@ When clipboard owner changes, the old owner receives WM_DESTROYCLIPBOARD message
|
||||
the clipboard thread schedules a call to gdk_clipboard_claim_remote()
|
||||
in the main thread, with an empty list of formats,
|
||||
to indicate that the clipboard is now owned by a remote process.
|
||||
Later the OS will send WM_DRAWCLIPBOARD or WM_CLIPBOARDUPDATE to indicate
|
||||
Later the OS will send WM_CLIPBOARDUPDATE to indicate
|
||||
the new clipboard contents (see above).
|
||||
|
||||
DND:
|
||||
@@ -416,8 +416,6 @@ struct _GdkWin32ClipboardThread
|
||||
*/
|
||||
HWND clipboard_opened_for;
|
||||
|
||||
HWND hwnd_next_viewer;
|
||||
|
||||
/* We can't peek the queue or "unpop" queue items,
|
||||
* so the items that we can't act upon (yet) got
|
||||
* to be stored *somewhere*.
|
||||
@@ -1171,7 +1169,7 @@ inner_clipboard_window_procedure (HWND hwnd,
|
||||
|
||||
switch (message)
|
||||
{
|
||||
case WM_DESTROY: /* remove us from chain */
|
||||
case WM_DESTROY: /* unregister the clipboard listener */
|
||||
{
|
||||
if (clipboard_thread_data == NULL)
|
||||
{
|
||||
@@ -1179,34 +1177,15 @@ inner_clipboard_window_procedure (HWND hwnd,
|
||||
return DefWindowProcW (hwnd, message, wparam, lparam);
|
||||
}
|
||||
|
||||
ChangeClipboardChain (hwnd, clipboard_thread_data->hwnd_next_viewer);
|
||||
RemoveClipboardFormatListener (hwnd);
|
||||
PostQuitMessage (0);
|
||||
return 0;
|
||||
}
|
||||
case WM_CHANGECBCHAIN:
|
||||
{
|
||||
HWND hwndRemove = (HWND) wparam; /* handle of window being removed */
|
||||
HWND hwndNext = (HWND) lparam; /* handle of next window in chain */
|
||||
|
||||
if (clipboard_thread_data == NULL)
|
||||
{
|
||||
g_warning ("Clipboard thread got an actionable message with no thread data");
|
||||
return DefWindowProcW (hwnd, message, wparam, lparam);
|
||||
}
|
||||
|
||||
if (hwndRemove == clipboard_thread_data->hwnd_next_viewer)
|
||||
clipboard_thread_data->hwnd_next_viewer = hwndNext == hwnd ? NULL : hwndNext;
|
||||
else if (clipboard_thread_data->hwnd_next_viewer != NULL)
|
||||
return SendMessage (clipboard_thread_data->hwnd_next_viewer, message, wparam, lparam);
|
||||
|
||||
return 0;
|
||||
}
|
||||
case WM_DESTROYCLIPBOARD:
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
case WM_CLIPBOARDUPDATE:
|
||||
case WM_DRAWCLIPBOARD:
|
||||
{
|
||||
HWND hwnd_owner;
|
||||
HWND hwnd_opener;
|
||||
@@ -1272,9 +1251,6 @@ inner_clipboard_window_procedure (HWND hwnd,
|
||||
g_idle_add_full (G_PRIORITY_DEFAULT, clipboard_owner_changed, NULL, NULL);
|
||||
}
|
||||
|
||||
if (clipboard_thread_data->hwnd_next_viewer != NULL)
|
||||
return SendMessage (clipboard_thread_data->hwnd_next_viewer, message, wparam, lparam);
|
||||
|
||||
/* clear error to avoid confusing SetClipboardViewer() return */
|
||||
SetLastError (0);
|
||||
|
||||
@@ -1386,7 +1362,7 @@ inner_clipboard_window_procedure (HWND hwnd,
|
||||
* OpenClipboard() is required/possible
|
||||
*/
|
||||
GDK_NOTE (DND,
|
||||
g_print (" SetClipboardData (%s, %p)",
|
||||
g_print (" SetClipboardData (%s, %p)\n",
|
||||
_gdk_win32_cf_to_string (wparam),
|
||||
returned_render->main_thread_data_handle));
|
||||
|
||||
@@ -1426,7 +1402,7 @@ _clipboard_window_procedure (HWND hwnd,
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates a hidden window and adds it to the clipboard chain
|
||||
* Creates a hidden window and add a clipboard listener
|
||||
*/
|
||||
static gboolean
|
||||
register_clipboard_notification ()
|
||||
@@ -1452,9 +1428,8 @@ register_clipboard_notification ()
|
||||
goto failed;
|
||||
|
||||
SetLastError (0);
|
||||
clipboard_thread_data->hwnd_next_viewer = SetClipboardViewer (clipboard_thread_data->clipboard_window);
|
||||
|
||||
if (clipboard_thread_data->hwnd_next_viewer == NULL && GetLastError() != NO_ERROR)
|
||||
if (AddClipboardFormatListener (clipboard_thread_data->clipboard_window) == FALSE)
|
||||
{
|
||||
DestroyWindow (clipboard_thread_data->clipboard_window);
|
||||
goto failed;
|
||||
@@ -1462,11 +1437,6 @@ register_clipboard_notification ()
|
||||
|
||||
g_idle_add_full (G_PRIORITY_DEFAULT, clipboard_window_created, (gpointer) clipboard_thread_data->clipboard_window, NULL);
|
||||
|
||||
/* FIXME: http://msdn.microsoft.com/en-us/library/ms649033(v=VS.85).aspx */
|
||||
/* This is only supported by Vista, and not yet by mingw64 */
|
||||
/* if (AddClipboardFormatListener (hwnd) == FALSE) */
|
||||
/* goto failed; */
|
||||
|
||||
return TRUE;
|
||||
|
||||
failed:
|
||||
|
||||
@@ -286,15 +286,16 @@ _gdk_win32_display_init_monitors (GdkWin32Display *win32_display)
|
||||
GdkMonitor *ex_monitor;
|
||||
|
||||
w32_ex_monitor = GDK_WIN32_MONITOR (g_list_model_get_item (win32_display->monitors, i));
|
||||
g_object_unref (w32_ex_monitor);
|
||||
ex_monitor = GDK_MONITOR (w32_ex_monitor);
|
||||
|
||||
if (!w32_ex_monitor->remove)
|
||||
continue;
|
||||
if (w32_ex_monitor->remove)
|
||||
{
|
||||
w32_ex_monitor->hmonitor = NULL;
|
||||
g_list_store_remove (G_LIST_STORE (win32_display->monitors), i);
|
||||
gdk_monitor_invalidate (ex_monitor);
|
||||
}
|
||||
|
||||
w32_ex_monitor->hmonitor = NULL;
|
||||
g_list_store_remove (G_LIST_STORE (win32_display->monitors), i);
|
||||
gdk_monitor_invalidate (ex_monitor);
|
||||
g_object_unref (w32_ex_monitor);
|
||||
}
|
||||
|
||||
for (i = 0; i < new_monitors->len; i++)
|
||||
@@ -547,6 +548,9 @@ _gdk_win32_display_open (const char *display_name)
|
||||
|
||||
g_signal_emit_by_name (_gdk_display, "opened");
|
||||
|
||||
/* Precalculate keymap, see #6203 */
|
||||
(void) _gdk_win32_display_get_keymap (_gdk_display);
|
||||
|
||||
GDK_NOTE (MISC, g_print ("... _gdk_display now set up\n"));
|
||||
|
||||
return _gdk_display;
|
||||
@@ -1169,6 +1173,9 @@ gdk_win32_display_get_setting (GdkDisplay *display,
|
||||
const char *name,
|
||||
GValue *value)
|
||||
{
|
||||
if (gdk_display_get_debug_flags (display) & GDK_DEBUG_DEFAULT_SETTINGS)
|
||||
return FALSE;
|
||||
|
||||
return _gdk_win32_get_setting (name, value);
|
||||
}
|
||||
|
||||
|
||||
@@ -2857,7 +2857,10 @@ gdk_event_translate (MSG *msg,
|
||||
break;
|
||||
|
||||
case WM_SYSCOMMAND:
|
||||
switch (msg->wParam)
|
||||
/* From: https://learn.microsoft.com/en-us/windows/win32/menurc/wm-syscommand?redirectedfrom=MSDN
|
||||
* To obtain the correct result when testing the value of wParam,
|
||||
* an application must combine the value 0xFFF0 with the wParam value by using the bitwise AND operator. */
|
||||
switch (msg->wParam & 0xFFF0)
|
||||
{
|
||||
case SC_MINIMIZE:
|
||||
case SC_RESTORE:
|
||||
@@ -2964,6 +2967,14 @@ gdk_event_translate (MSG *msg,
|
||||
windowpos = (WINDOWPOS *) msg->lParam;
|
||||
windowpos->cx = our_mmi.ptMaxSize.x;
|
||||
windowpos->cy = our_mmi.ptMaxSize.y;
|
||||
|
||||
if (!_gdk_win32_surface_lacks_wm_decorations (window) &&
|
||||
!(windowpos->flags & SWP_NOCLIENTSIZE) &&
|
||||
window->width == impl->next_layout.configured_width &&
|
||||
window->height == impl->next_layout.configured_height)
|
||||
{
|
||||
impl->inhibit_configure = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
impl->maximizing = FALSE;
|
||||
|
||||
@@ -126,9 +126,6 @@ gdk_win32_gl_context_wgl_begin_frame (GdkDrawContext *draw_context,
|
||||
GDK_DRAW_CONTEXT_CLASS (gdk_win32_gl_context_wgl_parent_class)->begin_frame (draw_context, depth, update_area);
|
||||
}
|
||||
|
||||
static int
|
||||
gdk_init_dummy_wgl_context (GdkWin32Display *display_win32);
|
||||
|
||||
#define PIXEL_ATTRIBUTES 17
|
||||
|
||||
static int
|
||||
@@ -178,7 +175,6 @@ get_wgl_pfd (HDC hdc,
|
||||
|
||||
pixelAttribs[i++] = 0; /* end of pixelAttribs */
|
||||
g_assert (i <= PIXEL_ATTRIBUTES);
|
||||
best_pf = gdk_init_dummy_wgl_context (display_win32);
|
||||
|
||||
if (!wglMakeCurrent (display_win32->dummy_context_wgl.hdc,
|
||||
display_win32->dummy_context_wgl.hglrc))
|
||||
|
||||
@@ -1230,18 +1230,11 @@ get_effective_window_decorations (GdkSurface *window,
|
||||
|
||||
*decoration |= GDK_DECOR_MINIMIZE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else if (impl->hint_flags & GDK_HINT_MAX_SIZE)
|
||||
{
|
||||
*decoration = GDK_DECOR_ALL | GDK_DECOR_MAXIMIZE;
|
||||
*decoration |= GDK_DECOR_MINIMIZE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
*decoration = (GDK_DECOR_ALL | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE);
|
||||
*decoration = GDK_DECOR_ALL;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -4449,6 +4442,10 @@ _gdk_win32_surface_request_layout (GdkSurface *surface)
|
||||
{
|
||||
_gdk_win32_get_window_rect (surface, &rect);
|
||||
|
||||
/* Keep current position if rect is invalid (i.e. queried in bad context) */
|
||||
if (rect.right == rect.left || rect.bottom == rect.top)
|
||||
return;
|
||||
|
||||
impl->next_layout.configured_width = (rect.right - rect.left + scale - 1) / scale;
|
||||
impl->next_layout.configured_height = (rect.bottom - rect.top + scale - 1) / scale;
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ gdk_x11_clipboard_formats_to_targets (GdkContentFormats *formats)
|
||||
continue;
|
||||
|
||||
if (g_str_equal (mime_types[i], special_targets[j].mime_type))
|
||||
targets = g_slist_prepend (targets, (gpointer) g_intern_string (special_targets[j].x_target));
|
||||
targets = g_slist_prepend (targets, (gpointer) g_intern_static_string (special_targets[j].x_target));
|
||||
}
|
||||
targets = g_slist_prepend (targets, (gpointer) mime_types[i]);
|
||||
}
|
||||
@@ -238,6 +238,8 @@ gdk_x11_clipboard_formats_to_atoms (GdkDisplay *display,
|
||||
for (l = targets; l; l = l->next)
|
||||
atoms[i++] = gdk_x11_get_xatom_by_name_for_display (display, l->data);
|
||||
|
||||
g_slist_free (targets);
|
||||
|
||||
return atoms;
|
||||
}
|
||||
|
||||
|
||||
@@ -86,3 +86,5 @@ libgdk_x11 = static_library('gdk-x11',
|
||||
] + common_cflags,
|
||||
dependencies: [ gdk_deps, gdk_x11_deps, ],
|
||||
)
|
||||
|
||||
x11_public_deps = [x11_dep]
|
||||
|
||||
@@ -451,7 +451,7 @@ get_colorized_texture (GdkTexture *texture,
|
||||
const graphene_matrix_t *color_matrix,
|
||||
const graphene_vec4_t *color_offset)
|
||||
{
|
||||
cairo_surface_t *surface = gdk_texture_download_surface (texture);
|
||||
cairo_surface_t *surface;
|
||||
cairo_surface_t *image_surface;
|
||||
graphene_vec4_t pixel;
|
||||
guint32* pixel_data;
|
||||
@@ -473,6 +473,7 @@ get_colorized_texture (GdkTexture *texture,
|
||||
return g_object_ref (colorized->texture);
|
||||
}
|
||||
|
||||
surface = gdk_texture_download_surface (texture);
|
||||
image_surface = cairo_surface_map_to_image (surface, NULL);
|
||||
data = cairo_image_surface_get_data (image_surface);
|
||||
width = cairo_image_surface_get_width (image_surface);
|
||||
@@ -534,6 +535,8 @@ get_colorized_texture (GdkTexture *texture,
|
||||
colorized_list, (GDestroyNotify)colorized_texture_free_list);
|
||||
}
|
||||
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
return colorized_texture;
|
||||
}
|
||||
|
||||
@@ -609,7 +612,7 @@ gsk_broadway_renderer_add_node (GskRenderer *renderer,
|
||||
}
|
||||
|
||||
texture = gdk_texture_new_for_surface (image_surface);
|
||||
g_ptr_array_add (self->node_textures, g_object_ref (texture)); /* Transfers ownership to node_textures */
|
||||
g_ptr_array_add (self->node_textures, texture); /* Transfers ownership to node_textures */
|
||||
texture_id = gdk_broadway_display_ensure_texture (display, texture);
|
||||
|
||||
add_rect (nodes, &node->bounds, offset_x, offset_y);
|
||||
@@ -898,6 +901,8 @@ gsk_broadway_renderer_add_node (GskRenderer *renderer,
|
||||
add_float (nodes, width);
|
||||
add_float (nodes, height);
|
||||
add_uint32 (nodes, texture_id);
|
||||
|
||||
cairo_surface_destroy (surface);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1070,7 +1070,7 @@ gsk_gl_command_queue_execute (GskGLCommandQueue *self,
|
||||
glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glBlendEquation (GL_FUNC_ADD);
|
||||
|
||||
if (!gdk_gl_context_get_use_es (self->context))
|
||||
if (gdk_gl_context_has_vertex_arrays (self->context))
|
||||
{
|
||||
glGenVertexArrays (1, &vao_id);
|
||||
glBindVertexArray (vao_id);
|
||||
@@ -1257,7 +1257,7 @@ gsk_gl_command_queue_execute (GskGLCommandQueue *self,
|
||||
}
|
||||
|
||||
glDeleteBuffers (1, &vbo_id);
|
||||
if (!gdk_gl_context_get_use_es (self->context))
|
||||
if (gdk_gl_context_has_vertex_arrays (self->context))
|
||||
glDeleteVertexArrays (1, &vao_id);
|
||||
|
||||
gdk_profiler_set_int_counter (self->metrics.n_binds, n_binds);
|
||||
@@ -1456,7 +1456,7 @@ memory_format_gl_format (GdkMemoryFormat data_format,
|
||||
guint *gl_internalformat,
|
||||
guint *gl_format,
|
||||
guint *gl_type,
|
||||
GLint (*gl_swizzle)[4])
|
||||
GLint gl_swizzle[4])
|
||||
{
|
||||
GdkMemoryDepth depth;
|
||||
|
||||
@@ -1577,7 +1577,7 @@ gsk_gl_command_queue_do_upload_texture_chunk (GskGLCommandQueue *self,
|
||||
&gl_internalformat,
|
||||
&gl_format,
|
||||
&gl_type,
|
||||
&gl_swizzle);
|
||||
gl_swizzle);
|
||||
|
||||
gdk_texture_downloader_init (&downloader, texture);
|
||||
gdk_texture_downloader_set_format (&downloader, data_format);
|
||||
@@ -1595,8 +1595,7 @@ gsk_gl_command_queue_do_upload_texture_chunk (GskGLCommandQueue *self,
|
||||
{
|
||||
glTexSubImage2D (GL_TEXTURE_2D, 0, x, y, width, height, gl_format, gl_type, data);
|
||||
}
|
||||
else if (stride % bpp == 0 &&
|
||||
(gdk_gl_context_check_version (self->context, NULL, "3.0") || gdk_gl_context_has_unpack_subimage (self->context)))
|
||||
else if (stride % bpp == 0 && gdk_gl_context_has_unpack_subimage (self->context))
|
||||
{
|
||||
glPixelStorei (GL_UNPACK_ROW_LENGTH, stride / bpp);
|
||||
|
||||
@@ -1684,7 +1683,7 @@ gsk_gl_command_queue_upload_texture_chunks (GskGLCommandQueue *self,
|
||||
&gl_internalformat,
|
||||
&gl_format,
|
||||
&gl_type,
|
||||
&gl_swizzle);
|
||||
gl_swizzle);
|
||||
|
||||
glTexImage2D (GL_TEXTURE_2D, 0, gl_internalformat, width, height, 0, gl_format, gl_type, NULL);
|
||||
|
||||
|
||||
@@ -1601,8 +1601,9 @@ create_texture_from_texture_destroy (gpointer data)
|
||||
}
|
||||
|
||||
GdkTexture *
|
||||
gsk_gl_driver_create_gdk_texture (GskGLDriver *self,
|
||||
guint texture_id)
|
||||
gsk_gl_driver_create_gdk_texture (GskGLDriver *self,
|
||||
guint texture_id,
|
||||
GdkMemoryFormat format)
|
||||
{
|
||||
GskGLTextureState *state;
|
||||
GdkGLTextureBuilder *builder;
|
||||
@@ -1630,6 +1631,7 @@ gsk_gl_driver_create_gdk_texture (GskGLDriver *self,
|
||||
builder = gdk_gl_texture_builder_new ();
|
||||
gdk_gl_texture_builder_set_context (builder, self->command_queue->context);
|
||||
gdk_gl_texture_builder_set_id (builder, texture_id);
|
||||
gdk_gl_texture_builder_set_format (builder, format);
|
||||
gdk_gl_texture_builder_set_width (builder, texture->width);
|
||||
gdk_gl_texture_builder_set_height (builder, texture->height);
|
||||
gdk_gl_texture_builder_set_sync (builder, state->sync);
|
||||
|
||||
@@ -149,7 +149,8 @@ void gsk_gl_driver_begin_frame (GskGLDriver *s
|
||||
void gsk_gl_driver_end_frame (GskGLDriver *self);
|
||||
void gsk_gl_driver_after_frame (GskGLDriver *self);
|
||||
GdkTexture * gsk_gl_driver_create_gdk_texture (GskGLDriver *self,
|
||||
guint texture_id);
|
||||
guint texture_id,
|
||||
GdkMemoryFormat format);
|
||||
void gsk_gl_driver_cache_texture (GskGLDriver *self,
|
||||
const GskTextureKey *key,
|
||||
guint texture_id);
|
||||
|
||||
@@ -119,7 +119,11 @@ gsk_gl_glyph_library_init_atlas (GskGLTextureLibrary *self,
|
||||
|
||||
memset (pixel_data, 255, sizeof pixel_data);
|
||||
|
||||
if (gdk_gl_context_get_use_es (gdk_gl_context_get_current ()))
|
||||
if (!gdk_gl_context_has_bgra (gdk_gl_context_get_current ())
|
||||
#if G_BYTE_ORDER == G_BIG_ENDIAN
|
||||
|| gdk_gl_context_get_use_es (gdk_gl_context_get_current ())
|
||||
#endif
|
||||
)
|
||||
{
|
||||
gl_format = GL_RGBA;
|
||||
gl_type = GL_UNSIGNED_BYTE;
|
||||
@@ -127,9 +131,8 @@ gsk_gl_glyph_library_init_atlas (GskGLTextureLibrary *self,
|
||||
else
|
||||
{
|
||||
gl_format = GL_BGRA;
|
||||
gl_type = GL_UNSIGNED_INT_8_8_8_8_REV;
|
||||
gl_type = GL_UNSIGNED_BYTE;
|
||||
}
|
||||
|
||||
glBindTexture (GL_TEXTURE_2D, atlas->texture_id);
|
||||
|
||||
glTexSubImage2D (GL_TEXTURE_2D, 0,
|
||||
@@ -277,7 +280,7 @@ gsk_gl_glyph_library_upload_glyph (GskGLGlyphLibrary *self,
|
||||
|
||||
g_assert (texture_id > 0);
|
||||
|
||||
if G_UNLIKELY (gdk_gl_context_get_use_es (gdk_gl_context_get_current ()))
|
||||
if (G_UNLIKELY (!gdk_gl_context_has_bgra (gdk_gl_context_get_current ())))
|
||||
{
|
||||
pixel_data = free_data = g_malloc (width * height * 4);
|
||||
gdk_memory_convert (pixel_data, width * 4,
|
||||
@@ -294,7 +297,7 @@ gsk_gl_glyph_library_upload_glyph (GskGLGlyphLibrary *self,
|
||||
{
|
||||
pixel_data = cairo_image_surface_get_data (surface);
|
||||
gl_format = GL_BGRA;
|
||||
gl_type = GL_UNSIGNED_INT_8_8_8_8_REV;
|
||||
gl_type = GL_UNSIGNED_BYTE;
|
||||
}
|
||||
|
||||
glPixelStorei (GL_UNPACK_ROW_LENGTH, stride / 4);
|
||||
|
||||
@@ -111,7 +111,11 @@ gsk_gl_icon_library_add (GskGLIconLibrary *self,
|
||||
gdk_gl_context_push_debug_group_printf (gdk_gl_context_get_current (),
|
||||
"Uploading texture");
|
||||
|
||||
if (gdk_gl_context_get_use_es (gdk_gl_context_get_current ()))
|
||||
if (!gdk_gl_context_has_bgra (gdk_gl_context_get_current ())
|
||||
#if G_BYTE_ORDER == G_BIG_ENDIAN
|
||||
|| gdk_gl_context_get_use_es (gdk_gl_context_get_current ())
|
||||
#endif
|
||||
)
|
||||
{
|
||||
pixel_data = free_data = g_malloc (width * height * 4);
|
||||
gdk_memory_convert (pixel_data, width * 4,
|
||||
@@ -125,7 +129,7 @@ gsk_gl_icon_library_add (GskGLIconLibrary *self,
|
||||
{
|
||||
pixel_data = surface_data;
|
||||
gl_format = GL_BGRA;
|
||||
gl_type = GL_UNSIGNED_INT_8_8_8_8_REV;
|
||||
gl_type = GL_UNSIGNED_BYTE;
|
||||
}
|
||||
|
||||
texture_id = GSK_GL_TEXTURE_ATLAS_ENTRY_TEXTURE (icon_data);
|
||||
@@ -144,6 +148,7 @@ gsk_gl_icon_library_add (GskGLIconLibrary *self,
|
||||
gl_format, gl_type,
|
||||
pixel_data);
|
||||
/* Padding left */
|
||||
glPixelStorei (GL_UNPACK_ROW_LENGTH, width);
|
||||
glTexSubImage2D (GL_TEXTURE_2D, 0,
|
||||
packed_x, packed_y + 1,
|
||||
1, height,
|
||||
@@ -157,7 +162,6 @@ gsk_gl_icon_library_add (GskGLIconLibrary *self,
|
||||
pixel_data);
|
||||
|
||||
/* Padding right */
|
||||
glPixelStorei (GL_UNPACK_ROW_LENGTH, width);
|
||||
glPixelStorei (GL_UNPACK_SKIP_PIXELS, width - 1);
|
||||
glTexSubImage2D (GL_TEXTURE_2D, 0,
|
||||
packed_x + width + 1, packed_y + 1,
|
||||
|
||||
+10
-3
@@ -332,6 +332,7 @@ gsk_gl_renderer_render_texture (GskRenderer *renderer,
|
||||
GskGLRenderJob *job;
|
||||
GdkTexture *texture;
|
||||
guint texture_id;
|
||||
GdkMemoryFormat gdk_format;
|
||||
int width, height, max_size;
|
||||
int format;
|
||||
|
||||
@@ -375,9 +376,15 @@ gsk_gl_renderer_render_texture (GskRenderer *renderer,
|
||||
|
||||
if (gsk_render_node_get_preferred_depth (root) != GDK_MEMORY_U8 &&
|
||||
gdk_gl_context_check_version (self->context, "3.0", "3.0"))
|
||||
format = GL_RGBA32F;
|
||||
{
|
||||
gdk_format = GDK_MEMORY_R32G32B32A32_FLOAT_PREMULTIPLIED;
|
||||
format = GL_RGBA32F;
|
||||
}
|
||||
else
|
||||
format = GL_RGBA8;
|
||||
{
|
||||
format = GL_RGBA8;
|
||||
gdk_format = GDK_MEMORY_R8G8B8A8_PREMULTIPLIED;
|
||||
}
|
||||
|
||||
gdk_gl_context_make_current (self->context);
|
||||
|
||||
@@ -394,7 +401,7 @@ gsk_gl_renderer_render_texture (GskRenderer *renderer,
|
||||
#endif
|
||||
gsk_gl_render_job_render_flipped (job, root);
|
||||
texture_id = gsk_gl_driver_release_render_target (self->driver, render_target, FALSE);
|
||||
texture = gsk_gl_driver_create_gdk_texture (self->driver, texture_id);
|
||||
texture = gsk_gl_driver_create_gdk_texture (self->driver, texture_id, gdk_format);
|
||||
gsk_gl_driver_end_frame (self->driver);
|
||||
gsk_gl_render_job_free (job);
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <gsk/gskrenderer.h>
|
||||
#include <gsk/gsk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
+102
-72
@@ -65,6 +65,14 @@ typedef struct _GskGLRenderClip
|
||||
guint is_fully_contained : 1;
|
||||
} GskGLRenderClip;
|
||||
|
||||
#define GDK_ARRAY_NAME clips
|
||||
#define GDK_ARRAY_TYPE_NAME Clips
|
||||
#define GDK_ARRAY_ELEMENT_TYPE GskGLRenderClip
|
||||
#define GDK_ARRAY_BY_VALUE 1
|
||||
#define GDK_ARRAY_PREALLOC 16
|
||||
#define GDK_ARRAY_NO_MEMSET
|
||||
#include "gdk/gdkarrayimpl.c"
|
||||
|
||||
typedef struct _GskGLRenderModelview
|
||||
{
|
||||
GskTransform *transform;
|
||||
@@ -77,6 +85,14 @@ typedef struct _GskGLRenderModelview
|
||||
graphene_matrix_t matrix;
|
||||
} GskGLRenderModelview;
|
||||
|
||||
#define GDK_ARRAY_NAME modelviews
|
||||
#define GDK_ARRAY_TYPE_NAME Modelviews
|
||||
#define GDK_ARRAY_ELEMENT_TYPE GskGLRenderModelview
|
||||
#define GDK_ARRAY_BY_VALUE 1
|
||||
#define GDK_ARRAY_PREALLOC 16
|
||||
#define GDK_ARRAY_NO_MEMSET
|
||||
#include "gdk/gdkarrayimpl.c"
|
||||
|
||||
struct _GskGLRenderJob
|
||||
{
|
||||
/* The context containing the framebuffer we are drawing to. Generally this
|
||||
@@ -117,12 +133,12 @@ struct _GskGLRenderJob
|
||||
/* An array of GskGLRenderModelview updated as nodes are processed. The
|
||||
* current modelview is the last element.
|
||||
*/
|
||||
GArray *modelview;
|
||||
Modelviews modelview;
|
||||
|
||||
/* An array of GskGLRenderClip updated as nodes are processed. The
|
||||
* current clip is the last element.
|
||||
*/
|
||||
GArray *clip;
|
||||
Clips clip;
|
||||
|
||||
/* Our current alpha state as we process nodes */
|
||||
float alpha;
|
||||
@@ -142,6 +158,8 @@ struct _GskGLRenderJob
|
||||
const GskGLRenderModelview *current_modelview;
|
||||
GskGLProgram *current_program;
|
||||
|
||||
guint source_is_glyph_atlas : 1;
|
||||
|
||||
/* If we should be rendering red zones over fallback nodes */
|
||||
guint debug_fallback : 1;
|
||||
|
||||
@@ -191,6 +209,22 @@ static gboolean gsk_gl_render_job_visit_node_with_offscreen (GskGLRenderJob
|
||||
const GskRenderNode *node,
|
||||
GskGLRenderOffscreen *offscreen);
|
||||
|
||||
static inline GskGLRenderClip *
|
||||
clips_grow_one (Clips *clips)
|
||||
{
|
||||
guint len = clips_get_size (clips);
|
||||
clips_set_size (clips, len + 1);
|
||||
return clips_get (clips, len);
|
||||
}
|
||||
|
||||
static inline GskGLRenderModelview *
|
||||
modelviews_grow_one (Modelviews *modelviews)
|
||||
{
|
||||
guint len = modelviews_get_size (modelviews);
|
||||
modelviews_set_size (modelviews, len + 1);
|
||||
return modelviews_get (modelviews, len);
|
||||
}
|
||||
|
||||
static inline int
|
||||
get_target_format (GskGLRenderJob *job,
|
||||
const GskRenderNode *node)
|
||||
@@ -236,7 +270,7 @@ gsk_rounded_rect_shrink_to_minimum (GskRoundedRect *self)
|
||||
static inline gboolean G_GNUC_PURE
|
||||
node_supports_2d_transform (const GskRenderNode *node)
|
||||
{
|
||||
switch (gsk_render_node_get_node_type (node))
|
||||
switch (GSK_RENDER_NODE_TYPE (node))
|
||||
{
|
||||
case GSK_COLOR_NODE:
|
||||
case GSK_OPACITY_NODE:
|
||||
@@ -296,7 +330,7 @@ node_supports_transform (const GskRenderNode *node)
|
||||
* opacity or color matrix.
|
||||
*/
|
||||
|
||||
switch (gsk_render_node_get_node_type (node))
|
||||
switch (GSK_RENDER_NODE_TYPE (node))
|
||||
{
|
||||
case GSK_COLOR_NODE:
|
||||
case GSK_OPACITY_NODE:
|
||||
@@ -460,15 +494,10 @@ gsk_gl_render_job_set_modelview (GskGLRenderJob *job,
|
||||
GskGLRenderModelview *modelview;
|
||||
|
||||
g_assert (job != NULL);
|
||||
g_assert (job->modelview != NULL);
|
||||
|
||||
job->driver->stamps[UNIFORM_SHARED_MODELVIEW]++;
|
||||
|
||||
g_array_set_size (job->modelview, job->modelview->len + 1);
|
||||
|
||||
modelview = &g_array_index (job->modelview,
|
||||
GskGLRenderModelview,
|
||||
job->modelview->len - 1);
|
||||
modelview = modelviews_grow_one (&job->modelview);
|
||||
|
||||
modelview->transform = transform;
|
||||
|
||||
@@ -493,26 +522,17 @@ gsk_gl_render_job_push_modelview (GskGLRenderJob *job,
|
||||
GskGLRenderModelview *modelview;
|
||||
|
||||
g_assert (job != NULL);
|
||||
g_assert (job->modelview != NULL);
|
||||
g_assert (transform != NULL);
|
||||
|
||||
job->driver->stamps[UNIFORM_SHARED_MODELVIEW]++;
|
||||
|
||||
g_array_set_size (job->modelview, job->modelview->len + 1);
|
||||
modelview = modelviews_grow_one (&job->modelview);
|
||||
|
||||
modelview = &g_array_index (job->modelview,
|
||||
GskGLRenderModelview,
|
||||
job->modelview->len - 1);
|
||||
|
||||
if G_LIKELY (job->modelview->len > 1)
|
||||
if G_LIKELY (modelviews_get_size (&job->modelview) > 1)
|
||||
{
|
||||
GskGLRenderModelview *last;
|
||||
GskGLRenderModelview *last = job->modelview.end - 2;
|
||||
GskTransform *t = NULL;
|
||||
|
||||
last = &g_array_index (job->modelview,
|
||||
GskGLRenderModelview,
|
||||
job->modelview->len - 2);
|
||||
|
||||
/* Multiply given matrix with our previous modelview */
|
||||
t = gsk_transform_translate (gsk_transform_ref (last->transform),
|
||||
&(graphene_point_t) {
|
||||
@@ -546,8 +566,7 @@ gsk_gl_render_job_pop_modelview (GskGLRenderJob *job)
|
||||
const GskGLRenderModelview *head;
|
||||
|
||||
g_assert (job != NULL);
|
||||
g_assert (job->modelview);
|
||||
g_assert (job->modelview->len > 0);
|
||||
g_assert (modelviews_get_size (&job->modelview) > 0);
|
||||
|
||||
job->driver->stamps[UNIFORM_SHARED_MODELVIEW]++;
|
||||
|
||||
@@ -558,11 +577,11 @@ gsk_gl_render_job_pop_modelview (GskGLRenderJob *job)
|
||||
|
||||
gsk_transform_unref (head->transform);
|
||||
|
||||
job->modelview->len--;
|
||||
job->modelview.end--;
|
||||
|
||||
if (job->modelview->len >= 1)
|
||||
if (modelviews_get_size (&job->modelview) >= 1)
|
||||
{
|
||||
head = &g_array_index (job->modelview, GskGLRenderModelview, job->modelview->len - 1);
|
||||
head = job->modelview.end - 1;
|
||||
|
||||
job->scale_x = head->scale_x;
|
||||
job->scale_y = head->scale_y;
|
||||
@@ -582,14 +601,12 @@ gsk_gl_render_job_push_clip (GskGLRenderJob *job,
|
||||
GskGLRenderClip *clip;
|
||||
|
||||
g_assert (job != NULL);
|
||||
g_assert (job->clip != NULL);
|
||||
g_assert (rect != NULL);
|
||||
|
||||
job->driver->stamps[UNIFORM_SHARED_CLIP_RECT]++;
|
||||
|
||||
g_array_set_size (job->clip, job->clip->len + 1);
|
||||
clip = clips_grow_one (&job->clip);
|
||||
|
||||
clip = &g_array_index (job->clip, GskGLRenderClip, job->clip->len - 1);
|
||||
memcpy (&clip->rect, rect, sizeof *rect);
|
||||
clip->is_rectilinear = gsk_rounded_rect_is_rectilinear (rect);
|
||||
clip->is_fully_contained = FALSE;
|
||||
@@ -604,16 +621,13 @@ gsk_gl_render_job_push_contained_clip (GskGLRenderJob *job)
|
||||
GskGLRenderClip *old_clip;
|
||||
|
||||
g_assert (job != NULL);
|
||||
g_assert (job->clip != NULL);
|
||||
g_assert (job->clip->len > 0);
|
||||
g_assert (clips_get_size (&job->clip) > 0);
|
||||
|
||||
job->driver->stamps[UNIFORM_SHARED_CLIP_RECT]++;
|
||||
|
||||
old_clip = &g_array_index (job->clip, GskGLRenderClip, job->clip->len - 1);
|
||||
clip = clips_grow_one (&job->clip);
|
||||
old_clip = clips_get (&job->clip, clips_get_size (&job->clip) - 2);
|
||||
|
||||
g_array_set_size (job->clip, job->clip->len + 1);
|
||||
|
||||
clip = &g_array_index (job->clip, GskGLRenderClip, job->clip->len - 1);
|
||||
memcpy (&clip->rect.bounds, &old_clip->rect.bounds, sizeof (graphene_rect_t));
|
||||
memset (clip->rect.corner, 0, sizeof clip->rect.corner);
|
||||
clip->is_rectilinear = TRUE;
|
||||
@@ -626,12 +640,11 @@ static void
|
||||
gsk_gl_render_job_pop_clip (GskGLRenderJob *job)
|
||||
{
|
||||
g_assert (job != NULL);
|
||||
g_assert (job->clip != NULL);
|
||||
g_assert (job->clip->len > 0);
|
||||
g_assert (clips_get_size (&job->clip) > 0);
|
||||
|
||||
job->driver->stamps[UNIFORM_SHARED_CLIP_RECT]++;
|
||||
job->current_clip--;
|
||||
job->clip->len--;
|
||||
job->clip.end--;
|
||||
}
|
||||
|
||||
static inline void
|
||||
@@ -713,7 +726,7 @@ gsk_gl_render_job_transform_bounds (GskGLRenderJob *job,
|
||||
GskTransformCategory category;
|
||||
|
||||
g_assert (job != NULL);
|
||||
g_assert (job->modelview->len > 0);
|
||||
g_assert (modelviews_get_size (&job->modelview) > 0);
|
||||
g_assert (rect != NULL);
|
||||
g_assert (out_rect != NULL);
|
||||
|
||||
@@ -1208,12 +1221,12 @@ gsk_gl_render_job_visit_as_fallback (GskGLRenderJob *job,
|
||||
{
|
||||
cairo_move_to (cr, 0, 0);
|
||||
cairo_rectangle (cr, 0, 0, node->bounds.size.width, node->bounds.size.height);
|
||||
if (gsk_render_node_get_node_type (node) == GSK_CAIRO_NODE)
|
||||
if (GSK_RENDER_NODE_TYPE (node) == GSK_CAIRO_NODE)
|
||||
cairo_set_source_rgba (cr, 0.3, 0, 1, 0.25);
|
||||
else
|
||||
cairo_set_source_rgba (cr, 1, 0, 0, 0.25);
|
||||
cairo_fill_preserve (cr);
|
||||
if (gsk_render_node_get_node_type (node) == GSK_CAIRO_NODE)
|
||||
if (GSK_RENDER_NODE_TYPE (node) == GSK_CAIRO_NODE)
|
||||
cairo_set_source_rgba (cr, 0.3, 0, 1, 1);
|
||||
else
|
||||
cairo_set_source_rgba (cr, 1, 0, 0, 1);
|
||||
@@ -1256,6 +1269,7 @@ done:
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_offscreen_rect (job, &node->bounds);
|
||||
gsk_gl_render_job_end_draw (job);
|
||||
|
||||
@@ -1321,6 +1335,7 @@ blur_offscreen (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
offscreen->texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_program_set_uniform1f (job->current_program,
|
||||
UNIFORM_BLUR_RADIUS, 0,
|
||||
blur_radius_x);
|
||||
@@ -1350,6 +1365,7 @@ blur_offscreen (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
pass1->texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_program_set_uniform1f (job->current_program,
|
||||
UNIFORM_BLUR_RADIUS, 0,
|
||||
blur_radius_y);
|
||||
@@ -1457,7 +1473,8 @@ gsk_gl_render_job_visit_color_node (GskGLRenderJob *job,
|
||||
batch = gsk_gl_command_queue_get_batch (job->command_queue);
|
||||
|
||||
/* Limit the size, or we end up with a coordinate overflow somewhere. */
|
||||
if (node->bounds.size.width < 300 &&
|
||||
if (job->source_is_glyph_atlas &&
|
||||
node->bounds.size.width < 300 &&
|
||||
node->bounds.size.height < 300 &&
|
||||
batch->any.kind == GSK_GL_COMMAND_KIND_DRAW &&
|
||||
batch->any.program == program->id)
|
||||
@@ -1502,7 +1519,7 @@ gsk_gl_render_job_visit_linear_gradient_node (GskGLRenderJob *job,
|
||||
const graphene_point_t *start = gsk_linear_gradient_node_get_start (node);
|
||||
const graphene_point_t *end = gsk_linear_gradient_node_get_end (node);
|
||||
int n_color_stops = gsk_linear_gradient_node_get_n_color_stops (node);
|
||||
gboolean repeat = gsk_render_node_get_node_type (node) == GSK_REPEATING_LINEAR_GRADIENT_NODE;
|
||||
gboolean repeat = GSK_RENDER_NODE_TYPE (node) == GSK_REPEATING_LINEAR_GRADIENT_NODE;
|
||||
float x1 = job->offset_x + start->x;
|
||||
float x2 = job->offset_x + end->x;
|
||||
float y1 = job->offset_y + start->y;
|
||||
@@ -1575,7 +1592,7 @@ gsk_gl_render_job_visit_radial_gradient_node (GskGLRenderJob *job,
|
||||
float end = gsk_radial_gradient_node_get_end (node);
|
||||
float hradius = gsk_radial_gradient_node_get_hradius (node);
|
||||
float vradius = gsk_radial_gradient_node_get_vradius (node);
|
||||
gboolean repeat = gsk_render_node_get_node_type (node) == GSK_REPEATING_RADIAL_GRADIENT_NODE;
|
||||
gboolean repeat = GSK_RENDER_NODE_TYPE (node) == GSK_REPEATING_RADIAL_GRADIENT_NODE;
|
||||
float scale = 1.0f / (end - start);
|
||||
float bias = -start * scale;
|
||||
|
||||
@@ -1664,6 +1681,7 @@ gsk_gl_render_job_visit_clipped_child (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
offscreen.texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_offscreen_rect (job, clip);
|
||||
gsk_gl_render_job_end_draw (job);
|
||||
}
|
||||
@@ -1719,7 +1737,7 @@ gsk_gl_render_job_visit_rounded_clip_node (GskGLRenderJob *job,
|
||||
* which both have rounded corners.
|
||||
*/
|
||||
|
||||
if (job->clip->len <= 1)
|
||||
if (clips_get_size (&job->clip) <= 1)
|
||||
need_offscreen = FALSE;
|
||||
else if (gsk_rounded_rect_contains_rect (&job->current_clip->rect, &transformed_clip.bounds))
|
||||
need_offscreen = FALSE;
|
||||
@@ -1754,6 +1772,7 @@ gsk_gl_render_job_visit_rounded_clip_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
offscreen.texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_offscreen (job, &node->bounds, &offscreen);
|
||||
gsk_gl_render_job_end_draw (job);
|
||||
}
|
||||
@@ -2119,6 +2138,7 @@ gsk_gl_render_job_visit_transform_node (GskGLRenderJob *job,
|
||||
offscreen.texture_id,
|
||||
linear_filter ? GL_LINEAR : GL_NEAREST,
|
||||
linear_filter ? GL_LINEAR : GL_NEAREST);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_offscreen (job, &child->bounds, &offscreen);
|
||||
gsk_gl_render_job_end_draw (job);
|
||||
}
|
||||
@@ -2328,6 +2348,7 @@ gsk_gl_render_job_visit_blurred_inset_shadow_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
blurred_texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_offscreen (job, &node->bounds, &offscreen);
|
||||
gsk_gl_render_job_end_draw (job);
|
||||
}
|
||||
@@ -2593,6 +2614,7 @@ gsk_gl_render_job_visit_blurred_outset_shadow_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
blurred_texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_program_set_uniform_rounded_rect (job->current_program,
|
||||
UNIFORM_OUTSET_SHADOW_OUTLINE_RECT, 0,
|
||||
&transformed_outline);
|
||||
@@ -2618,6 +2640,7 @@ gsk_gl_render_job_visit_blurred_outset_shadow_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
blurred_texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_program_set_uniform_rounded_rect (job->current_program,
|
||||
UNIFORM_OUTSET_SHADOW_OUTLINE_RECT, 0,
|
||||
&transformed_outline);
|
||||
@@ -2783,8 +2806,8 @@ static inline gboolean G_GNUC_PURE
|
||||
equal_texture_nodes (const GskRenderNode *node1,
|
||||
const GskRenderNode *node2)
|
||||
{
|
||||
if (gsk_render_node_get_node_type (node1) != GSK_TEXTURE_NODE ||
|
||||
gsk_render_node_get_node_type (node2) != GSK_TEXTURE_NODE)
|
||||
if (GSK_RENDER_NODE_TYPE (node1) != GSK_TEXTURE_NODE ||
|
||||
GSK_RENDER_NODE_TYPE (node2) != GSK_TEXTURE_NODE)
|
||||
return FALSE;
|
||||
|
||||
if (gsk_texture_node_get_texture (node1) !=
|
||||
@@ -2855,6 +2878,7 @@ gsk_gl_render_job_visit_cross_fade_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE1,
|
||||
offscreen_end.texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_program_set_uniform1f (job->current_program,
|
||||
UNIFORM_CROSS_FADE_PROGRESS, 0,
|
||||
progress);
|
||||
@@ -2901,6 +2925,7 @@ gsk_gl_render_job_visit_opacity_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
offscreen.texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_offscreen (job, &node->bounds, &offscreen);
|
||||
gsk_gl_render_job_end_draw (job);
|
||||
}
|
||||
@@ -3042,6 +3067,7 @@ gsk_gl_render_job_visit_text_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
texture_id);
|
||||
job->source_is_glyph_atlas = TRUE;
|
||||
last_texture = texture_id;
|
||||
}
|
||||
|
||||
@@ -3084,7 +3110,7 @@ gsk_gl_render_job_visit_shadow_node (GskGLRenderJob *job,
|
||||
|
||||
/* Shadow nodes recolor every pixel of the source texture, but leave the alpha in tact.
|
||||
* If the child is a color matrix node that doesn't touch the alpha, we can throw that away. */
|
||||
if (gsk_render_node_get_node_type (shadow_child) == GSK_COLOR_MATRIX_NODE &&
|
||||
if (GSK_RENDER_NODE_TYPE (shadow_child) == GSK_COLOR_MATRIX_NODE &&
|
||||
!color_matrix_modifies_alpha (shadow_child))
|
||||
shadow_child = gsk_color_matrix_node_get_child (shadow_child);
|
||||
|
||||
@@ -3104,7 +3130,7 @@ gsk_gl_render_job_visit_shadow_node (GskGLRenderJob *job,
|
||||
continue;
|
||||
|
||||
if (shadow->radius == 0 &&
|
||||
gsk_render_node_get_node_type (shadow_child) == GSK_TEXT_NODE)
|
||||
GSK_RENDER_NODE_TYPE (shadow_child) == GSK_TEXT_NODE)
|
||||
{
|
||||
if (dx != 0 || dy != 0)
|
||||
{
|
||||
@@ -3138,10 +3164,6 @@ gsk_gl_render_job_visit_shadow_node (GskGLRenderJob *job,
|
||||
|
||||
offscreen.was_offscreen = TRUE;
|
||||
}
|
||||
else if (dx == 0 && dy == 0)
|
||||
{
|
||||
continue; /* Invisible anyway */
|
||||
}
|
||||
else
|
||||
{
|
||||
offscreen.bounds = &shadow_child->bounds;
|
||||
@@ -3162,6 +3184,7 @@ gsk_gl_render_job_visit_shadow_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
offscreen.texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
rgba_to_half (&shadow->color, color);
|
||||
gsk_gl_render_job_draw_offscreen_with_color (job, &bounds, &offscreen, color);
|
||||
gsk_gl_render_job_end_draw (job);
|
||||
@@ -3218,6 +3241,7 @@ gsk_gl_render_job_visit_blur_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
offscreen.texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_coords (job,
|
||||
min_x, min_y, max_x, max_y,
|
||||
0, 1, 1, 0,
|
||||
@@ -3268,6 +3292,7 @@ gsk_gl_render_job_visit_blend_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
bottom_offscreen.texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_offscreen (job, &node->bounds, &bottom_offscreen);
|
||||
gsk_gl_render_job_end_draw (job);
|
||||
}
|
||||
@@ -3290,6 +3315,7 @@ gsk_gl_render_job_visit_blend_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE1,
|
||||
top_offscreen.texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_program_set_uniform1i (job->current_program,
|
||||
UNIFORM_BLEND_MODE, 0,
|
||||
gsk_blend_node_get_blend_mode (node));
|
||||
@@ -3352,6 +3378,7 @@ gsk_gl_render_job_visit_mask_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE1,
|
||||
mask_offscreen.texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_program_set_uniform1i (job->current_program,
|
||||
UNIFORM_MASK_MODE, 0,
|
||||
gsk_mask_node_get_mask_mode (node));
|
||||
@@ -3388,6 +3415,7 @@ gsk_gl_render_job_visit_color_matrix_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
offscreen.texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_program_set_uniform_matrix (job->current_program,
|
||||
UNIFORM_COLOR_MATRIX_COLOR_MATRIX, 0,
|
||||
gsk_color_matrix_node_get_color_matrix (node));
|
||||
@@ -3470,6 +3498,7 @@ gsk_gl_render_job_visit_gl_shader_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0 + i,
|
||||
offscreens[i].texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_program_set_uniform2f (program,
|
||||
UNIFORM_CUSTOM_SIZE, 0,
|
||||
node->bounds.size.width,
|
||||
@@ -3604,6 +3633,7 @@ gsk_gl_render_job_visit_texture (GskGLRenderJob *job,
|
||||
offscreen.has_mipmap ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR,
|
||||
GL_LINEAR,
|
||||
offscreen.sync);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_offscreen (job, bounds, &offscreen);
|
||||
gsk_gl_render_job_end_draw (job);
|
||||
}
|
||||
@@ -3641,6 +3671,7 @@ gsk_gl_render_job_visit_texture (GskGLRenderJob *job,
|
||||
slice->texture_id,
|
||||
use_mipmap ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR,
|
||||
GL_LINEAR);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
|
||||
gsk_gl_render_job_draw_coords (job,
|
||||
x1, y1, x2, y2,
|
||||
@@ -3687,12 +3718,6 @@ gsk_gl_render_job_visit_texture_scale_node (GskGLRenderJob *job,
|
||||
GskTextureKey key;
|
||||
guint texture_id;
|
||||
|
||||
if (filter == GSK_SCALING_FILTER_LINEAR)
|
||||
{
|
||||
gsk_gl_render_job_visit_texture (job, texture, bounds);
|
||||
return;
|
||||
}
|
||||
|
||||
gsk_gl_render_job_untransform_bounds (job, &job->current_clip->rect.bounds, &clip_rect);
|
||||
|
||||
if (!graphene_rect_intersection (bounds, &clip_rect, &clip_rect))
|
||||
@@ -3759,6 +3784,7 @@ gsk_gl_render_job_visit_texture_scale_node (GskGLRenderJob *job,
|
||||
min_filter,
|
||||
mag_filter,
|
||||
sync);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_coords (job,
|
||||
0, 0, clip_rect.size.width, clip_rect.size.height,
|
||||
u0, v0, u1, v1,
|
||||
@@ -3800,6 +3826,7 @@ gsk_gl_render_job_visit_texture_scale_node (GskGLRenderJob *job,
|
||||
slice->texture_id,
|
||||
min_filter,
|
||||
mag_filter);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_coords (job,
|
||||
slice_bounds.origin.x,
|
||||
slice_bounds.origin.y,
|
||||
@@ -3832,6 +3859,7 @@ render_texture:
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_coords (job,
|
||||
job->offset_x + clip_rect.origin.x,
|
||||
job->offset_y + clip_rect.origin.y,
|
||||
@@ -3884,6 +3912,7 @@ gsk_gl_render_job_visit_repeat_node (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
offscreen.texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_program_set_uniform4f (job->current_program,
|
||||
UNIFORM_REPEAT_CHILD_BOUNDS, 0,
|
||||
(node->bounds.origin.x - child_bounds->origin.x) / child_bounds->size.width,
|
||||
@@ -3918,7 +3947,7 @@ gsk_gl_render_job_visit_node (GskGLRenderJob *job,
|
||||
if (!gsk_gl_render_job_update_clip (job, &node->bounds, &has_clip))
|
||||
return;
|
||||
|
||||
switch (gsk_render_node_get_node_type (node))
|
||||
switch (GSK_RENDER_NODE_TYPE (node))
|
||||
{
|
||||
case GSK_BLEND_NODE:
|
||||
gsk_gl_render_job_visit_blend_node (job, node);
|
||||
@@ -3971,12 +4000,12 @@ gsk_gl_render_job_visit_node (GskGLRenderJob *job,
|
||||
|
||||
if (i + 1 < n_children &&
|
||||
job->current_clip->is_fully_contained &&
|
||||
gsk_render_node_get_node_type (child) == GSK_ROUNDED_CLIP_NODE)
|
||||
GSK_RENDER_NODE_TYPE (child) == GSK_ROUNDED_CLIP_NODE)
|
||||
{
|
||||
const GskRenderNode *grandchild = gsk_rounded_clip_node_get_child (child);
|
||||
const GskRenderNode *child2 = children[i + 1];
|
||||
if (gsk_render_node_get_node_type (grandchild) == GSK_COLOR_NODE &&
|
||||
gsk_render_node_get_node_type (child2) == GSK_BORDER_NODE &&
|
||||
if (GSK_RENDER_NODE_TYPE (grandchild) == GSK_COLOR_NODE &&
|
||||
GSK_RENDER_NODE_TYPE (child2) == GSK_BORDER_NODE &&
|
||||
gsk_border_node_get_uniform_color (child2) &&
|
||||
rounded_rect_equal (gsk_rounded_clip_node_get_clip (child),
|
||||
gsk_border_node_get_outline (child2)))
|
||||
@@ -4122,7 +4151,7 @@ gsk_gl_render_job_visit_node_with_offscreen (GskGLRenderJob *job,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (gsk_render_node_get_node_type (node) == GSK_TEXTURE_NODE &&
|
||||
if (GSK_RENDER_NODE_TYPE (node) == GSK_TEXTURE_NODE &&
|
||||
!offscreen->force_offscreen)
|
||||
{
|
||||
GdkTexture *texture = gsk_texture_node_get_texture (node);
|
||||
@@ -4370,6 +4399,7 @@ gsk_gl_render_job_render_flipped (GskGLRenderJob *job,
|
||||
GL_TEXTURE_2D,
|
||||
GL_TEXTURE0,
|
||||
texture_id);
|
||||
job->source_is_glyph_atlas = FALSE;
|
||||
gsk_gl_render_job_draw_rect (job, &job->viewport);
|
||||
gsk_gl_render_job_end_draw (job);
|
||||
}
|
||||
@@ -4494,8 +4524,8 @@ gsk_gl_render_job_new (GskGLDriver *driver,
|
||||
job = g_new0 (GskGLRenderJob, 1);
|
||||
job->driver = g_object_ref (driver);
|
||||
job->command_queue = job->driver->command_queue;
|
||||
job->clip = g_array_sized_new (FALSE, FALSE, sizeof (GskGLRenderClip), 16);
|
||||
job->modelview = g_array_sized_new (FALSE, FALSE, sizeof (GskGLRenderModelview), 16);
|
||||
clips_init (&job->clip);
|
||||
modelviews_init (&job->modelview);
|
||||
job->framebuffer = framebuffer;
|
||||
job->clear_framebuffer = !!clear_framebuffer;
|
||||
job->default_framebuffer = default_framebuffer;
|
||||
@@ -4545,16 +4575,16 @@ gsk_gl_render_job_free (GskGLRenderJob *job)
|
||||
job->current_modelview = NULL;
|
||||
job->current_clip = NULL;
|
||||
|
||||
while (job->modelview->len > 0)
|
||||
while (job->modelview.end > job->modelview.start)
|
||||
{
|
||||
GskGLRenderModelview *modelview = &g_array_index (job->modelview, GskGLRenderModelview, job->modelview->len-1);
|
||||
GskGLRenderModelview *modelview = job->modelview.end-1;
|
||||
g_clear_pointer (&modelview->transform, gsk_transform_unref);
|
||||
job->modelview->len--;
|
||||
job->modelview.end--;
|
||||
}
|
||||
|
||||
g_clear_object (&job->driver);
|
||||
g_clear_pointer (&job->region, cairo_region_destroy);
|
||||
g_clear_pointer (&job->modelview, g_array_unref);
|
||||
g_clear_pointer (&job->clip, g_array_unref);
|
||||
modelviews_clear (&job->modelview);
|
||||
clips_clear (&job->clip);
|
||||
g_free (job);
|
||||
}
|
||||
|
||||
@@ -75,10 +75,10 @@ void main() {
|
||||
|
||||
if (offset < next_offset) {
|
||||
float f = (offset - curr_offset) / (next_offset - curr_offset);
|
||||
vec4 curr_color = gsk_premultiply(get_color(i));
|
||||
vec4 next_color = gsk_premultiply(get_color(i + 1));
|
||||
vec4 curr_color = get_color(i);
|
||||
vec4 next_color = get_color(i + 1);
|
||||
vec4 color = mix(curr_color, next_color, f);
|
||||
gskSetScaledOutputColor(color, u_alpha);
|
||||
gskSetScaledOutputColor(gsk_premultiply(color), u_alpha);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,10 +97,10 @@ void main() {
|
||||
|
||||
if (offset < next_offset) {
|
||||
float f = (offset - curr_offset) / (next_offset - curr_offset);
|
||||
vec4 curr_color = gsk_premultiply(get_color(i));
|
||||
vec4 next_color = gsk_premultiply(get_color(i + 1));
|
||||
vec4 curr_color = get_color(i);
|
||||
vec4 next_color = get_color(i + 1);
|
||||
vec4 color = mix(curr_color, next_color, f);
|
||||
gskSetScaledOutputColor(color, u_alpha);
|
||||
gskSetScaledOutputColor(gsk_premultiply (color), u_alpha);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ gsk_rounded_rect_shrink (GskRoundedRect r, vec4 amount)
|
||||
if (r.corner_points1.zw == r.bounds.zy) new_corner_points1.zw = new_bounds.zy;
|
||||
if (r.corner_points2.xy == r.bounds.zw) new_corner_points2.xy = new_bounds.zw;
|
||||
if (r.corner_points2.zw == r.bounds.xw) new_corner_points2.zw = new_bounds.xw;
|
||||
new_corner_points1 = clamp (new_corner_points1, new_bounds.xyxy, new_bounds.zwzw);
|
||||
new_corner_points2 = clamp (new_corner_points2, new_bounds.xyxy, new_bounds.zwzw);
|
||||
|
||||
return GskRoundedRect (new_bounds, new_corner_points1, new_corner_points2);
|
||||
}
|
||||
|
||||
@@ -77,10 +77,10 @@ void main() {
|
||||
|
||||
if (offset < next_offset) {
|
||||
float f = (offset - curr_offset) / (next_offset - curr_offset);
|
||||
vec4 curr_color = gsk_premultiply(get_color(i));
|
||||
vec4 next_color = gsk_premultiply(get_color(i + 1));
|
||||
vec4 curr_color = get_color(i);
|
||||
vec4 next_color = get_color(i + 1);
|
||||
vec4 color = mix(curr_color, next_color, f);
|
||||
gskSetScaledOutputColor(color, u_alpha);
|
||||
gskSetScaledOutputColor(gsk_premultiply(color), u_alpha);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
+12
-7
@@ -287,15 +287,21 @@ gsk_render_node_alloc (GskRenderNodeType node_type)
|
||||
* Returns: (transfer full): the `GskRenderNode` with an additional reference
|
||||
*/
|
||||
GskRenderNode *
|
||||
gsk_render_node_ref (GskRenderNode *node)
|
||||
(gsk_render_node_ref) (GskRenderNode *node)
|
||||
{
|
||||
g_return_val_if_fail (GSK_IS_RENDER_NODE (node), NULL);
|
||||
|
||||
g_atomic_ref_count_inc (&node->ref_count);
|
||||
|
||||
return node;
|
||||
return _gsk_render_node_ref (node);
|
||||
}
|
||||
|
||||
void
|
||||
_gsk_render_node_unref (GskRenderNode *node)
|
||||
{
|
||||
if G_UNLIKELY (g_atomic_ref_count_dec (&node->ref_count))
|
||||
GSK_RENDER_NODE_GET_CLASS (node)->finalize (node);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gsk_render_node_unref:
|
||||
* @node: (transfer full): a `GskRenderNode`
|
||||
@@ -306,12 +312,11 @@ gsk_render_node_ref (GskRenderNode *node)
|
||||
* freed.
|
||||
*/
|
||||
void
|
||||
gsk_render_node_unref (GskRenderNode *node)
|
||||
(gsk_render_node_unref) (GskRenderNode *node)
|
||||
{
|
||||
g_return_if_fail (GSK_IS_RENDER_NODE (node));
|
||||
|
||||
if (g_atomic_ref_count_dec (&node->ref_count))
|
||||
GSK_RENDER_NODE_GET_CLASS (node)->finalize (node);
|
||||
_gsk_render_node_unref (node);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+55
-36
@@ -245,6 +245,13 @@ gsk_linear_gradient_node_draw (GskRenderNode *node,
|
||||
if (gsk_render_node_get_node_type (node) == GSK_REPEATING_LINEAR_GRADIENT_NODE)
|
||||
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
|
||||
|
||||
if (self->stops[0].offset > 0.0)
|
||||
cairo_pattern_add_color_stop_rgba (pattern,
|
||||
0.0,
|
||||
self->stops[0].color.red,
|
||||
self->stops[0].color.green,
|
||||
self->stops[0].color.blue,
|
||||
self->stops[0].color.alpha);
|
||||
for (i = 0; i < self->n_stops; i++)
|
||||
{
|
||||
cairo_pattern_add_color_stop_rgba (pattern,
|
||||
@@ -254,6 +261,13 @@ gsk_linear_gradient_node_draw (GskRenderNode *node,
|
||||
self->stops[i].color.blue,
|
||||
self->stops[i].color.alpha);
|
||||
}
|
||||
if (self->stops[self->n_stops-1].offset < 1.0)
|
||||
cairo_pattern_add_color_stop_rgba (pattern,
|
||||
1.0,
|
||||
self->stops[self->n_stops-1].color.red,
|
||||
self->stops[self->n_stops-1].color.green,
|
||||
self->stops[self->n_stops-1].color.blue,
|
||||
self->stops[self->n_stops-1].color.alpha);
|
||||
|
||||
cairo_set_source (cr, pattern);
|
||||
cairo_pattern_destroy (pattern);
|
||||
@@ -559,13 +573,29 @@ gsk_radial_gradient_node_draw (GskRenderNode *node,
|
||||
else
|
||||
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_PAD);
|
||||
|
||||
for (i = 0; i < self->n_stops; i++)
|
||||
if (self->stops[0].offset > 0.0)
|
||||
cairo_pattern_add_color_stop_rgba (pattern,
|
||||
self->stops[i].offset,
|
||||
self->stops[i].color.red,
|
||||
self->stops[i].color.green,
|
||||
self->stops[i].color.blue,
|
||||
self->stops[i].color.alpha);
|
||||
0.0,
|
||||
self->stops[0].color.red,
|
||||
self->stops[0].color.green,
|
||||
self->stops[0].color.blue,
|
||||
self->stops[0].color.alpha);
|
||||
for (i = 0; i < self->n_stops; i++)
|
||||
{
|
||||
cairo_pattern_add_color_stop_rgba (pattern,
|
||||
self->stops[i].offset,
|
||||
self->stops[i].color.red,
|
||||
self->stops[i].color.green,
|
||||
self->stops[i].color.blue,
|
||||
self->stops[i].color.alpha);
|
||||
}
|
||||
if (self->stops[self->n_stops-1].offset < 1.0)
|
||||
cairo_pattern_add_color_stop_rgba (pattern,
|
||||
1.0,
|
||||
self->stops[self->n_stops-1].color.red,
|
||||
self->stops[self->n_stops-1].color.green,
|
||||
self->stops[self->n_stops-1].color.blue,
|
||||
self->stops[self->n_stops-1].color.alpha);
|
||||
|
||||
gsk_cairo_rectangle (cr, &node->bounds);
|
||||
cairo_translate (cr, self->center.x, self->center.y);
|
||||
@@ -1805,6 +1835,7 @@ gsk_texture_scale_node_draw (GskRenderNode *node,
|
||||
cairo_matrix_init_scale (&matrix,
|
||||
gdk_texture_get_width (self->texture) / node->bounds.size.width,
|
||||
gdk_texture_get_height (self->texture) / node->bounds.size.height);
|
||||
cairo_matrix_translate (&matrix, -node->bounds.origin.x, -node->bounds.origin.y);
|
||||
cairo_pattern_set_matrix (pattern, &matrix);
|
||||
cairo_pattern_set_filter (pattern, filters[self->filter]);
|
||||
|
||||
@@ -1812,23 +1843,15 @@ gsk_texture_scale_node_draw (GskRenderNode *node,
|
||||
cairo_pattern_destroy (pattern);
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
cairo_rectangle (cr2, 0, 0, node->bounds.size.width, node->bounds.size.height);
|
||||
gsk_cairo_rectangle (cr2, &node->bounds);
|
||||
cairo_fill (cr2);
|
||||
|
||||
cairo_destroy (cr2);
|
||||
|
||||
cairo_save (cr);
|
||||
|
||||
pattern = cairo_pattern_create_for_surface (surface2);
|
||||
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_PAD);
|
||||
|
||||
cairo_matrix_init_identity (&matrix);
|
||||
cairo_matrix_translate (&matrix,
|
||||
-node->bounds.origin.x,
|
||||
-node->bounds.origin.y);
|
||||
cairo_pattern_set_matrix (pattern, &matrix);
|
||||
cairo_set_source (cr, pattern);
|
||||
cairo_pattern_destroy (pattern);
|
||||
cairo_set_source_surface (cr, surface2, 0, 0);
|
||||
cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_PAD);
|
||||
cairo_surface_destroy (surface2);
|
||||
|
||||
gsk_cairo_rectangle (cr, &node->bounds);
|
||||
@@ -3838,11 +3861,12 @@ gsk_color_matrix_node_class_init (gpointer g_class,
|
||||
* Creates a `GskRenderNode` that will drawn the @child with
|
||||
* @color_matrix.
|
||||
*
|
||||
* In particular, the node will transform the operation
|
||||
* In particular, the node will transform colors by applying
|
||||
*
|
||||
* pixel = color_matrix * pixel + color_offset
|
||||
* pixel = transpose(color_matrix) * pixel + color_offset
|
||||
*
|
||||
* for every pixel.
|
||||
* for every pixel. The transformation operates on unpremultiplied
|
||||
* colors, with color components ordered R, G, B, A.
|
||||
*
|
||||
* Returns: (transfer full) (type GskColorMatrixNode): A new `GskRenderNode`
|
||||
*/
|
||||
@@ -4401,18 +4425,8 @@ gsk_shadow_node_draw (GskRenderNode *node,
|
||||
cairo_t *cr)
|
||||
{
|
||||
GskShadowNode *self = (GskShadowNode *) node;
|
||||
cairo_pattern_t *pattern;
|
||||
gsize i;
|
||||
|
||||
cairo_save (cr);
|
||||
/* clip so the push_group() creates a small surface */
|
||||
gsk_cairo_rectangle (cr, &self->child->bounds);
|
||||
cairo_clip (cr);
|
||||
cairo_push_group (cr);
|
||||
gsk_render_node_draw (self->child, cr);
|
||||
pattern = cairo_pop_group (cr);
|
||||
cairo_restore (cr);
|
||||
|
||||
cairo_save (cr);
|
||||
/* clip so the blur area stays small */
|
||||
gsk_cairo_rectangle (cr, &node->bounds);
|
||||
@@ -4421,27 +4435,32 @@ gsk_shadow_node_draw (GskRenderNode *node,
|
||||
for (i = 0; i < self->n_shadows; i++)
|
||||
{
|
||||
GskShadow *shadow = &self->shadows[i];
|
||||
cairo_pattern_t *pattern;
|
||||
|
||||
/* We don't need to draw invisible shadows */
|
||||
if (gdk_rgba_is_clear (&shadow->color))
|
||||
continue;
|
||||
|
||||
cairo_save (cr);
|
||||
gdk_cairo_set_source_rgba (cr, &shadow->color);
|
||||
cr = gsk_cairo_blur_start_drawing (cr, shadow->radius, GSK_BLUR_X | GSK_BLUR_Y);
|
||||
|
||||
cairo_save (cr);
|
||||
cairo_translate (cr, shadow->dx, shadow->dy);
|
||||
cairo_push_group (cr);
|
||||
gsk_render_node_draw (self->child, cr);
|
||||
pattern = cairo_pop_group (cr);
|
||||
gdk_cairo_set_source_rgba (cr, &shadow->color);
|
||||
cairo_mask (cr, pattern);
|
||||
cairo_pattern_destroy (pattern);
|
||||
cairo_restore (cr);
|
||||
|
||||
cr = gsk_cairo_blur_finish_drawing (cr, shadow->radius, &shadow->color, GSK_BLUR_X | GSK_BLUR_Y);
|
||||
cairo_restore (cr);
|
||||
}
|
||||
|
||||
cairo_set_source (cr, pattern);
|
||||
cairo_paint (cr);
|
||||
cairo_restore (cr);
|
||||
gsk_render_node_draw (self->child, cr);
|
||||
|
||||
cairo_pattern_destroy (pattern);
|
||||
cairo_restore (cr);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -4562,7 +4581,7 @@ gsk_shadow_node_new (GskRenderNode *child,
|
||||
|
||||
self = gsk_render_node_alloc (GSK_SHADOW_NODE);
|
||||
node = (GskRenderNode *) self;
|
||||
node->offscreen_for_opacity = child->offscreen_for_opacity;
|
||||
node->offscreen_for_opacity = TRUE;
|
||||
|
||||
self->child = gsk_render_node_ref (child);
|
||||
self->n_shadows = n_shadows;
|
||||
|
||||
@@ -2856,8 +2856,18 @@ base64_encode_with_linebreaks (const guchar *data,
|
||||
+1 is needed for trailing \0, also check for unlikely integer overflow */
|
||||
g_return_val_if_fail (len < ((G_MAXSIZE - 1) / 4 - 1) * 3, NULL);
|
||||
|
||||
max = (len / 3 + 1) * 4 + 1;
|
||||
max += 2 * (max / 76);
|
||||
/* The glib docs say:
|
||||
*
|
||||
* The output buffer must be large enough to fit all the data that will
|
||||
* be written to it. Due to the way base64 encodes you will need
|
||||
* at least: (@len / 3 + 1) * 4 + 4 bytes (+ 4 may be needed in case of
|
||||
* non-zero state). If you enable line-breaking you will need at least:
|
||||
* ((@len / 3 + 1) * 4 + 4) / 76 + 1 bytes of extra space.
|
||||
*/
|
||||
max = (len / 3 + 1) * 4;
|
||||
max += ((len / 3 + 1) * 4 + 4) / 76 + 1;
|
||||
/* and the null byte */
|
||||
max += 1;
|
||||
|
||||
out = g_malloc (max);
|
||||
|
||||
@@ -3019,7 +3029,7 @@ gsk_text_node_serialize_glyphs (GskRenderNode *node,
|
||||
string_append_double (p, (double) glyphs[i].geometry.y_offset / PANGO_SCALE);
|
||||
if (!glyphs[i].attr.is_cluster_start)
|
||||
g_string_append (p, " same-cluster");
|
||||
if (!glyphs[i].attr.is_color)
|
||||
if (glyphs[i].attr.is_color)
|
||||
g_string_append (p, " color");
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,9 @@ extern GType gsk_render_node_types[];
|
||||
#define GSK_IS_RENDER_NODE_TYPE(node,type) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((node), GSK_TYPE_RENDER_NODE, GskRenderNodeClass)->node_type == (type))
|
||||
|
||||
#define GSK_RENDER_NODE_TYPE(node) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((node), GSK_TYPE_RENDER_NODE, GskRenderNodeClass)->node_type)
|
||||
|
||||
struct _GskRenderNode
|
||||
{
|
||||
GTypeInstance parent_instance;
|
||||
@@ -57,6 +60,8 @@ GType gsk_render_node_type_register_static (const char
|
||||
|
||||
gpointer gsk_render_node_alloc (GskRenderNodeType node_type);
|
||||
|
||||
void _gsk_render_node_unref (GskRenderNode *node);
|
||||
|
||||
gboolean gsk_render_node_can_diff (const GskRenderNode *node1,
|
||||
const GskRenderNode *node2) G_GNUC_PURE;
|
||||
void gsk_render_node_diff (GskRenderNode *node1,
|
||||
@@ -87,6 +92,15 @@ gboolean gsk_container_node_is_disjoint (const GskRenderNode
|
||||
|
||||
gboolean gsk_render_node_use_offscreen_for_opacity (const GskRenderNode *node);
|
||||
|
||||
#define gsk_render_node_ref(node) _gsk_render_node_ref(node)
|
||||
#define gsk_render_node_unref(node) _gsk_render_node_unref(node)
|
||||
|
||||
static inline GskRenderNode *
|
||||
_gsk_render_node_ref (GskRenderNode *node)
|
||||
{
|
||||
g_atomic_ref_count_inc (&node->ref_count);
|
||||
return node;
|
||||
}
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
+24
-13
@@ -46,22 +46,12 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
static void
|
||||
gsk_rounded_rect_normalize_in_place (GskRoundedRect *self)
|
||||
static float
|
||||
gsk_rounded_rect_get_corner_scale_factor (GskRoundedRect *self)
|
||||
{
|
||||
float factor = 1.0;
|
||||
float corners;
|
||||
guint i;
|
||||
|
||||
graphene_rect_normalize (&self->bounds);
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
self->corner[i].width = MAX (self->corner[i].width, 0);
|
||||
self->corner[i].height = MAX (self->corner[i].height, 0);
|
||||
}
|
||||
|
||||
/* clamp border radius, following CSS specs */
|
||||
corners = self->corner[GSK_CORNER_TOP_LEFT].width + self->corner[GSK_CORNER_TOP_RIGHT].width;
|
||||
if (corners > self->bounds.size.width)
|
||||
factor = MIN (factor, self->bounds.size.width / corners);
|
||||
@@ -78,6 +68,26 @@ gsk_rounded_rect_normalize_in_place (GskRoundedRect *self)
|
||||
if (corners > self->bounds.size.height)
|
||||
factor = MIN (factor, self->bounds.size.height / corners);
|
||||
|
||||
return factor;
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_rounded_rect_normalize_in_place (GskRoundedRect *self)
|
||||
{
|
||||
float factor;
|
||||
guint i;
|
||||
|
||||
graphene_rect_normalize (&self->bounds);
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
self->corner[i].width = MAX (self->corner[i].width, 0);
|
||||
self->corner[i].height = MAX (self->corner[i].height, 0);
|
||||
}
|
||||
|
||||
/* clamp border radius, following CSS specs */
|
||||
factor = gsk_rounded_rect_get_corner_scale_factor (self);
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
graphene_size_scale (&self->corner[i], factor, &self->corner[i]);
|
||||
}
|
||||
@@ -812,7 +822,8 @@ gsk_rounded_rect_intersection (const GskRoundedRect *a,
|
||||
check_corner (a, b,
|
||||
GSK_CORNER_BOTTOM_RIGHT,
|
||||
right, bottom,
|
||||
result))
|
||||
result) &&
|
||||
gsk_rounded_rect_get_corner_scale_factor (result) >= 1.0)
|
||||
return GSK_INTERSECTION_NONEMPTY;
|
||||
|
||||
return GSK_INTERSECTION_NOT_REPRESENTABLE;
|
||||
|
||||
+2
-1
@@ -857,7 +857,8 @@ normalize_angle (float angle)
|
||||
* @next: (nullable) (transfer full): the next transform
|
||||
* @angle: the rotation angle, in degrees (clockwise)
|
||||
*
|
||||
* Rotates @next @angle degrees in 2D - or in 3D-speak, around the z axis.
|
||||
* Rotates @next @angle degrees in 2D - or in 3D-speak, around the Z axis.
|
||||
* The rotation happens around the origin point of (0, 0).
|
||||
*
|
||||
* Returns: (nullable): The new transform
|
||||
*/
|
||||
|
||||
+1
-6
@@ -97,10 +97,6 @@ if have_vulkan
|
||||
endif
|
||||
|
||||
gsk_private_vulkan_shaders = []
|
||||
# This is an odd split because we use configure_file() below to workaround
|
||||
# a limitation in meson preventing using custom_target() with gnome.compile_resources()
|
||||
# and that requires file paths, but we also need to have dependencies during development
|
||||
# on constantly regenerated files.
|
||||
gsk_private_vulkan_compiled_shaders = []
|
||||
gsk_private_vulkan_compiled_shaders_deps = []
|
||||
gsk_private_vulkan_shader_headers = []
|
||||
@@ -148,7 +144,7 @@ if get_variable('broadway_enabled')
|
||||
])
|
||||
endif
|
||||
|
||||
gsk_resources_xml = configure_file(output: 'gsk.resources.xml',
|
||||
gsk_resources_xml = custom_target(output: 'gsk.resources.xml',
|
||||
input: 'gen-gsk-gresources-xml.py',
|
||||
command: [
|
||||
find_program('gen-gsk-gresources-xml.py'),
|
||||
@@ -184,7 +180,6 @@ gsk_deps = [
|
||||
pango_dep,
|
||||
cairo_dep,
|
||||
cairo_csi_dep,
|
||||
pixbuf_dep,
|
||||
libgdk_dep,
|
||||
]
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include <gsk/gskrenderer.h>
|
||||
#include <gsk/gsk.h>
|
||||
|
||||
#ifdef GDK_RENDERING_VULKAN
|
||||
|
||||
|
||||
@@ -93,12 +93,12 @@ foreach shader: gsk_private_vulkan_shaders
|
||||
endforeach
|
||||
|
||||
foreach shader: gsk_private_vulkan_vertex_shaders
|
||||
shader_header = configure_file(output: '@0@.h'.format(shader),
|
||||
input: shader,
|
||||
command: [
|
||||
find_program('generate-header.py'),
|
||||
'@INPUT@',
|
||||
],
|
||||
capture: true)
|
||||
shader_header = custom_target(output: '@0@.h'.format(shader),
|
||||
input: shader,
|
||||
command: [
|
||||
find_program('generate-header.py'),
|
||||
'@INPUT@',
|
||||
],
|
||||
capture: true)
|
||||
gsk_private_vulkan_shader_headers += shader_header
|
||||
endforeach
|
||||
|
||||
@@ -290,6 +290,9 @@ gtk_color_button_init (GtkColorButton *button)
|
||||
|
||||
button->button = gtk_button_new ();
|
||||
g_signal_connect (button->button, "clicked", G_CALLBACK (gtk_color_button_clicked), button);
|
||||
g_object_bind_property (button, "focus-on-click",
|
||||
button->button, "focus-on-click",
|
||||
0);
|
||||
gtk_widget_set_parent (button->button, GTK_WIDGET (button));
|
||||
|
||||
button->swatch = g_object_new (GTK_TYPE_COLOR_SWATCH,
|
||||
|
||||
@@ -454,7 +454,8 @@ gtk_dialog_constructed (GObject *object)
|
||||
}
|
||||
g_list_free (children);
|
||||
|
||||
_gtk_header_bar_track_default_decoration (GTK_HEADER_BAR (priv->headerbar));
|
||||
if (GTK_IS_HEADER_BAR (priv->headerbar))
|
||||
_gtk_header_bar_track_default_decoration (GTK_HEADER_BAR (priv->headerbar));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1397,7 +1398,8 @@ gtk_dialog_buildable_add_child (GtkBuildable *buildable,
|
||||
else if (g_str_equal (type, "titlebar"))
|
||||
{
|
||||
priv->headerbar = GTK_WIDGET (child);
|
||||
_gtk_header_bar_track_default_decoration (GTK_HEADER_BAR (priv->headerbar));
|
||||
if (GTK_IS_HEADER_BAR (priv->headerbar))
|
||||
_gtk_header_bar_track_default_decoration (GTK_HEADER_BAR (priv->headerbar));
|
||||
gtk_window_set_titlebar (GTK_WINDOW (buildable), priv->headerbar);
|
||||
}
|
||||
else if (g_str_equal (type, "action"))
|
||||
|
||||
@@ -594,6 +594,9 @@ gtk_font_button_init (GtkFontButton *font_button)
|
||||
|
||||
font_button->button = gtk_button_new ();
|
||||
g_signal_connect (font_button->button, "clicked", G_CALLBACK (gtk_font_button_clicked), font_button);
|
||||
g_object_bind_property (font_button, "focus-on-click",
|
||||
font_button->button, "focus-on-click",
|
||||
0);
|
||||
font_button->font_label = gtk_label_new (_("Font"));
|
||||
gtk_widget_set_hexpand (font_button->font_label, TRUE);
|
||||
font_button->size_label = gtk_label_new ("14");
|
||||
|
||||
@@ -734,10 +734,12 @@ gtk_tree_model_filter_build_level (GtkTreeModelFilter *filter,
|
||||
g_assert (filter->priv->child_model != NULL);
|
||||
|
||||
/* Avoid building a level that already exists */
|
||||
#ifndef G_DISABLE_ASSERT
|
||||
if (parent_level)
|
||||
g_assert (parent_elt->children == NULL);
|
||||
else
|
||||
g_assert (filter->priv->root == NULL);
|
||||
#endif
|
||||
|
||||
if (filter->priv->in_row_deleted)
|
||||
return;
|
||||
|
||||
@@ -12834,6 +12834,12 @@ gtk_tree_view_is_blank_at_pos (GtkTreeView *tree_view,
|
||||
|
||||
gtk_tree_model_get_iter (priv->model, &iter, real_path);
|
||||
_gtk_tree_view_find_node (tree_view, real_path, &tree, &node);
|
||||
if (node == NULL)
|
||||
{
|
||||
if (!path)
|
||||
gtk_tree_path_free (real_path);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Check if there's an expander arrow at (x, y) */
|
||||
if (real_column == priv->expander_column
|
||||
|
||||
@@ -937,13 +937,13 @@ gtk_tree_view_column_update_button (GtkTreeViewColumn *tree_column)
|
||||
if ((!alternative && priv->sort_order == GTK_SORT_ASCENDING) ||
|
||||
(alternative && priv->sort_order == GTK_SORT_DESCENDING))
|
||||
{
|
||||
gtk_widget_remove_css_class (arrow, "descending");
|
||||
gtk_widget_add_css_class (arrow, "ascending");
|
||||
gtk_widget_remove_css_class (arrow, "ascending");
|
||||
gtk_widget_add_css_class (arrow, "descending");
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_remove_css_class (arrow, "ascending");
|
||||
gtk_widget_add_css_class (arrow, "descending");
|
||||
gtk_widget_remove_css_class (arrow, "descending");
|
||||
gtk_widget_add_css_class (arrow, "ascending");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user