Compare commits
507 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c476c45007 | |||
| 5d05270ca7 | |||
| 34fb85afd1 | |||
| 05bc4a86c7 | |||
| 93302cc42d | |||
| 976f45e614 | |||
| befccc943a | |||
| ee5afdf919 | |||
| 49a6b5d50a | |||
| dd7a0cbeb7 | |||
| 38d808f3e2 | |||
| 16a608b9e5 | |||
| f1ff37e970 | |||
| 71c68f5f36 | |||
| 0d3265edc7 | |||
| 854e40c60c | |||
| 06f3b5dfd4 | |||
| 05acb70d1c | |||
| 7b380b2ffc | |||
| f6e4b964b7 | |||
| 0b2d08f076 | |||
| 1ad1a9fe4a | |||
| fe15db92bd | |||
| 682b7773fc | |||
| 9055b6c6e5 | |||
| 9fd56dc5ad | |||
| 1ec7f2bbcd | |||
| 4eb7208e35 | |||
| 1ad88f7662 | |||
| 96b30073cf | |||
| 456956a2bd | |||
| 4c794505da | |||
| f627c9443e | |||
| 06fa9befe0 | |||
| a95dc5d609 | |||
| 2abe588e91 | |||
| ecdee288a7 | |||
| e363fcca3c | |||
| f46fb7c6fc | |||
| 985d964a34 | |||
| 2a0286c19c | |||
| 9a05af61e8 | |||
| 68d2e9c068 | |||
| 89ba937fd3 | |||
| 840cd6f10f | |||
| cccfc1a38d | |||
| ff26aa2fa7 | |||
| 7192e67a6f | |||
| 5354b91e64 | |||
| c9c6b7bb2a | |||
| c93fa922dc | |||
| 8d7bfa2628 | |||
| e6a4cc8ba2 | |||
| 7926ee68b8 | |||
| 239d47791d | |||
| 33f210bc85 | |||
| 021aae84dd | |||
| e8508762f5 | |||
| a0bbdfbeee | |||
| f6561fc401 | |||
| dfe56c8b70 | |||
| 7f29b466be | |||
| 8f5a185ae5 | |||
| 309b28fa2c | |||
| e9f311e6b6 | |||
| 045262282b | |||
| a44701faa2 | |||
| eeee3151b6 | |||
| 0cd077e80f | |||
| 0e9b098f4e | |||
| 40b5002338 | |||
| 28fd3fbf50 | |||
| 10c782b106 | |||
| 5dd1803288 | |||
| 7e9f2e2311 | |||
| 610a5d6c0d | |||
| 5453628491 | |||
| 6e0596e122 | |||
| 0ca8d74842 | |||
| 04f8170841 | |||
| 1124793702 | |||
| 8d4b0f05da | |||
| ca8ba8ce87 | |||
| 849e3403cd | |||
| 02a7a30978 | |||
| 79568d2944 | |||
| ae45be7875 | |||
| 73e8b39bc6 | |||
| 72b2938e43 | |||
| 785aaa8c03 | |||
| 1d7983da05 | |||
| cb652c7f0f | |||
| a2b84fc98a | |||
| 0d9bbc9d64 | |||
| 6fd5e5f61c | |||
| b7285bd688 | |||
| 938e50c876 | |||
| e76bfcf2f6 | |||
| d828f2477e | |||
| 4d2bad4c11 | |||
| ed14df9738 | |||
| d75abc9104 | |||
| bc83969f6b | |||
| dff8e34bc9 | |||
| 6d9662cf8d | |||
| 2e6b32083e | |||
| b4b42a462a | |||
| a48a2a3dc9 | |||
| 9628599620 | |||
| 3a4d5ff5c3 | |||
| e7fa2571ca | |||
| ad719a9c47 | |||
| 0c4ea9bc7c | |||
| 24de5ffd4e | |||
| 4933bc505f | |||
| ecbee35f93 | |||
| 5552b5c0ec | |||
| 2baa899e32 | |||
| aaaddd1b47 | |||
| d4d4c7e119 | |||
| ea33264a87 | |||
| 4054f33221 | |||
| b6767d2eef | |||
| 90d84a2af8 | |||
| eb34311c2c | |||
| ea7ddc031c | |||
| 1ff17f1a7e | |||
| 8232ab4440 | |||
| bb82e3e1fb | |||
| 1702cdaff6 | |||
| a4583b03a1 | |||
| b12169776e | |||
| 85f85bbec8 | |||
| afc7b46264 | |||
| 86db9e2ce0 | |||
| 1afc7a9210 | |||
| cb6c720d37 | |||
| 35eae8751f | |||
| a246d1a995 | |||
| 718d68eccd | |||
| fb4023af22 | |||
| 370ecd5d15 | |||
| fdff21ae13 | |||
| 69500f356e | |||
| 3b794c4951 | |||
| 72614fdb67 | |||
| 230ee92857 | |||
| c6c952477a | |||
| fd4f22bba5 | |||
| 1e8d7c7891 | |||
| 73316a83c4 | |||
| b2d22d8125 | |||
| afb75bedfe | |||
| ee34781a13 | |||
| 9fc80a0bd5 | |||
| d4203d147a | |||
| a1dda0ec3c | |||
| f9b66dff8b | |||
| dbbc16947f | |||
| dc47abc60e | |||
| ca9ba3cc80 | |||
| 59f6218426 | |||
| f533d08537 | |||
| 230aa7899e | |||
| cc51604267 | |||
| 3b2622267d | |||
| 4fc05e7c64 | |||
| 4e680cae48 | |||
| d957e40a63 | |||
| d1bc8e580d | |||
| 5dadee1591 | |||
| ea7a61a763 | |||
| 8bd6927daf | |||
| 67912c1051 | |||
| 6314a5240d | |||
| e7f55d8706 | |||
| 671756cb13 | |||
| 7cf567b4f9 | |||
| 82e695d94a | |||
| 2104d7b062 | |||
| 6c4739a2f1 | |||
| f858daeca4 | |||
| efa0033fb4 | |||
| 546378e65c | |||
| a997dea414 | |||
| e75af999dc | |||
| e8dcbbe86f | |||
| 3c048caa30 | |||
| 925d2ba9ae | |||
| 645070ef7f | |||
| 2fe1f47e6d | |||
| db8f87d539 | |||
| a75d97c788 | |||
| ea9e414ad6 | |||
| c1bcbcdee5 | |||
| 8f293f3153 | |||
| 70380661fe | |||
| d91d0f1c0a | |||
| 1db696be79 | |||
| 9a30ea1f69 | |||
| 0495359eca | |||
| 1995b9d92c | |||
| 29c0babdda | |||
| 5b55456b75 | |||
| 70205f59a4 | |||
| df7889d7f3 | |||
| 26c25cc6b7 | |||
| 2cf90b6158 | |||
| f8e89f2224 | |||
| 30afac9a6b | |||
| dac56dd757 | |||
| e4ca3a285e | |||
| 30b5a33444 | |||
| e647ebae87 | |||
| 0b34af438f | |||
| a9949a102b | |||
| 90296dab76 | |||
| ed605f01a2 | |||
| bed3c6f807 | |||
| f6221835ef | |||
| 7e9ce1b266 | |||
| c40f29cb54 | |||
| d7afa91023 | |||
| 9bd6d431af | |||
| f126986c2b | |||
| 865564b32f | |||
| 3ae6da10b1 | |||
| 1b9002afd3 | |||
| 9e72260c3b | |||
| 9d52b4e269 | |||
| 6ed4eece04 | |||
| cfaddb5d47 | |||
| 7c861d8b59 | |||
| 1c3457adfb | |||
| a2e46c4d39 | |||
| df1d024059 | |||
| e492dac7fe | |||
| fabe0516fa | |||
| 84971b9076 | |||
| 5efc33fe65 | |||
| 52c228fd9e | |||
| 674b5b808e | |||
| af62aa4497 | |||
| 137a7096c3 | |||
| 703e5ab9a8 | |||
| e2dc94d0e8 | |||
| b821103d1e | |||
| b40c9d8dcd | |||
| 87b66de109 | |||
| e934a8984d | |||
| fa3bbed200 | |||
| d08412aaa4 | |||
| 56e7c4ab50 | |||
| 3be03ea56f | |||
| ac65495434 | |||
| 3a26e29795 | |||
| 21f64b987a | |||
| da227386ad | |||
| 1ac82528d9 | |||
| 50fb19b10d | |||
| 7c38945abf | |||
| be2dcdd897 | |||
| 16f91fc5d2 | |||
| 46cb0c5fc8 | |||
| 49e0ae8742 | |||
| 933ce71ec6 | |||
| 149e884658 | |||
| 4b34c10d05 | |||
| e4ec066337 | |||
| b734614aed | |||
| 7880095fd8 | |||
| 53519d7da1 | |||
| d418b0984c | |||
| e20b0b2a35 | |||
| 28cec6c9a7 | |||
| 887d5307ca | |||
| f6c84a435e | |||
| bff31f58a8 | |||
| 3921398e66 | |||
| f30c3d8133 | |||
| 9c0ca8803d | |||
| 5b184a10a9 | |||
| 0bfd4b232b | |||
| 269662c888 | |||
| 9c87dd503a | |||
| f2ec3e336f | |||
| 691ea8f11a | |||
| f9ba19c4de | |||
| 1319f41d46 | |||
| da024cfc90 | |||
| 6c6577dd6b | |||
| bfdd738d0b | |||
| 3cce78d02c | |||
| 5cc952fa3f | |||
| 7271eff628 | |||
| 42bc89688c | |||
| a4ff25485c | |||
| 55f6517751 | |||
| cefa09f74f | |||
| 906661d40b | |||
| 32abe5b8bb | |||
| cb9de9a48e | |||
| d823502af7 | |||
| 62774c2e53 | |||
| b885d288cc | |||
| da36a6a5d2 | |||
| 09ac592114 | |||
| 19fccb13c3 | |||
| c654cb0f37 | |||
| 6dfa6fe442 | |||
| a61c7f7871 | |||
| 8e4a235f56 | |||
| 3cb1b9d4cb | |||
| eaf944938b | |||
| 930fb24053 | |||
| 12069d2b91 | |||
| d3666f7b28 | |||
| 67e50a6cfd | |||
| 9e05ce18d9 | |||
| a77598d6ec | |||
| 9a2ba3053b | |||
| 7e71f1197b | |||
| 4e091b1791 | |||
| dcebddc908 | |||
| 6f67991e0e | |||
| 9bc4585247 | |||
| 305ef51684 | |||
| 0c61610699 | |||
| 99dd6c579d | |||
| 8f3d85007b | |||
| 7823e8120d | |||
| 5ff7b37b61 | |||
| d3e4d310b2 | |||
| 77c115c224 | |||
| c76fd1548e | |||
| da142e02be | |||
| 8602745858 | |||
| 3e3eda416c | |||
| 140ad373f7 | |||
| 7e9c18c16e | |||
| 88b3e8552a | |||
| a6f9bab8f3 | |||
| 12e15c0ee0 | |||
| 9216779963 | |||
| 2e669099a6 | |||
| 2a3a5753c1 | |||
| 88bed27f85 | |||
| b49b055183 | |||
| 988c7d1626 | |||
| f9acf3bb20 | |||
| 1b0f2cfeb8 | |||
| 26a342279f | |||
| ed38d9b662 | |||
| e8b249281d | |||
| 5483821ea0 | |||
| 05e25557e1 | |||
| f80989332f | |||
| 8df8d0bd5d | |||
| ea6ad66ee3 | |||
| 5ceb9a7692 | |||
| 216dbf1e88 | |||
| ff4db4ed71 | |||
| 57dde7e877 | |||
| 9581d060d2 | |||
| b4069ba15b | |||
| 63e44a34ae | |||
| afbd7cfe55 | |||
| ead1b36afd | |||
| 1ffa01b38a | |||
| f93601ed2b | |||
| e1722777e5 | |||
| 24850dff0e | |||
| d790268031 | |||
| 89712fc750 | |||
| 9b62a5c931 | |||
| fbf3836502 | |||
| 8d80f97597 | |||
| e6ec8133a5 | |||
| 6b436fdbbb | |||
| 7b2b5469eb | |||
| 3fc325d799 | |||
| dee6742931 | |||
| d2097d0449 | |||
| c7f00d51eb | |||
| f5308dfbec | |||
| 1097e1349c | |||
| d577e4421e | |||
| 1bac8b439a | |||
| ee52e98b7d | |||
| 5e4eda15c9 | |||
| e861ea4bd2 | |||
| 8009ed3a3c | |||
| 1d95a171f6 | |||
| e0136b283a | |||
| 42867c7a3c | |||
| 40f20fee3d | |||
| 63e814a45f | |||
| c1270cf52b | |||
| f2ec2f2a58 | |||
| e67bb62b1f | |||
| c17ac8c599 | |||
| ee8a800763 | |||
| 746cfe48b0 | |||
| 3a93d52718 | |||
| 1994e1940c | |||
| d74855fe9f | |||
| 979749a3bc | |||
| 29c7725416 | |||
| 3abf6acb16 | |||
| df8cf0e030 | |||
| 7952b2a0bc | |||
| c98e568583 | |||
| f90e77d173 | |||
| 98e3fca284 | |||
| a7c98227e6 | |||
| f2856e494c | |||
| dc1f12682c | |||
| 502fb250ab | |||
| 7d7d3ff35c | |||
| 9fb449793d | |||
| 3d88c44803 | |||
| b05000d8bd | |||
| 4b45adaf39 | |||
| 6f2d33369b | |||
| e08727fa47 | |||
| 7624e6621a | |||
| cdddb6cb96 | |||
| f6c01a7674 | |||
| ffa5bf1b7d | |||
| 4c6e623ec5 | |||
| 621ef0703a | |||
| f514caadb0 | |||
| 4d92093c67 | |||
| bd9ea05ebb | |||
| e8599bd36e | |||
| 1accd0c1ba | |||
| 14488041bc | |||
| c11b29583e | |||
| 9467243ac3 | |||
| 32f1f7280b | |||
| ff81104834 | |||
| 6e7893d527 | |||
| 6efe5eefd3 | |||
| 3fd869a8ba | |||
| d337eed643 | |||
| 296d44159b | |||
| 4ce9f9b3ac | |||
| 9fb37229a1 | |||
| c8299f5b3e | |||
| f019a325ef | |||
| 0d69b723fc | |||
| d632258abb | |||
| 969fc17737 | |||
| ada0ea0f68 | |||
| fff912efd3 | |||
| c31b6ff1d5 | |||
| cf4b9dcb4d | |||
| 549c8aec4a | |||
| b7f7487b53 | |||
| dfc34b7295 | |||
| 83230766b2 | |||
| 3bd1f491d1 | |||
| 2c1562630d | |||
| 3451c2e72c | |||
| 00be97e741 | |||
| f947aafc2e | |||
| 3e9f2aa4bb | |||
| a6ce506714 | |||
| 9b9e8b385e | |||
| d3f30e73d0 | |||
| 257706ba0a | |||
| 2bc38e103d | |||
| 60b3e5cac1 | |||
| d14932474b | |||
| f0982e2683 | |||
| d8fbaf5d4f | |||
| 183d712252 | |||
| 3eb5447376 | |||
| 976c5077b9 | |||
| 4e00384830 | |||
| f779832861 | |||
| a482cb5d25 | |||
| f781039aa2 | |||
| 6e8a70ada1 | |||
| c43294c837 | |||
| 761995ce3c | |||
| d164dd3146 | |||
| 4b9b55ab17 | |||
| 6e9767c7c1 | |||
| b2f783b70b | |||
| 5a68426c9a | |||
| 32d77fa874 | |||
| 8d00af6351 | |||
| a91a0720f5 | |||
| f01208ad94 | |||
| 56b955f819 | |||
| 0d7761269c | |||
| 9ebaafa2af | |||
| 25ea6beb39 | |||
| 905bb2c6fd | |||
| 3b96cf3789 | |||
| 6d0cef41b4 | |||
| caf389c4e5 | |||
| 1237fd9ab5 | |||
| 1e5a9eb7b9 | |||
| 41fc0955f6 | |||
| f96c72c4b3 |
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
# See https://wiki.apertis.org/Guidelines/Coding_conventions#Code_formatting
|
# See https://www.apertis.org/policies/coding_conventions/#code-formatting
|
||||||
BasedOnStyle: GNU
|
BasedOnStyle: GNU
|
||||||
AlwaysBreakAfterDefinitionReturnType: All
|
AlwaysBreakAfterDefinitionReturnType: All
|
||||||
BreakBeforeBinaryOperators: None
|
BreakBeforeBinaryOperators: None
|
||||||
|
|||||||
+32
-36
@@ -78,6 +78,7 @@ style-check-diff:
|
|||||||
- "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*/*.node"
|
- "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*/*.node"
|
||||||
- "${CI_PROJECT_DIR}/_build/testsuite/tools/output/*/*"
|
- "${CI_PROJECT_DIR}/_build/testsuite/tools/output/*/*"
|
||||||
- "${CI_PROJECT_DIR}/_build/testsuite/gsk/compare/*/*/*.png"
|
- "${CI_PROJECT_DIR}/_build/testsuite/gsk/compare/*/*/*.png"
|
||||||
|
- "${CI_PROJECT_DIR}/_build/testsuite/gsk/compare/*/*/*.node"
|
||||||
- "${CI_PROJECT_DIR}/_build/testsuite/css/output/*/*.syscap"
|
- "${CI_PROJECT_DIR}/_build/testsuite/css/output/*/*.syscap"
|
||||||
- "${CI_PROJECT_DIR}/_build/testsuite/headless/*/*.log"
|
- "${CI_PROJECT_DIR}/_build/testsuite/headless/*/*.log"
|
||||||
- "${CI_PROJECT_DIR}/_build_hello/meson-logs"
|
- "${CI_PROJECT_DIR}/_build_hello/meson-logs"
|
||||||
@@ -209,51 +210,52 @@ msys2-mingw64:
|
|||||||
paths:
|
paths:
|
||||||
- "${CI_PROJECT_DIR}/_build/gtkdll.tar.gz"
|
- "${CI_PROJECT_DIR}/_build/gtkdll.tar.gz"
|
||||||
|
|
||||||
macos-x86_64:
|
macos:
|
||||||
rules:
|
rules:
|
||||||
# Do not run in forks as the runner is not available there.
|
# Do not run in forks as the runner is not available there.
|
||||||
- if: $CI_PROJECT_NAMESPACE == "GNOME"
|
# (except for dehesselle who maintains the runner)
|
||||||
|
- if: $CI_PROJECT_NAMESPACE != "GNOME" && $CI_PROJECT_NAMESPACE != "dehesselle"
|
||||||
|
when: never
|
||||||
|
- if: $RUNNER == "macosintel"
|
||||||
|
variables:
|
||||||
|
SDKROOT: /opt/sdks/MacOSX10.13.4.sdk
|
||||||
|
when: manual
|
||||||
|
allow_failure: true
|
||||||
|
- if: $RUNNER == "macosarm"
|
||||||
|
variables:
|
||||||
|
SDKROOT: /opt/sdks/MacOSX11.3.sdk
|
||||||
stage: build
|
stage: build
|
||||||
|
parallel:
|
||||||
|
matrix:
|
||||||
|
- RUNNER: [ "macosintel", "macosarm" ]
|
||||||
tags:
|
tags:
|
||||||
- macosintel
|
- ${RUNNER}
|
||||||
needs: []
|
needs: []
|
||||||
variables:
|
variables:
|
||||||
MESON_FORCE_BACKTRACKE: 1
|
EXTRA_MESON_FLAGS: ""
|
||||||
|
BACKEND_FLAGS: "-Dx11-backend=false -Dbroadway-backend=true"
|
||||||
|
FEATURE_FLAGS: "-Dmedia-gstreamer=disabled -Dintrospection=enabled -Dgobject-introspection:werror=false"
|
||||||
TMPDIR: /Users/Shared/work/tmp
|
TMPDIR: /Users/Shared/work/tmp
|
||||||
SDKROOT: /opt/sdks/MacOSX10.13.4.sdk
|
|
||||||
PIP_CACHE_DIR: /Users/Shared/build/cache
|
PIP_CACHE_DIR: /Users/Shared/build/cache
|
||||||
PIPENV_CACHE_DIR: $PIP_CACHE_DIR
|
PIPENV_CACHE_DIR: $PIP_CACHE_DIR
|
||||||
PYTHONPYCACHEPREFIX: $PIP_CACHE_DIR
|
PYTHONPYCACHEPREFIX: $PIP_CACHE_DIR
|
||||||
EXTRA_MESON_FLAGS: "-Dgobject-introspection:werror=false"
|
|
||||||
before_script:
|
before_script:
|
||||||
# Not using ccache on purpose as it accelerates the build so much that it
|
- .gitlab-ci/show-info-macos.sh
|
||||||
# can trigger race conditions in the gobject-introspection subproject.
|
- python3 -m venv .venv
|
||||||
- bash .gitlab-ci/show-info-osx.sh
|
# Building the introspection feature requires pkg-config and bison.
|
||||||
- /opt/macports/bin/python3.10 -m venv .venv
|
- curl -L $CI_API_V4_URL/projects/30437/packages/generic/pkgconfig/v0.29.2+10/pkg-config-0.29.2+10_$(uname -m).tar.xz | tar -C .venv -xJ
|
||||||
- ln -s /opt/cmake/CMake.app/Contents/bin/cmake .venv/bin
|
- curl -L $CI_API_V4_URL/projects/30438/packages/generic/bison/v3.8.2+3/bison-3.8.2+3_$(uname -m).tar.xz | tar -C .venv -xJ
|
||||||
- ln -s /opt/pkg-config/bin/pkg-config .venv/bin
|
|
||||||
- ln -s /opt/bison/bin/bison .venv/bin
|
|
||||||
- source .venv/bin/activate
|
- source .venv/bin/activate
|
||||||
- pip3 install meson==1.2.0
|
- pip3 install meson==1.3.2 ninja==1.11.1.1
|
||||||
- pip3 install ninja==1.11.1
|
# We're not setting up ccache here on purpose as it accelerates the build
|
||||||
- pip3 install /Users/Shared/build/pkgs/PyGObject-3.44.0-cp310-cp310-macosx_10_13_x86_64.whl
|
# so much that it triggers race conditions in the gobject-introspection
|
||||||
/Users/Shared/build/pkgs/pycairo-1.23.0-cp310-cp310-macosx_10_13_x86_64.whl
|
# subproject.
|
||||||
script:
|
script:
|
||||||
- meson setup
|
- meson setup
|
||||||
${COMMON_MESON_FLAGS}
|
${COMMON_MESON_FLAGS}
|
||||||
${EXTRA_MESON_FLAGS}
|
${EXTRA_MESON_FLAGS}
|
||||||
-Dx11-backend=false
|
${BACKEND_FLAGS}
|
||||||
-Dbroadway-backend=true
|
${FEATURE_FLAGS}
|
||||||
-Dmacos-backend=true
|
|
||||||
-Dmedia-gstreamer=disabled
|
|
||||||
-Dintrospection=enabled
|
|
||||||
-Dcpp_std=c++11
|
|
||||||
-Dpixman:tests=disabled
|
|
||||||
-Dlibjpeg-turbo:simd=disabled
|
|
||||||
-Dbuild-demos=false
|
|
||||||
-Dbuild-tests=false
|
|
||||||
-Dbuild-examples=false
|
|
||||||
-Dbuild-testsuite=false
|
|
||||||
_build
|
_build
|
||||||
- meson compile -C _build
|
- meson compile -C _build
|
||||||
artifacts:
|
artifacts:
|
||||||
@@ -428,13 +430,6 @@ asan-build:
|
|||||||
_build
|
_build
|
||||||
- ninja -C _build
|
- ninja -C _build
|
||||||
- .gitlab-ci/run-tests.sh _build wayland gtk
|
- .gitlab-ci/run-tests.sh _build wayland gtk
|
||||||
artifacts:
|
|
||||||
when: always
|
|
||||||
reports:
|
|
||||||
junit:
|
|
||||||
- "${CI_PROJECT_DIR}/_build/report-wayland.xml"
|
|
||||||
paths:
|
|
||||||
- "${CI_PROJECT_DIR}/_build/meson-logs"
|
|
||||||
|
|
||||||
reference:
|
reference:
|
||||||
image: $FEDORA_IMAGE
|
image: $FEDORA_IMAGE
|
||||||
@@ -484,3 +479,4 @@ publish-docs:
|
|||||||
- "curl -X POST -F token=${PAGES_TRIGGER_TOKEN} -F ref=docs-gtk-org https://gitlab.gnome.org/api/v4/projects/665/trigger/pipeline"
|
- "curl -X POST -F token=${PAGES_TRIGGER_TOKEN} -F ref=docs-gtk-org https://gitlab.gnome.org/api/v4/projects/665/trigger/pipeline"
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_REF_NAME == "main"
|
- if: $CI_COMMIT_REF_NAME == "main"
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,11 @@
|
|||||||
set -eux -o pipefail
|
set -eux -o pipefail
|
||||||
|
|
||||||
xcodebuild -version || :
|
xcodebuild -version || :
|
||||||
xcodebuild -showsdks || :
|
|
||||||
|
if [ -z "$SDKROOT" ]; then
|
||||||
|
xcodebuild -showsdks || :
|
||||||
|
else
|
||||||
|
echo "SDKROOT = $SDKROOT"
|
||||||
|
fi
|
||||||
|
|
||||||
system_profiler SPSoftwareDataType || :
|
system_profiler SPSoftwareDataType || :
|
||||||
@@ -1,6 +1,182 @@
|
|||||||
Overview of Changes in 4.13.6, xx-xx-xxxx
|
Overview of Changes in 4.13.9, xx-xx-xxxx
|
||||||
=========================================
|
=========================================
|
||||||
|
|
||||||
|
Note: The new renderers and dmabuf support are using graphics drivers
|
||||||
|
in different ways than the old gl renderer, and trigger new driver bugs,
|
||||||
|
(see for example https://gitlab.gnome.org/GNOME/gtk/-/issues/6418 and
|
||||||
|
https://gitlab.gnome.org/GNOME/gtk/-/issues/6388). Therefore, it is
|
||||||
|
recommended to use the latest mesa release (24.0) with the new renderers.
|
||||||
|
|
||||||
|
|
||||||
|
Overview of Changes in 4.13.8, 20-02-2024
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
* Accessibility:
|
||||||
|
- Add a GtkAccessibleText interface for allowing 3rd party
|
||||||
|
text widgets (notably vte) to be accessible
|
||||||
|
- Avoid duplicate accessible descriptions
|
||||||
|
- Fix GetAccessibleAtPoint
|
||||||
|
|
||||||
|
* GSK:
|
||||||
|
- Avoid offscreens for disjoint containers
|
||||||
|
- Don't use the gpu renderers with llvmpipe
|
||||||
|
- Fix various rendering issues found by tests
|
||||||
|
- Allow unnormalized node bounds again
|
||||||
|
- Fix a broken case of rounded-rect intersection
|
||||||
|
- Fix handling of external textures in gpu renderers
|
||||||
|
- Make gpu renderers work with WGL on Windows
|
||||||
|
|
||||||
|
* build:
|
||||||
|
- Allow building without dmabuf support on (old) Linux
|
||||||
|
|
||||||
|
* X11:
|
||||||
|
- Fix monitor enter/leave signals
|
||||||
|
|
||||||
|
* Translation updates:
|
||||||
|
Basque
|
||||||
|
Brazilian Portuguese
|
||||||
|
Catalan
|
||||||
|
Czech
|
||||||
|
Galician
|
||||||
|
Georgian
|
||||||
|
Hebrew
|
||||||
|
Lithuanian
|
||||||
|
Persian
|
||||||
|
Russian
|
||||||
|
Turkish
|
||||||
|
Ukrainian
|
||||||
|
|
||||||
|
|
||||||
|
Overview of Changes in 4.13.7, 11-02-2024
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
* GtkFileChooser:
|
||||||
|
- Speed up opening
|
||||||
|
|
||||||
|
* GtkCalendar:
|
||||||
|
- Add some missing setters and getters
|
||||||
|
|
||||||
|
* Accessibility:
|
||||||
|
- Add socket support for webkit accessibility
|
||||||
|
- Implement AT-SPI text for GtkText
|
||||||
|
- Implement AT-SPI component generically
|
||||||
|
- Add an announce API
|
||||||
|
|
||||||
|
* GSK:
|
||||||
|
- Make the ngl renderer work on macOS
|
||||||
|
- Fix a crash in the vulkan renderer
|
||||||
|
- Make nodeparser allow aliases for fonts again
|
||||||
|
- Implement cache eviction for glyph and texture caches
|
||||||
|
- Fix ngl shaders to work on GL < 4.0
|
||||||
|
- Require GL 3.3 for the ngl renderer
|
||||||
|
- Fix problems with scaled shadows
|
||||||
|
- Fix problems with holes for underlaid subsurfaces
|
||||||
|
- Improve handling of scales and glyph cache efficiency
|
||||||
|
|
||||||
|
* Media:
|
||||||
|
- Support dmabufs in the gstreamer backend. This allows
|
||||||
|
zero-copy video playback on Wayland when paired with
|
||||||
|
hardware video decoding
|
||||||
|
- Drop the experimental ffmpeg backend. It hasn't been
|
||||||
|
building for a year
|
||||||
|
|
||||||
|
* Wayland:
|
||||||
|
- Commit empty frames if and double-buffered state is pending
|
||||||
|
- Fix monitor size information when using mutter without
|
||||||
|
the scale-monitor-framebuffer setting
|
||||||
|
- Clear the current tablet on tab leave, fixing a crash
|
||||||
|
|
||||||
|
* macOS:
|
||||||
|
- Propagate unhandled input events back to the OS
|
||||||
|
|
||||||
|
* Tools:
|
||||||
|
- Make the crash handling in gtk4-node-editor more robust
|
||||||
|
|
||||||
|
* Translation updates
|
||||||
|
Galician
|
||||||
|
Georgian
|
||||||
|
Occitan
|
||||||
|
Turkish
|
||||||
|
|
||||||
|
|
||||||
|
Overview of Changes in 4.13.6, 25-01-2024
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
This release changes the ngl renderer to be the default renderer.
|
||||||
|
|
||||||
|
The intent of this change is to get wider testing and verify that
|
||||||
|
the new renderers are production-ready. If significant problems
|
||||||
|
show up, we will revert this change for 4.14.
|
||||||
|
|
||||||
|
You can still override the renderer choice using the GSK_RENDERER
|
||||||
|
environment variable.
|
||||||
|
|
||||||
|
Since ngl can handle fractional scaling much better than the old gl
|
||||||
|
renderer, we allow fractional scaling by default with gl now. If you
|
||||||
|
are using the old gl renderer (e.g. because your system is limited to
|
||||||
|
GLES2), you can disable fractional scaling by setting the GDK_DEBUG
|
||||||
|
environment variable to include the gl-no-fractional key.
|
||||||
|
|
||||||
|
* GtkColumnView:
|
||||||
|
- Fix infinite loops in dispose
|
||||||
|
- Fix problems with weak ref cycles in GtkExpression
|
||||||
|
|
||||||
|
* GtkListView:
|
||||||
|
- Fix some corner cases with sections during insertions and deletions
|
||||||
|
- Don't double-recycle widgets
|
||||||
|
|
||||||
|
* GtkStack:
|
||||||
|
- Add automatic cleanup for GtkStackPage
|
||||||
|
|
||||||
|
* GDK:
|
||||||
|
- Use standard cursor names for drag cursors
|
||||||
|
- Enable fractional scaling with gl by default
|
||||||
|
|
||||||
|
* GSK:
|
||||||
|
- Many fixes and improvements to the unified renderers:
|
||||||
|
- Fix text rendering with the uber shader
|
||||||
|
- Fix rounding issues with fractional scales
|
||||||
|
- Fix some memory leaks
|
||||||
|
- Many text rendering fixes
|
||||||
|
- Implement subpixel positioning for glyphs
|
||||||
|
- Support custom fonts in node files
|
||||||
|
- Add tests for font rendering
|
||||||
|
- Fix drawing of repeat nodes
|
||||||
|
- Implement subpixels positioning
|
||||||
|
- Evict stale textures, glyphs and atlases from the cache
|
||||||
|
- Some fixes and improvements to the GL renderer:
|
||||||
|
- Fix problems with GLES on Nvidia
|
||||||
|
- Avoid a crash in the mask demo
|
||||||
|
- Respect opacity of the first child node in containers
|
||||||
|
- Some fixes and improvements to the fallback renderer:
|
||||||
|
- Fix drawing of repeat nodes
|
||||||
|
- Make ngl the default renderer
|
||||||
|
|
||||||
|
* Wayland:
|
||||||
|
- Fix problems with tablet cursors
|
||||||
|
- Fix problems without seats
|
||||||
|
|
||||||
|
* Accessibility:
|
||||||
|
- Respect a separate "show-status-shapes setting
|
||||||
|
- Fix change notification for accessible names on some widgets
|
||||||
|
|
||||||
|
* Inspector:
|
||||||
|
- Show the git commit in devel builds
|
||||||
|
|
||||||
|
* Tools:
|
||||||
|
- Make gtk4-node-editor autosave its contents
|
||||||
|
- Add a benchmark command to gtk4-rendernode-tool
|
||||||
|
|
||||||
|
* Translation updates:
|
||||||
|
French
|
||||||
|
Galician
|
||||||
|
Georgian
|
||||||
|
Occitan
|
||||||
|
Persian
|
||||||
|
Russian
|
||||||
|
Vietnamese
|
||||||
|
|
||||||
|
|
||||||
Overview of Changes in 4.13.5, 07-01-2024
|
Overview of Changes in 4.13.5, 07-01-2024
|
||||||
=========================================
|
=========================================
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
/* Lists/Selections
|
/* Lists/Selections
|
||||||
|
* #Keywords: suggestion, completion
|
||||||
*
|
*
|
||||||
* The GtkDropDown widget is a modern alternative to GtkComboBox.
|
* The GtkDropDown widget is a modern alternative to GtkComboBox.
|
||||||
* It uses list models instead of tree models, and the content is
|
* It uses list models instead of tree models, and the content is
|
||||||
|
|||||||
@@ -68,8 +68,9 @@ struct _NodeEditorWindow
|
|||||||
|
|
||||||
GArray *errors;
|
GArray *errors;
|
||||||
|
|
||||||
guint update_timeout;
|
|
||||||
gboolean auto_reload;
|
gboolean auto_reload;
|
||||||
|
gboolean mark_as_safe_pending;
|
||||||
|
gulong after_paint_handler;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _NodeEditorWindowClass
|
struct _NodeEditorWindowClass
|
||||||
@@ -245,6 +246,41 @@ highlight_text (NodeEditorWindow *self)
|
|||||||
gtk_text_buffer_apply_tag_by_name (self->text_buffer, "no-hyphens", &start, &end);
|
gtk_text_buffer_apply_tag_by_name (self->text_buffer, "no-hyphens", &start, &end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
mark_autosave_as_unsafe (void)
|
||||||
|
{
|
||||||
|
char *path1 = NULL;
|
||||||
|
char *path2 = NULL;
|
||||||
|
|
||||||
|
path1 = get_autosave_path ("-unsafe");
|
||||||
|
path2 = get_autosave_path (NULL);
|
||||||
|
|
||||||
|
g_rename (path2, path1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
mark_autosave_as_safe (void)
|
||||||
|
{
|
||||||
|
char *path1 = NULL;
|
||||||
|
char *path2 = NULL;
|
||||||
|
|
||||||
|
path1 = get_autosave_path ("-unsafe");
|
||||||
|
path2 = get_autosave_path (NULL);
|
||||||
|
|
||||||
|
g_rename (path1, path2);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
after_paint (GdkFrameClock *clock,
|
||||||
|
NodeEditorWindow *self)
|
||||||
|
{
|
||||||
|
if (self->mark_as_safe_pending)
|
||||||
|
{
|
||||||
|
self->mark_as_safe_pending = FALSE;
|
||||||
|
mark_autosave_as_safe ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
reload (NodeEditorWindow *self)
|
reload (NodeEditorWindow *self)
|
||||||
{
|
{
|
||||||
@@ -253,6 +289,8 @@ reload (NodeEditorWindow *self)
|
|||||||
float scale;
|
float scale;
|
||||||
GskRenderNode *big_node;
|
GskRenderNode *big_node;
|
||||||
|
|
||||||
|
mark_autosave_as_unsafe ();
|
||||||
|
|
||||||
text = get_current_text (self->text_buffer);
|
text = get_current_text (self->text_buffer);
|
||||||
bytes = g_bytes_new_take (text, strlen (text));
|
bytes = g_bytes_new_take (text, strlen (text));
|
||||||
|
|
||||||
@@ -314,6 +352,8 @@ reload (NodeEditorWindow *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_clear_pointer (&big_node, gsk_render_node_unref);
|
g_clear_pointer (&big_node, gsk_render_node_unref);
|
||||||
|
|
||||||
|
self->mark_as_safe_pending = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1125,9 +1165,6 @@ node_editor_window_finalize (GObject *object)
|
|||||||
{
|
{
|
||||||
NodeEditorWindow *self = (NodeEditorWindow *)object;
|
NodeEditorWindow *self = (NodeEditorWindow *)object;
|
||||||
|
|
||||||
if (self->update_timeout)
|
|
||||||
g_source_remove (self->update_timeout);
|
|
||||||
|
|
||||||
g_array_free (self->errors, TRUE);
|
g_array_free (self->errors, TRUE);
|
||||||
|
|
||||||
g_clear_pointer (&self->node, gsk_render_node_unref);
|
g_clear_pointer (&self->node, gsk_render_node_unref);
|
||||||
@@ -1172,6 +1209,7 @@ static void
|
|||||||
node_editor_window_realize (GtkWidget *widget)
|
node_editor_window_realize (GtkWidget *widget)
|
||||||
{
|
{
|
||||||
NodeEditorWindow *self = NODE_EDITOR_WINDOW (widget);
|
NodeEditorWindow *self = NODE_EDITOR_WINDOW (widget);
|
||||||
|
GdkFrameClock *frameclock;
|
||||||
|
|
||||||
GTK_WIDGET_CLASS (node_editor_window_parent_class)->realize (widget);
|
GTK_WIDGET_CLASS (node_editor_window_parent_class)->realize (widget);
|
||||||
|
|
||||||
@@ -1199,14 +1237,24 @@ node_editor_window_realize (GtkWidget *widget)
|
|||||||
node_editor_window_add_renderer (self,
|
node_editor_window_add_renderer (self,
|
||||||
gsk_cairo_renderer_new (),
|
gsk_cairo_renderer_new (),
|
||||||
"Cairo");
|
"Cairo");
|
||||||
|
|
||||||
|
frameclock = gtk_widget_get_frame_clock (widget);
|
||||||
|
self->after_paint_handler = g_signal_connect (frameclock, "after-paint",
|
||||||
|
G_CALLBACK (after_paint), self);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
node_editor_window_unrealize (GtkWidget *widget)
|
node_editor_window_unrealize (GtkWidget *widget)
|
||||||
{
|
{
|
||||||
NodeEditorWindow *self = NODE_EDITOR_WINDOW (widget);
|
NodeEditorWindow *self = NODE_EDITOR_WINDOW (widget);
|
||||||
|
GdkFrameClock *frameclock;
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
|
frameclock = gtk_widget_get_frame_clock (widget);
|
||||||
|
g_signal_handler_disconnect (frameclock, self->after_paint_handler);
|
||||||
|
self->after_paint_handler = 0;
|
||||||
|
|
||||||
for (i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (self->renderers)); i ++)
|
for (i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (self->renderers)); i ++)
|
||||||
{
|
{
|
||||||
gpointer item = g_list_model_get_item (G_LIST_MODEL (self->renderers), i);
|
gpointer item = g_list_model_get_item (G_LIST_MODEL (self->renderers), i);
|
||||||
@@ -1567,23 +1615,6 @@ edit_action_cb (GtkWidget *widget,
|
|||||||
node_editor_window_edit (self, &start);
|
node_editor_window_edit (self, &start);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
node_editor_window_map (GtkWidget *widget)
|
|
||||||
{
|
|
||||||
char *path;
|
|
||||||
|
|
||||||
GTK_WIDGET_CLASS (node_editor_window_parent_class)->map (widget);
|
|
||||||
|
|
||||||
path = get_autosave_path (NULL);
|
|
||||||
if (g_file_test (path, G_FILE_TEST_EXISTS))
|
|
||||||
{
|
|
||||||
g_free (path);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_free (path);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
node_editor_window_set_property (GObject *object,
|
node_editor_window_set_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
@@ -1660,8 +1691,6 @@ node_editor_window_class_init (NodeEditorWindowClass *class)
|
|||||||
widget_class->realize = node_editor_window_realize;
|
widget_class->realize = node_editor_window_realize;
|
||||||
widget_class->unrealize = node_editor_window_unrealize;
|
widget_class->unrealize = node_editor_window_unrealize;
|
||||||
|
|
||||||
widget_class->map = node_editor_window_map;
|
|
||||||
|
|
||||||
properties[PROP_AUTO_RELOAD] = g_param_spec_boolean ("auto-reload", NULL, NULL,
|
properties[PROP_AUTO_RELOAD] = g_param_spec_boolean ("auto-reload", NULL, NULL,
|
||||||
TRUE,
|
TRUE,
|
||||||
G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_STATIC_NAME);
|
G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_STATIC_NAME);
|
||||||
@@ -1765,16 +1794,16 @@ set_initial_text (NodeEditorWindow *self)
|
|||||||
path = get_autosave_path (NULL);
|
path = get_autosave_path (NULL);
|
||||||
path1 = get_autosave_path ("-unsafe");
|
path1 = get_autosave_path ("-unsafe");
|
||||||
|
|
||||||
if (g_file_get_contents (path, &initial_text, &len, NULL))
|
if (g_file_get_contents (path1, &initial_text, &len, NULL))
|
||||||
{
|
|
||||||
gtk_text_buffer_set_text (self->text_buffer, initial_text, len);
|
|
||||||
g_free (initial_text);
|
|
||||||
}
|
|
||||||
else if (g_file_get_contents (path1, &initial_text, &len, NULL))
|
|
||||||
{
|
{
|
||||||
self->auto_reload = FALSE;
|
self->auto_reload = FALSE;
|
||||||
gtk_revealer_set_reveal_child (GTK_REVEALER (self->crash_warning), TRUE);
|
gtk_revealer_set_reveal_child (GTK_REVEALER (self->crash_warning), TRUE);
|
||||||
|
|
||||||
|
gtk_text_buffer_set_text (self->text_buffer, initial_text, len);
|
||||||
|
g_free (initial_text);
|
||||||
|
}
|
||||||
|
else if (g_file_get_contents (path, &initial_text, &len, NULL))
|
||||||
|
{
|
||||||
gtk_text_buffer_set_text (self->text_buffer, initial_text, len);
|
gtk_text_buffer_set_text (self->text_buffer, initial_text, len);
|
||||||
g_free (initial_text);
|
g_free (initial_text);
|
||||||
}
|
}
|
||||||
@@ -1825,41 +1854,6 @@ autosave_contents (NodeEditorWindow *self)
|
|||||||
g_free (contents);
|
g_free (contents);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
mark_autosave_as_safe (void)
|
|
||||||
{
|
|
||||||
char *path1 = NULL;
|
|
||||||
char *path2 = NULL;
|
|
||||||
|
|
||||||
path1 = get_autosave_path ("-unsafe");
|
|
||||||
path2 = get_autosave_path (NULL);
|
|
||||||
|
|
||||||
g_rename (path1, path2);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
update_timeout_cb (gpointer data)
|
|
||||||
{
|
|
||||||
NodeEditorWindow *self = data;
|
|
||||||
|
|
||||||
self->update_timeout = 0;
|
|
||||||
|
|
||||||
mark_autosave_as_safe ();
|
|
||||||
|
|
||||||
return G_SOURCE_REMOVE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
initiate_autosave (NodeEditorWindow *self)
|
|
||||||
{
|
|
||||||
autosave_contents (self);
|
|
||||||
|
|
||||||
if (self->update_timeout != 0)
|
|
||||||
g_source_remove (self->update_timeout);
|
|
||||||
|
|
||||||
self->update_timeout = g_timeout_add (100, update_timeout_cb, self);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
node_editor_window_init (NodeEditorWindow *self)
|
node_editor_window_init (NodeEditorWindow *self)
|
||||||
{
|
{
|
||||||
@@ -1924,7 +1918,7 @@ node_editor_window_init (NodeEditorWindow *self)
|
|||||||
|
|
||||||
set_initial_text (self);
|
set_initial_text (self);
|
||||||
|
|
||||||
g_signal_connect_swapped (self->text_buffer, "changed", G_CALLBACK (initiate_autosave), self);
|
g_signal_connect_swapped (self->text_buffer, "changed", G_CALLBACK (autosave_contents), self);
|
||||||
|
|
||||||
if (g_getenv ("GSK_RENDERER"))
|
if (g_getenv ("GSK_RENDERER"))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,10 +10,6 @@
|
|||||||
<attribute name="label" translatable="yes">_Help</attribute>
|
<attribute name="label" translatable="yes">_Help</attribute>
|
||||||
<attribute name="action">app.help</attribute>
|
<attribute name="action">app.help</attribute>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<attribute name="label" translatable="yes">_Help</attribute>
|
|
||||||
<attribute name="action">app.help</attribute>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<attribute name="label" translatable="yes">_Inspector</attribute>
|
<attribute name="label" translatable="yes">_Inspector</attribute>
|
||||||
<attribute name="action">app.inspector</attribute>
|
<attribute name="action">app.inspector</attribute>
|
||||||
@@ -213,6 +209,7 @@
|
|||||||
<property name="halign">1</property>
|
<property name="halign">1</property>
|
||||||
<property name="label" translatable="1">The application may have crashed.
|
<property name="label" translatable="1">The application may have crashed.
|
||||||
As a precaution, auto-loading has been turned off.
|
As a precaution, auto-loading has been turned off.
|
||||||
|
You can turn it back on in the menu.
|
||||||
</property>
|
</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ base_url = "https://gitlab.gnome.org/GNOME/gtk/-/blob/main/"
|
|||||||
|
|
||||||
[extra]
|
[extra]
|
||||||
content_images = [
|
content_images = [
|
||||||
|
"../images/favicon.svg",
|
||||||
|
"../images/favicon-192x192.png",
|
||||||
"images/gtk-logo.svg",
|
"images/gtk-logo.svg",
|
||||||
]
|
]
|
||||||
urlmap_file = "urlmap.js"
|
urlmap_file = "urlmap.js"
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ base_url = "https://gitlab.gnome.org/GNOME/gtk/-/blob/main/"
|
|||||||
|
|
||||||
[extra]
|
[extra]
|
||||||
content_images = [
|
content_images = [
|
||||||
|
"../images/favicon.svg",
|
||||||
|
"../images/favicon-192x192.png",
|
||||||
"images/gtk-logo.svg",
|
"images/gtk-logo.svg",
|
||||||
]
|
]
|
||||||
urlmap_file = "urlmap.js"
|
urlmap_file = "urlmap.js"
|
||||||
|
|||||||
@@ -67,6 +67,8 @@ content_files = [
|
|||||||
"macos.md",
|
"macos.md",
|
||||||
]
|
]
|
||||||
content_images = [
|
content_images = [
|
||||||
|
"../images/favicon.svg",
|
||||||
|
"../images/favicon-192x192.png",
|
||||||
"images/gtk-logo.svg",
|
"images/gtk-logo.svg",
|
||||||
"images/rotated-text.png",
|
"images/rotated-text.png",
|
||||||
"images/default_cursor.png",
|
"images/default_cursor.png",
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ content_files = [
|
|||||||
"paths.md",
|
"paths.md",
|
||||||
]
|
]
|
||||||
content_images = [
|
content_images = [
|
||||||
|
"../images/favicon.svg",
|
||||||
|
"../images/favicon-192x192.png",
|
||||||
"gtk-logo.svg",
|
"gtk-logo.svg",
|
||||||
"images/arc-dark.png",
|
"images/arc-dark.png",
|
||||||
"images/arc-light.png",
|
"images/arc-light.png",
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ By default, GTK will try to build with support for the Vulkan graphics
|
|||||||
API in addition to cairo and OpenGL. This option can be used to explicitly
|
API in addition to cairo and OpenGL. This option can be used to explicitly
|
||||||
control whether Vulkan should be used.
|
control whether Vulkan should be used.
|
||||||
|
|
||||||
### `media-gstreamer` and `media-ffmpeg`
|
### `media-gstreamer`
|
||||||
|
|
||||||
By default, GTK will try to build the gstreamer backend for
|
By default, GTK will try to build the gstreamer backend for
|
||||||
media playback support. These options can be used to explicitly
|
media playback support. These options can be used to explicitly
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ SYNOPSIS
|
|||||||
| **gtk4-rendernode-tool** <COMMAND> [OPTIONS...] <FILE>
|
| **gtk4-rendernode-tool** <COMMAND> [OPTIONS...] <FILE>
|
||||||
|
|
|
|
||||||
| **gtk4-rendernode-tool** benchmark [OPTIONS...] <FILE>
|
| **gtk4-rendernode-tool** benchmark [OPTIONS...] <FILE>
|
||||||
|
| **gtk4-rendernode-tool** compare [OPTIONS...] <FILE1> <FILE2>
|
||||||
| **gtk4-rendernode-tool** info [OPTIONS...] <FILE>
|
| **gtk4-rendernode-tool** info [OPTIONS...] <FILE>
|
||||||
| **gtk4-rendernode-tool** render [OPTIONS...] <FILE> [<FILE>]
|
| **gtk4-rendernode-tool** render [OPTIONS...] <FILE> [<FILE>]
|
||||||
| **gtk4-rendernode-tool** show [OPTIONS...] <FILE>
|
| **gtk4-rendernode-tool** show [OPTIONS...] <FILE>
|
||||||
@@ -75,7 +76,21 @@ and prints the runtimes.
|
|||||||
the execution of the commands on the GPU. It can be useful to use this flag to test
|
the execution of the commands on the GPU. It can be useful to use this flag to test
|
||||||
command submission performance.
|
command submission performance.
|
||||||
|
|
||||||
|
Compare
|
||||||
|
^^^^^^^
|
||||||
|
|
||||||
|
The ``compare`` command compares the rendering of a node with a reference image,
|
||||||
|
or the renderings of two nodes, or two images. If any differences are found, the
|
||||||
|
exit code is 1. If the images are identical, it is 0.
|
||||||
|
|
||||||
|
``--renderer=RENDERER``
|
||||||
|
|
||||||
|
Use the given renderer.
|
||||||
|
|
||||||
|
``--output=FILE``
|
||||||
|
|
||||||
|
Save the differences as a png image in ``FILE``.
|
||||||
|
|
||||||
|
``--quiet``
|
||||||
|
|
||||||
|
Don't write results to stdout.`
|
||||||
|
|||||||
@@ -85,6 +85,8 @@ content_files = [
|
|||||||
"visual_index.md",
|
"visual_index.md",
|
||||||
]
|
]
|
||||||
content_images = [
|
content_images = [
|
||||||
|
"../images/favicon.svg",
|
||||||
|
"../images/favicon-192x192.png",
|
||||||
"images/aboutdialog.png",
|
"images/aboutdialog.png",
|
||||||
"images/action-bar.png",
|
"images/action-bar.png",
|
||||||
"images/appchooserbutton.png",
|
"images/appchooserbutton.png",
|
||||||
|
|||||||
@@ -126,8 +126,8 @@ available on the system.
|
|||||||
### `GTK_MEDIA`
|
### `GTK_MEDIA`
|
||||||
|
|
||||||
Specifies what backend to load for [class@Gtk.MediaFile]. The possible values
|
Specifies what backend to load for [class@Gtk.MediaFile]. The possible values
|
||||||
depend on what options GTK was built with, and can include 'gstreamer',
|
depend on what options GTK was built with, and can include 'gstreamer'
|
||||||
'ffmpeg' and 'none'. If set to 'none', media playback will be unavailable.
|
and 'none'. If set to 'none', media playback will be unavailable.
|
||||||
The special value 'help' can be used to obtain a list of all supported
|
The special value 'help' can be used to obtain a list of all supported
|
||||||
media backends.
|
media backends.
|
||||||
|
|
||||||
@@ -220,8 +220,8 @@ A number of options affect behavior instead of logging:
|
|||||||
`gl-disable`
|
`gl-disable`
|
||||||
: Disable OpenGL support
|
: Disable OpenGL support
|
||||||
|
|
||||||
`gl-fractional`
|
`gl-no-fractional`
|
||||||
: Enable fractional scaling for OpenGL. This is experimental
|
: Disable fractional scaling for OpenGL.
|
||||||
|
|
||||||
`gl-debug`
|
`gl-debug`
|
||||||
: Insert debugging information in OpenGL
|
: Insert debugging information in OpenGL
|
||||||
@@ -460,6 +460,13 @@ disable certain optimizations of the "ngl" and "vulkan" renderer.
|
|||||||
The special value `all` can be used to turn on all values. The special
|
The special value `all` can be used to turn on all values. The special
|
||||||
value `help` can be used to obtain a list of all supported values.
|
value `help` can be used to obtain a list of all supported values.
|
||||||
|
|
||||||
|
### `GSK_CACHE_TIMEOUT`
|
||||||
|
|
||||||
|
Overrides the timeout for cache GC in the "ngl" and "vulkan" renderers.
|
||||||
|
The value can be -1 to disable GC entirely, 0 to force GC to happen
|
||||||
|
before every frame, or a positive number to do GC in a timeout every
|
||||||
|
n seconds. The default timeout is 15 seconds.
|
||||||
|
|
||||||
### `GSK_MAX_TEXTURE_SIZE`
|
### `GSK_MAX_TEXTURE_SIZE`
|
||||||
|
|
||||||
Limit texture size to the minimum of this value and the OpenGL limit
|
Limit texture size to the minimum of this value and the OpenGL limit
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.0" width="88.572334" height="96.050743" id="svg6843">
|
||||||
|
<defs id="defs6845"/>
|
||||||
|
<g transform="translate(-19.822308,-16.115941)" id="layer1">
|
||||||
|
<path d="M 20.88413,30.82696 53.816977,55.527708 107.33282,39.060543 70.587303,17.177763 20.88413,30.82696 z" id="path6976" style="fill:#729fcf;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline"/>
|
||||||
|
<path d="m 22.94243,82.287118 -2.0583,-51.460158 32.932847,24.700748 0,55.577152 L 22.94243,82.287118 z" id="path6978" style="fill:#e40000;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline"/>
|
||||||
|
<path d="m 53.816977,111.10486 49.399213,-20.58416 4.11663,-51.460157 -53.515843,16.467165 0,55.577152 z" id="path6980" style="fill:#7fe719;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline"/>
|
||||||
|
<path d="M 23.216626,81.319479 70.48573,67.361442 103.38422,90.444516" id="path6982" style="fill:none;stroke:#ffffff;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"/>
|
||||||
|
<path d="m 70.434539,17.875593 0,49.109284" id="path6984" style="fill:#babdb6;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.8 KiB |
@@ -123,7 +123,7 @@ static const GdkDebugKey gdk_debug_keys[] = {
|
|||||||
{ "portals", GDK_DEBUG_PORTALS, "Force use of portals" },
|
{ "portals", GDK_DEBUG_PORTALS, "Force use of portals" },
|
||||||
{ "no-portals", GDK_DEBUG_NO_PORTALS, "Disable use of portals" },
|
{ "no-portals", GDK_DEBUG_NO_PORTALS, "Disable use of portals" },
|
||||||
{ "gl-disable", GDK_DEBUG_GL_DISABLE, "Disable OpenGL support" },
|
{ "gl-disable", GDK_DEBUG_GL_DISABLE, "Disable OpenGL support" },
|
||||||
{ "gl-fractional", GDK_DEBUG_GL_FRACTIONAL, "Enable fractional scaling for OpenGL (experimental)" },
|
{ "gl-no-fractional", GDK_DEBUG_GL_NO_FRACTIONAL, "Disable fractional scaling for OpenGL" },
|
||||||
{ "gl-debug", GDK_DEBUG_GL_DEBUG, "Insert debugging information in OpenGL" },
|
{ "gl-debug", GDK_DEBUG_GL_DEBUG, "Insert debugging information in OpenGL" },
|
||||||
{ "gl-disable-gl", GDK_DEBUG_GL_DISABLE_GL, "Only allow OpenGL GLES API" },
|
{ "gl-disable-gl", GDK_DEBUG_GL_DISABLE_GL, "Only allow OpenGL GLES API" },
|
||||||
{ "gl-disable-gles", GDK_DEBUG_GL_DISABLE_GLES, "Don't allow OpenGL GLES API" },
|
{ "gl-disable-gles", GDK_DEBUG_GL_DISABLE_GLES, "Don't allow OpenGL GLES API" },
|
||||||
@@ -222,7 +222,6 @@ gdk_parse_debug_var (const char *variable,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *val = g_strndup (p, q - p);
|
|
||||||
for (i = 0; i < nkeys; i++)
|
for (i = 0; i < nkeys; i++)
|
||||||
{
|
{
|
||||||
if (strlen (keys[i].key) == q - p &&
|
if (strlen (keys[i].key) == q - p &&
|
||||||
@@ -233,8 +232,7 @@ gdk_parse_debug_var (const char *variable,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i == nkeys)
|
if (i == nkeys)
|
||||||
fprintf (stderr, "Unrecognized value \"%s\". Try %s=help\n", val, variable);
|
fprintf (stderr, "Unrecognized value \"%.*s\". Try %s=help\n", (int) (q - p), p, variable);
|
||||||
g_free (val);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p = q;
|
p = q;
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ typedef enum {
|
|||||||
GDK_DEBUG_PORTALS = 1 << 14,
|
GDK_DEBUG_PORTALS = 1 << 14,
|
||||||
GDK_DEBUG_NO_PORTALS = 1 << 15,
|
GDK_DEBUG_NO_PORTALS = 1 << 15,
|
||||||
GDK_DEBUG_GL_DISABLE = 1 << 16,
|
GDK_DEBUG_GL_DISABLE = 1 << 16,
|
||||||
GDK_DEBUG_GL_FRACTIONAL = 1 << 17,
|
GDK_DEBUG_GL_NO_FRACTIONAL= 1 << 17,
|
||||||
|
|
||||||
GDK_DEBUG_GL_DISABLE_GL = 1 << 19,
|
GDK_DEBUG_GL_DISABLE_GL = 1 << 19,
|
||||||
GDK_DEBUG_GL_DISABLE_GLES = 1 << 20,
|
GDK_DEBUG_GL_DISABLE_GLES = 1 << 20,
|
||||||
|
|||||||
+63
-7
@@ -77,6 +77,7 @@ enum
|
|||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_COMPOSITED,
|
PROP_COMPOSITED,
|
||||||
PROP_RGBA,
|
PROP_RGBA,
|
||||||
|
PROP_SHADOW_WIDTH,
|
||||||
PROP_INPUT_SHAPES,
|
PROP_INPUT_SHAPES,
|
||||||
PROP_DMABUF_FORMATS,
|
PROP_DMABUF_FORMATS,
|
||||||
LAST_PROP
|
LAST_PROP
|
||||||
@@ -111,6 +112,7 @@ struct _GdkDisplayPrivate {
|
|||||||
|
|
||||||
guint rgba : 1;
|
guint rgba : 1;
|
||||||
guint composited : 1;
|
guint composited : 1;
|
||||||
|
guint shadow_width: 1;
|
||||||
guint input_shapes : 1;
|
guint input_shapes : 1;
|
||||||
|
|
||||||
GdkDebugFlags debug_flags;
|
GdkDebugFlags debug_flags;
|
||||||
@@ -144,6 +146,10 @@ gdk_display_get_property (GObject *object,
|
|||||||
g_value_set_boolean (value, gdk_display_is_rgba (display));
|
g_value_set_boolean (value, gdk_display_is_rgba (display));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PROP_SHADOW_WIDTH:
|
||||||
|
g_value_set_boolean (value, gdk_display_supports_shadow_width (display));
|
||||||
|
break;
|
||||||
|
|
||||||
case PROP_INPUT_SHAPES:
|
case PROP_INPUT_SHAPES:
|
||||||
g_value_set_boolean (value, gdk_display_supports_input_shapes (display));
|
g_value_set_boolean (value, gdk_display_supports_input_shapes (display));
|
||||||
break;
|
break;
|
||||||
@@ -243,6 +249,18 @@ gdk_display_class_init (GdkDisplayClass *class)
|
|||||||
TRUE,
|
TRUE,
|
||||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GdkDisplay:shadow-width: (attributes org.gtk.Property.get=gdk_display_supports_shadow_width)
|
||||||
|
*
|
||||||
|
* %TRUE if the display supports extensible frames.
|
||||||
|
*
|
||||||
|
* Since: 4.14
|
||||||
|
*/
|
||||||
|
props[PROP_SHADOW_WIDTH] =
|
||||||
|
g_param_spec_boolean ("shadow-width", NULL, NULL,
|
||||||
|
TRUE,
|
||||||
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GdkDisplay:input-shapes: (attributes org.gtk.Property.get=gdk_display_supports_input_shapes)
|
* GdkDisplay:input-shapes: (attributes org.gtk.Property.get=gdk_display_supports_input_shapes)
|
||||||
*
|
*
|
||||||
@@ -254,7 +272,7 @@ gdk_display_class_init (GdkDisplayClass *class)
|
|||||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GdkDisplay:dmabuf-formats:
|
* GdkDisplay:dmabuf-formats: (attributes org.gtk.Property.get=gdk_display_get_dmabuf_formats)
|
||||||
*
|
*
|
||||||
* The dma-buf formats that are supported on this display
|
* The dma-buf formats that are supported on this display
|
||||||
*
|
*
|
||||||
@@ -391,6 +409,7 @@ gdk_display_init (GdkDisplay *display)
|
|||||||
|
|
||||||
priv->composited = TRUE;
|
priv->composited = TRUE;
|
||||||
priv->rgba = TRUE;
|
priv->rgba = TRUE;
|
||||||
|
priv->shadow_width = TRUE;
|
||||||
priv->input_shapes = TRUE;
|
priv->input_shapes = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1363,7 +1382,7 @@ gdk_display_init_gl (GdkDisplay *self)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
gdk_profiler_end_mark (before2, "realize OpenGL context", NULL);
|
gdk_profiler_end_mark (before2, "Realize OpenGL context", NULL);
|
||||||
|
|
||||||
/* Only assign after realize, so GdkGLContext::realize() can use
|
/* Only assign after realize, so GdkGLContext::realize() can use
|
||||||
* gdk_display_get_gl_context() == NULL to differentiate between
|
* gdk_display_get_gl_context() == NULL to differentiate between
|
||||||
@@ -1373,7 +1392,7 @@ gdk_display_init_gl (GdkDisplay *self)
|
|||||||
|
|
||||||
gdk_gl_backend_use (GDK_GL_CONTEXT_GET_CLASS (context)->backend_type);
|
gdk_gl_backend_use (GDK_GL_CONTEXT_GET_CLASS (context)->backend_type);
|
||||||
|
|
||||||
gdk_profiler_end_mark (before, "initialize OpenGL", NULL);
|
gdk_profiler_end_mark (before, "Init OpenGL", NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1768,7 +1787,6 @@ gdk_display_init_egl (GdkDisplay *self,
|
|||||||
{
|
{
|
||||||
GdkDisplayPrivate *priv = gdk_display_get_instance_private (self);
|
GdkDisplayPrivate *priv = gdk_display_get_instance_private (self);
|
||||||
G_GNUC_UNUSED gint64 start_time = GDK_PROFILER_CURRENT_TIME;
|
G_GNUC_UNUSED gint64 start_time = GDK_PROFILER_CURRENT_TIME;
|
||||||
G_GNUC_UNUSED gint64 start_time2;
|
|
||||||
int major, minor;
|
int major, minor;
|
||||||
|
|
||||||
if (!gdk_gl_backend_can_be_used (GDK_GL_EGL, error))
|
if (!gdk_gl_backend_can_be_used (GDK_GL_EGL, error))
|
||||||
@@ -1795,7 +1813,6 @@ gdk_display_init_egl (GdkDisplay *self,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
start_time2 = GDK_PROFILER_CURRENT_TIME;
|
|
||||||
if (!eglInitialize (priv->egl_display, &major, &minor))
|
if (!eglInitialize (priv->egl_display, &major, &minor))
|
||||||
{
|
{
|
||||||
priv->egl_display = NULL;
|
priv->egl_display = NULL;
|
||||||
@@ -1804,7 +1821,6 @@ gdk_display_init_egl (GdkDisplay *self,
|
|||||||
_("Could not initialize EGL display"));
|
_("Could not initialize EGL display"));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
gdk_profiler_end_mark (start_time2, "eglInitialize", NULL);
|
|
||||||
|
|
||||||
if (major < GDK_EGL_MIN_VERSION_MAJOR ||
|
if (major < GDK_EGL_MIN_VERSION_MAJOR ||
|
||||||
(major == GDK_EGL_MIN_VERSION_MAJOR && minor < GDK_EGL_MIN_VERSION_MINOR))
|
(major == GDK_EGL_MIN_VERSION_MAJOR && minor < GDK_EGL_MIN_VERSION_MINOR))
|
||||||
@@ -1894,7 +1910,7 @@ gdk_display_init_egl (GdkDisplay *self,
|
|||||||
g_free (ext);
|
g_free (ext);
|
||||||
}
|
}
|
||||||
|
|
||||||
gdk_profiler_end_mark (start_time, "init EGL", NULL);
|
gdk_profiler_end_mark (start_time, "Init EGL", NULL);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -2125,6 +2141,46 @@ gdk_display_set_rgba (GdkDisplay *display,
|
|||||||
g_object_notify_by_pspec (G_OBJECT (display), props[PROP_RGBA]);
|
g_object_notify_by_pspec (G_OBJECT (display), props[PROP_RGBA]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gdk_display_supports_shadow_width: (attributes org.gtk.Method.get_property=shadow-width)
|
||||||
|
* @display: a `GdkDisplay`
|
||||||
|
*
|
||||||
|
* Returns whether it's possible for a surface to draw outside of the window area.
|
||||||
|
*
|
||||||
|
* If %TRUE is returned the application decides if it wants to draw shadows.
|
||||||
|
* If %FALSE is returned, the compositor decides if it wants to draw shadows.
|
||||||
|
*
|
||||||
|
* Returns: %TRUE if surfaces can draw shadows or
|
||||||
|
* %FALSE if the display does not support this functionality.
|
||||||
|
*
|
||||||
|
* Since: 4.14
|
||||||
|
*/
|
||||||
|
gboolean
|
||||||
|
gdk_display_supports_shadow_width (GdkDisplay *display)
|
||||||
|
{
|
||||||
|
GdkDisplayPrivate *priv = gdk_display_get_instance_private (display);
|
||||||
|
|
||||||
|
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
|
||||||
|
|
||||||
|
return priv->shadow_width;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gdk_display_set_shadow_width (GdkDisplay *display,
|
||||||
|
gboolean shadow_width)
|
||||||
|
{
|
||||||
|
GdkDisplayPrivate *priv = gdk_display_get_instance_private (display);
|
||||||
|
|
||||||
|
g_return_if_fail (GDK_IS_DISPLAY (display));
|
||||||
|
|
||||||
|
if (priv->shadow_width == shadow_width)
|
||||||
|
return;
|
||||||
|
|
||||||
|
priv->shadow_width = shadow_width;
|
||||||
|
|
||||||
|
g_object_notify_by_pspec (G_OBJECT (display), props[PROP_SHADOW_WIDTH]);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
device_removed_cb (GdkSeat *seat,
|
device_removed_cb (GdkSeat *seat,
|
||||||
GdkDevice *device,
|
GdkDevice *device,
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ GDK_AVAILABLE_IN_ALL
|
|||||||
gboolean gdk_display_is_composited (GdkDisplay *display);
|
gboolean gdk_display_is_composited (GdkDisplay *display);
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
gboolean gdk_display_is_rgba (GdkDisplay *display);
|
gboolean gdk_display_is_rgba (GdkDisplay *display);
|
||||||
|
GDK_AVAILABLE_IN_4_14
|
||||||
|
gboolean gdk_display_supports_shadow_width (GdkDisplay *display);
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
gboolean gdk_display_supports_input_shapes (GdkDisplay *display);
|
gboolean gdk_display_supports_input_shapes (GdkDisplay *display);
|
||||||
|
|
||||||
|
|||||||
@@ -257,6 +257,8 @@ void gdk_display_set_composited (GdkDisplay *display
|
|||||||
gboolean composited);
|
gboolean composited);
|
||||||
void gdk_display_set_input_shapes (GdkDisplay *display,
|
void gdk_display_set_input_shapes (GdkDisplay *display,
|
||||||
gboolean input_shapes);
|
gboolean input_shapes);
|
||||||
|
void gdk_display_set_shadow_width (GdkDisplay *display,
|
||||||
|
gboolean shadow_width);
|
||||||
|
|
||||||
void gdk_display_add_seat (GdkDisplay *display,
|
void gdk_display_add_seat (GdkDisplay *display,
|
||||||
GdkSeat *seat);
|
GdkSeat *seat);
|
||||||
|
|||||||
+25
-1
@@ -2329,18 +2329,42 @@ gdk_dmabuf_sanitize (GdkDmabuf *dest,
|
|||||||
* @dmabuf: a sanitized GdkDmabuf
|
* @dmabuf: a sanitized GdkDmabuf
|
||||||
*
|
*
|
||||||
* A dmabuf is considered disjoint if it uses more than
|
* A dmabuf is considered disjoint if it uses more than
|
||||||
* 1 file descriptor.
|
* 1 inode.
|
||||||
|
* Multiple file descriptors may exist when the creator
|
||||||
|
* of the dmabuf just dup()ed once for every plane...
|
||||||
*
|
*
|
||||||
* Returns: %TRUE if the dmabuf is disjoint
|
* Returns: %TRUE if the dmabuf is disjoint
|
||||||
**/
|
**/
|
||||||
gboolean
|
gboolean
|
||||||
gdk_dmabuf_is_disjoint (const GdkDmabuf *dmabuf)
|
gdk_dmabuf_is_disjoint (const GdkDmabuf *dmabuf)
|
||||||
{
|
{
|
||||||
|
struct stat first_stat;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
|
/* First, do a fast check */
|
||||||
|
|
||||||
for (i = 1; i < dmabuf->n_planes; i++)
|
for (i = 1; i < dmabuf->n_planes; i++)
|
||||||
{
|
{
|
||||||
if (dmabuf->planes[0].fd != dmabuf->planes[i].fd)
|
if (dmabuf->planes[0].fd != dmabuf->planes[i].fd)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i == dmabuf->n_planes)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
/* We have different fds, do the fancy check instead */
|
||||||
|
|
||||||
|
if (fstat (dmabuf->planes[0].fd, &first_stat) != 0)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
for (i = 1; i < dmabuf->n_planes; i++)
|
||||||
|
{
|
||||||
|
struct stat plane_stat;
|
||||||
|
|
||||||
|
if (fstat (dmabuf->planes[0].fd, &plane_stat) != 0)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
if (first_stat.st_ino != plane_stat.st_ino)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+12
-1
@@ -154,6 +154,7 @@ gdk_dmabuf_get_egl_downloader (GdkDisplay *display,
|
|||||||
gboolean retval = FALSE;
|
gboolean retval = FALSE;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
GskRenderer *renderer;
|
GskRenderer *renderer;
|
||||||
|
GdkGLContext *previous;
|
||||||
|
|
||||||
g_assert (display->egl_dmabuf_formats == NULL);
|
g_assert (display->egl_dmabuf_formats == NULL);
|
||||||
g_assert (display->egl_external_formats == NULL);
|
g_assert (display->egl_external_formats == NULL);
|
||||||
@@ -161,6 +162,7 @@ gdk_dmabuf_get_egl_downloader (GdkDisplay *display,
|
|||||||
if (!gdk_display_prepare_gl (display, NULL))
|
if (!gdk_display_prepare_gl (display, NULL))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
previous = gdk_gl_context_get_current ();
|
||||||
formats = gdk_dmabuf_formats_builder_new ();
|
formats = gdk_dmabuf_formats_builder_new ();
|
||||||
external = gdk_dmabuf_formats_builder_new ();
|
external = gdk_dmabuf_formats_builder_new ();
|
||||||
|
|
||||||
@@ -172,7 +174,11 @@ gdk_dmabuf_get_egl_downloader (GdkDisplay *display,
|
|||||||
gdk_dmabuf_formats_builder_add_formats (builder, display->egl_dmabuf_formats);
|
gdk_dmabuf_formats_builder_add_formats (builder, display->egl_dmabuf_formats);
|
||||||
|
|
||||||
if (!retval)
|
if (!retval)
|
||||||
return NULL;
|
{
|
||||||
|
if (previous)
|
||||||
|
gdk_gl_context_make_current (previous);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
renderer = gsk_gl_renderer_new ();
|
renderer = gsk_gl_renderer_new ();
|
||||||
|
|
||||||
@@ -181,10 +187,15 @@ gdk_dmabuf_get_egl_downloader (GdkDisplay *display,
|
|||||||
g_warning ("Failed to realize GL renderer: %s", error->message);
|
g_warning ("Failed to realize GL renderer: %s", error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
g_object_unref (renderer);
|
g_object_unref (renderer);
|
||||||
|
if (previous)
|
||||||
|
gdk_gl_context_make_current (previous);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (previous)
|
||||||
|
gdk_gl_context_make_current (previous);
|
||||||
|
|
||||||
return GDK_DMABUF_DOWNLOADER (renderer);
|
return GDK_DMABUF_DOWNLOADER (renderer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -217,3 +217,41 @@ gdk_dmabuf_formats_peek_formats (GdkDmabufFormats *self)
|
|||||||
{
|
{
|
||||||
return self->formats;
|
return self->formats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gdk_dmabuf_formats_equal:
|
||||||
|
* @formats1: (nullable): a `GdkDmabufFormats`
|
||||||
|
* @formats2: (nullable): another `GdkDmabufFormats`
|
||||||
|
*
|
||||||
|
* Returns whether @formats1 and @formats2 contain the
|
||||||
|
* same dmabuf formats, in the same order.
|
||||||
|
*
|
||||||
|
* Returns: `TRUE` if @formats1 and @formats2 are equal
|
||||||
|
*
|
||||||
|
* Since: 4.14
|
||||||
|
*/
|
||||||
|
gboolean
|
||||||
|
gdk_dmabuf_formats_equal (const GdkDmabufFormats *formats1,
|
||||||
|
const GdkDmabufFormats *formats2)
|
||||||
|
{
|
||||||
|
if (formats1 == formats2)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
if (formats1 == NULL || formats2 == NULL)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (formats1->n_formats != formats2->n_formats)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
for (gsize i = 0; i < formats1->n_formats; i++)
|
||||||
|
{
|
||||||
|
GdkDmabufFormat *f1 = &formats1->formats[i];
|
||||||
|
GdkDmabufFormat *f2 = &formats2->formats[i];
|
||||||
|
|
||||||
|
if (f1->fourcc != f2->fourcc ||
|
||||||
|
f1->modifier != f2->modifier)
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|||||||
@@ -51,4 +51,8 @@ gboolean gdk_dmabuf_formats_contains (GdkDmabufFormats *formats
|
|||||||
guint32 fourcc,
|
guint32 fourcc,
|
||||||
guint64 modifier) G_GNUC_PURE;
|
guint64 modifier) G_GNUC_PURE;
|
||||||
|
|
||||||
|
GDK_AVAILABLE_IN_4_14
|
||||||
|
gboolean gdk_dmabuf_formats_equal (const GdkDmabufFormats *formats1,
|
||||||
|
const GdkDmabufFormats *formats2);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifdef HAVE_DMABUF
|
#include "config.h"
|
||||||
|
#ifdef HAVE_DRM_FOURCC_H
|
||||||
#include <drm_fourcc.h>
|
#include <drm_fourcc.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
/**
|
/**
|
||||||
* GdkDmabufTexture:
|
* GdkDmabufTexture:
|
||||||
*
|
*
|
||||||
* A `GdkTexture` representing a dma-buf object.
|
* A `GdkTexture` representing a DMA buffer.
|
||||||
*
|
*
|
||||||
* To create a `GdkDmabufTexture`, use the auxiliary
|
* To create a `GdkDmabufTexture`, use the auxiliary
|
||||||
* [class@Gdk.DmabufTextureBuilder] object.
|
* [class@Gdk.DmabufTextureBuilder] object.
|
||||||
|
|||||||
+177
-42
@@ -309,67 +309,202 @@ typedef enum
|
|||||||
* The color values are premultiplied with the alpha value.
|
* The color values are premultiplied with the alpha value.
|
||||||
* @GDK_MEMORY_R8G8B8A8_PREMULTIPLIED: 4 bytes; for red, green, blue, alpha
|
* @GDK_MEMORY_R8G8B8A8_PREMULTIPLIED: 4 bytes; for red, green, blue, alpha
|
||||||
* The color values are premultiplied with the alpha value.
|
* The color values are premultiplied with the alpha value.
|
||||||
* @GDK_MEMORY_A8B8G8R8_PREMULTIPLIED: 4 bytes; for alpha, blue, green, red,
|
|
||||||
* The color values are premultiplied with the alpha value. Since 4.14
|
|
||||||
* @GDK_MEMORY_B8G8R8A8: 4 bytes; for blue, green, red, alpha.
|
* @GDK_MEMORY_B8G8R8A8: 4 bytes; for blue, green, red, alpha.
|
||||||
* @GDK_MEMORY_A8R8G8B8: 4 bytes; for alpha, red, green, blue.
|
* @GDK_MEMORY_A8R8G8B8: 4 bytes; for alpha, red, green, blue.
|
||||||
* @GDK_MEMORY_R8G8B8A8: 4 bytes; for red, green, blue, alpha.
|
* @GDK_MEMORY_R8G8B8A8: 4 bytes; for red, green, blue, alpha.
|
||||||
* @GDK_MEMORY_A8B8G8R8: 4 bytes; for alpha, blue, green, red.
|
* @GDK_MEMORY_A8B8G8R8: 4 bytes; for alpha, blue, green, red.
|
||||||
* @GDK_MEMORY_B8G8R8X8: 4 bytes; for blue, green, red, unused. Since 4.14
|
|
||||||
* @GDK_MEMORY_X8R8G8B8: 4 bytes; for unused, red, green, blue. Since 4.14
|
|
||||||
* @GDK_MEMORY_R8G8B8X8: 4 bytes; for red, green, blue, unused. Since 4.14
|
|
||||||
* @GDK_MEMORY_X8B8G8R8: 4 bytes; for unused, blue, green, red. Since 4.14
|
|
||||||
* @GDK_MEMORY_R8G8B8: 3 bytes; for red, green, blue. The data is opaque.
|
* @GDK_MEMORY_R8G8B8: 3 bytes; for red, green, blue. The data is opaque.
|
||||||
* @GDK_MEMORY_B8G8R8: 3 bytes; for blue, green, red. The data is opaque.
|
* @GDK_MEMORY_B8G8R8: 3 bytes; for blue, green, red. The data is opaque.
|
||||||
* @GDK_MEMORY_R16G16B16: 3 guint16 values; for red, green, blue. Since: 4.6
|
|
||||||
* @GDK_MEMORY_R16G16B16A16_PREMULTIPLIED: 4 guint16 values; for red, green,
|
|
||||||
* blue, alpha. The color values are premultiplied with the alpha value.
|
|
||||||
* Since: 4.6
|
|
||||||
* @GDK_MEMORY_R16G16B16A16: 4 guint16 values; for red, green, blue, alpha.
|
|
||||||
* Since: 4.6
|
|
||||||
* @GDK_MEMORY_R16G16B16_FLOAT: 3 half-float values; for red, green, blue.
|
|
||||||
* The data is opaque. Since: 4.6
|
|
||||||
* @GDK_MEMORY_R16G16B16A16_FLOAT_PREMULTIPLIED: 4 half-float values; for
|
|
||||||
* red, green, blue and alpha. The color values are premultiplied with
|
|
||||||
* the alpha value. Since: 4.6
|
|
||||||
* @GDK_MEMORY_R16G16B16A16_FLOAT: 4 half-float values; for red, green,
|
|
||||||
* blue and alpha. Since: 4.6
|
|
||||||
* @GDK_MEMORY_B32G32R32_FLOAT: 3 float values; for blue, green, red.
|
|
||||||
* The data is opaque. Since: 4.6
|
|
||||||
* @GDK_MEMORY_R32G32B32A32_FLOAT_PREMULTIPLIED: 4 float values; for
|
|
||||||
* red, green, blue and alpha. The color values are premultiplied with
|
|
||||||
* the alpha value. Since: 4.6
|
|
||||||
* @GDK_MEMORY_R32G32B32A32_FLOAT: 4 float values; for red, green, blue and
|
|
||||||
* alpha. Since: 4.6
|
|
||||||
* @GDK_MEMORY_G8A8_PREMULTIPLIED: 2 bytes; for grayscale, alpha. The color
|
|
||||||
* values are premultiplied with the alpha value. Since: 4.12
|
|
||||||
* @GDK_MEMORY_G8A8: 2 bytes; for grayscale, alpha. Since: 4.12
|
|
||||||
* @GDK_MEMORY_G8: One byte; for grayscale. The data is opaque.
|
|
||||||
* Since: 4.12
|
|
||||||
* @GDK_MEMORY_G16A16_PREMULTIPLIED: 2 guint16 values; for grayscale, alpha.
|
|
||||||
* The color values are premultiplied with the alpha value. Since: 4.12
|
|
||||||
* @GDK_MEMORY_G16A16: 2 guint16 values; for grayscale, alpha. Since: 4.12
|
|
||||||
* @GDK_MEMORY_G16: One guint16 value; for grayscale. The data is opaque.
|
|
||||||
* Since: 4.12
|
|
||||||
* @GDK_MEMORY_A8: One byte; for alpha.
|
|
||||||
* Since: 4.12
|
|
||||||
* @GDK_MEMORY_A16: One guint16 value; for alpha.
|
|
||||||
* Since: 4.12
|
|
||||||
* @GDK_MEMORY_N_FORMATS: The number of formats. This value will change as
|
* @GDK_MEMORY_N_FORMATS: The number of formats. This value will change as
|
||||||
* more formats get added, so do not rely on its concrete integer.
|
* more formats get added, so do not rely on its concrete integer.
|
||||||
|
* @GDK_MEMORY_R32G32B32_FLOAT: 3 float values; for red, green, blue.
|
||||||
*
|
*
|
||||||
* `GdkMemoryFormat` describes formats that image data can have in memory.
|
* `GdkMemoryFormat` describes formats that image data can have in memory.
|
||||||
*
|
*
|
||||||
* It describes formats by listing the contents of the memory passed to it.
|
* It describes formats by listing the contents of the memory passed to it.
|
||||||
* So GDK_MEMORY_A8R8G8B8 will be 1 byte (8 bits) of alpha, followed by a
|
* So `GDK_MEMORY_A8R8G8B8` will be 1 byte (8 bits) of alpha, followed by a
|
||||||
* byte each of red, green and blue. It is not endian-dependent, so
|
* byte each of red, green and blue. It is not endian-dependent, so
|
||||||
* CAIRO_FORMAT_ARGB32 is represented by different `GdkMemoryFormats`
|
* `CAIRO_FORMAT_ARGB32` is represented by different `GdkMemoryFormats`
|
||||||
* on architectures with different endiannesses.
|
* on architectures with different endiannesses.
|
||||||
*
|
*
|
||||||
* Its naming is modelled after
|
* Its naming is modelled after
|
||||||
* [VkFormat](https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkFormat)
|
* [VkFormat](https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkFormat)
|
||||||
* for details).
|
* for details).
|
||||||
*/
|
*/
|
||||||
|
/**
|
||||||
|
* GDK_MEMORY_A8B8G8R8_PREMULTIPLIED:
|
||||||
|
*
|
||||||
|
* 4 bytes; for alpha, blue, green, red, The color values are premultiplied with
|
||||||
|
* the alpha value.
|
||||||
|
*
|
||||||
|
* Since: 4.14
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GDK_MEMORY_B8G8R8X8:
|
||||||
|
*
|
||||||
|
* 4 bytes; for blue, green, red, unused.
|
||||||
|
*
|
||||||
|
* Since: 4.14
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GDK_MEMORY_X8R8G8B8:
|
||||||
|
*
|
||||||
|
* 4 bytes; for unused, red, green, blue.
|
||||||
|
*
|
||||||
|
* Since: 4.14
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GDK_MEMORY_R8G8B8X8:
|
||||||
|
*
|
||||||
|
* 4 bytes; for red, green, blue, unused.
|
||||||
|
*
|
||||||
|
* Since: 4.14
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GDK_MEMORY_X8B8G8R8:
|
||||||
|
*
|
||||||
|
* 4 bytes; for unused, blue, green, red.
|
||||||
|
*
|
||||||
|
* Since: 4.14
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GDK_MEMORY_R16G16B16:
|
||||||
|
*
|
||||||
|
* 3 guint16 values; for red, green, blue.
|
||||||
|
*
|
||||||
|
* Since: 4.6
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GDK_MEMORY_R16G16B16A16_PREMULTIPLIED:
|
||||||
|
*
|
||||||
|
* 4 guint16 values; for red, green, blue, alpha. The color values are
|
||||||
|
* premultiplied with the alpha value.
|
||||||
|
*
|
||||||
|
* Since: 4.6
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GDK_MEMORY_R16G16B16A16:
|
||||||
|
*
|
||||||
|
* 4 guint16 values; for red, green, blue, alpha.
|
||||||
|
*
|
||||||
|
* Since: 4.6
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GDK_MEMORY_R16G16B16_FLOAT:
|
||||||
|
*
|
||||||
|
* 3 half-float values; for red, green, blue. The data is opaque.
|
||||||
|
*
|
||||||
|
* Since: 4.6
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GDK_MEMORY_R16G16B16A16_FLOAT_PREMULTIPLIED:
|
||||||
|
*
|
||||||
|
* 4 half-float values; for red, green, blue and alpha. The color values are
|
||||||
|
* premultiplied with the alpha value.
|
||||||
|
*
|
||||||
|
* Since: 4.6
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GDK_MEMORY_R16G16B16A16_FLOAT:
|
||||||
|
*
|
||||||
|
* 4 half-float values; for red, green, blue and alpha.
|
||||||
|
*
|
||||||
|
* Since: 4.6
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GDK_MEMORY_B32G32R32_FLOAT:
|
||||||
|
*
|
||||||
|
* 3 float values; for blue, green, red. The data is opaque.
|
||||||
|
*
|
||||||
|
* Since: 4.6
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GDK_MEMORY_R32G32B32A32_FLOAT_PREMULTIPLIED:
|
||||||
|
*
|
||||||
|
* 4 float values; for red, green, blue and alpha. The color values are
|
||||||
|
* premultiplied with the alpha value.
|
||||||
|
*
|
||||||
|
* Since: 4.6
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GDK_MEMORY_R32G32B32A32_FLOAT:
|
||||||
|
*
|
||||||
|
* 4 float values; for red, green, blue and alpha.
|
||||||
|
*
|
||||||
|
* Since: 4.6
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GDK_MEMORY_G8A8_PREMULTIPLIED:
|
||||||
|
*
|
||||||
|
* 2 bytes; for grayscale, alpha. The color values are premultiplied with the
|
||||||
|
* alpha value.
|
||||||
|
*
|
||||||
|
* Since: 4.12
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GDK_MEMORY_G8A8:
|
||||||
|
*
|
||||||
|
* 2 bytes; for grayscale, alpha.
|
||||||
|
*
|
||||||
|
* Since: 4.12
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GDK_MEMORY_G8:
|
||||||
|
*
|
||||||
|
* One byte; for grayscale. The data is opaque.
|
||||||
|
*
|
||||||
|
* Since: 4.12
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GDK_MEMORY_G16A16_PREMULTIPLIED:
|
||||||
|
*
|
||||||
|
* 2 guint16 values; for grayscale, alpha. The color values are premultiplied
|
||||||
|
* with the alpha value.
|
||||||
|
*
|
||||||
|
* Since: 4.12
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GDK_MEMORY_G16A16:
|
||||||
|
*
|
||||||
|
* 2 guint16 values; for grayscale, alpha.
|
||||||
|
*
|
||||||
|
* Since: 4.12
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GDK_MEMORY_G16:
|
||||||
|
*
|
||||||
|
* One guint16 value; for grayscale. The data is opaque.
|
||||||
|
*
|
||||||
|
* Since: 4.12
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GDK_MEMORY_A8:
|
||||||
|
*
|
||||||
|
* One byte; for alpha.
|
||||||
|
*
|
||||||
|
* Since: 4.12
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GDK_MEMORY_A16:
|
||||||
|
*
|
||||||
|
* One guint16 value; for alpha.
|
||||||
|
*
|
||||||
|
* Since: 4.12
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GDK_MEMORY_A16_FLOAT:
|
||||||
|
*
|
||||||
|
* One half-float value; for alpha.
|
||||||
|
*
|
||||||
|
* Since: 4.12
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* GDK_MEMORY_A32_FLOAT:
|
||||||
|
*
|
||||||
|
* One float value; for alpha.
|
||||||
|
*
|
||||||
|
* Since: 4.12
|
||||||
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
GDK_MEMORY_B8G8R8A8_PREMULTIPLIED,
|
GDK_MEMORY_B8G8R8A8_PREMULTIPLIED,
|
||||||
GDK_MEMORY_A8R8G8B8_PREMULTIPLIED,
|
GDK_MEMORY_A8R8G8B8_PREMULTIPLIED,
|
||||||
|
|||||||
+4
-4
@@ -477,18 +477,18 @@ check_event_sanity (GdkEvent *event)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void
|
gboolean
|
||||||
_gdk_event_emit (GdkEvent *event)
|
_gdk_event_emit (GdkEvent *event)
|
||||||
{
|
{
|
||||||
#ifdef G_ENABLE_DEBUG
|
#ifdef G_ENABLE_DEBUG
|
||||||
if (!check_event_sanity (event))
|
if (!check_event_sanity (event))
|
||||||
return;
|
return FALSE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (gdk_drag_handle_source_event (event))
|
if (gdk_drag_handle_source_event (event))
|
||||||
return;
|
return TRUE;
|
||||||
|
|
||||||
gdk_surface_handle_event (event);
|
return gdk_surface_handle_event (event);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************
|
/*********************************************
|
||||||
|
|||||||
@@ -619,16 +619,16 @@ typedef enum
|
|||||||
|
|
||||||
GdkEvent* _gdk_event_unqueue (GdkDisplay *display);
|
GdkEvent* _gdk_event_unqueue (GdkDisplay *display);
|
||||||
|
|
||||||
void _gdk_event_emit (GdkEvent *event);
|
gboolean _gdk_event_emit (GdkEvent *event);
|
||||||
GList* _gdk_event_queue_find_first (GdkDisplay *display);
|
GList* _gdk_event_queue_find_first (GdkDisplay *display);
|
||||||
void _gdk_event_queue_remove_link (GdkDisplay *display,
|
void _gdk_event_queue_remove_link (GdkDisplay *display,
|
||||||
GList *node);
|
GList *node);
|
||||||
GList* _gdk_event_queue_append (GdkDisplay *display,
|
GList* _gdk_event_queue_append (GdkDisplay *display,
|
||||||
GdkEvent *event);
|
GdkEvent *event);
|
||||||
|
|
||||||
void _gdk_event_queue_handle_motion_compression (GdkDisplay *display);
|
void _gdk_event_queue_handle_motion_compression (GdkDisplay *display);
|
||||||
void gdk_event_queue_handle_scroll_compression (GdkDisplay *display);
|
void gdk_event_queue_handle_scroll_compression (GdkDisplay *display);
|
||||||
void _gdk_event_queue_flush (GdkDisplay *display);
|
void _gdk_event_queue_flush (GdkDisplay *display);
|
||||||
|
|
||||||
double * gdk_event_dup_axes (GdkEvent *event);
|
double * gdk_event_dup_axes (GdkEvent *event);
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -687,7 +687,7 @@ _gdk_frame_clock_emit_update (GdkFrameClock *frame_clock)
|
|||||||
|
|
||||||
g_signal_emit (frame_clock, signals[UPDATE], 0);
|
g_signal_emit (frame_clock, signals[UPDATE], 0);
|
||||||
|
|
||||||
gdk_profiler_end_mark (before, "frameclock update", NULL);
|
gdk_profiler_end_mark (before, "Frameclock update", NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -699,7 +699,7 @@ _gdk_frame_clock_emit_layout (GdkFrameClock *frame_clock)
|
|||||||
|
|
||||||
g_signal_emit (frame_clock, signals[LAYOUT], 0);
|
g_signal_emit (frame_clock, signals[LAYOUT], 0);
|
||||||
|
|
||||||
gdk_profiler_end_mark (before, "frameclock layout", NULL);
|
gdk_profiler_end_mark (before, "Frameclock layout", NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -711,7 +711,7 @@ _gdk_frame_clock_emit_paint (GdkFrameClock *frame_clock)
|
|||||||
|
|
||||||
g_signal_emit (frame_clock, signals[PAINT], 0);
|
g_signal_emit (frame_clock, signals[PAINT], 0);
|
||||||
|
|
||||||
gdk_profiler_end_mark (before, "frameclock paint", NULL);
|
gdk_profiler_end_mark (before, "Frameclock paint", NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -811,12 +811,12 @@ _gdk_frame_clock_add_timings_to_profiler (GdkFrameClock *clock,
|
|||||||
{
|
{
|
||||||
if (timings->drawn_time != 0)
|
if (timings->drawn_time != 0)
|
||||||
{
|
{
|
||||||
gdk_profiler_add_mark (1000 * timings->drawn_time, 0, "drawn window", NULL);
|
gdk_profiler_add_mark (1000 * timings->drawn_time, 0, "Drawn window", NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timings->presentation_time != 0)
|
if (timings->presentation_time != 0)
|
||||||
{
|
{
|
||||||
gdk_profiler_add_mark (1000 * timings->presentation_time, 0, "presented window", NULL);
|
gdk_profiler_add_mark (1000 * timings->presentation_time, 0, "Presented window", NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
gdk_profiler_set_counter (fps_counter, gdk_frame_clock_get_fps (clock));
|
gdk_profiler_set_counter (fps_counter, gdk_frame_clock_get_fps (clock));
|
||||||
|
|||||||
@@ -694,7 +694,7 @@ gdk_frame_clock_paint_idle (void *data)
|
|||||||
if (!gdk_frame_clock_idle_is_frozen (clock_idle))
|
if (!gdk_frame_clock_idle_is_frozen (clock_idle))
|
||||||
priv->sleep_serial = get_sleep_serial ();
|
priv->sleep_serial = get_sleep_serial ();
|
||||||
|
|
||||||
gdk_profiler_end_mark (before, "frameclock cycle", NULL);
|
gdk_profiler_end_mark (before, "Frameclock cycle", NULL);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-17
@@ -79,6 +79,7 @@
|
|||||||
#include "gdkdebugprivate.h"
|
#include "gdkdebugprivate.h"
|
||||||
#include "gdkdisplayprivate.h"
|
#include "gdkdisplayprivate.h"
|
||||||
#include "gdkdmabufeglprivate.h"
|
#include "gdkdmabufeglprivate.h"
|
||||||
|
#include "gdkdmabuffourccprivate.h"
|
||||||
#include "gdkmemoryformatprivate.h"
|
#include "gdkmemoryformatprivate.h"
|
||||||
#include "gdkmemorytextureprivate.h"
|
#include "gdkmemorytextureprivate.h"
|
||||||
#include "gdkprofilerprivate.h"
|
#include "gdkprofilerprivate.h"
|
||||||
@@ -98,10 +99,6 @@
|
|||||||
#include <epoxy/egl.h>
|
#include <epoxy/egl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_DMABUF
|
|
||||||
#include <drm_fourcc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#define DEFAULT_ALLOWED_APIS GDK_GL_API_GL | GDK_GL_API_GLES
|
#define DEFAULT_ALLOWED_APIS GDK_GL_API_GL | GDK_GL_API_GLES
|
||||||
@@ -386,7 +383,7 @@ gdk_gl_context_create_egl_context (GdkGLContext *context,
|
|||||||
else if (epoxy_has_egl_extension (egl_display, "EGL_EXT_swap_buffers_with_damage"))
|
else if (epoxy_has_egl_extension (egl_display, "EGL_EXT_swap_buffers_with_damage"))
|
||||||
priv->eglSwapBuffersWithDamage = (gpointer) epoxy_eglGetProcAddress ("eglSwapBuffersWithDamageEXT");
|
priv->eglSwapBuffersWithDamage = (gpointer) epoxy_eglGetProcAddress ("eglSwapBuffersWithDamageEXT");
|
||||||
|
|
||||||
gdk_profiler_end_mark (start_time, "realize GdkWaylandGLContext", NULL);
|
gdk_profiler_end_mark (start_time, "Create EGL context", NULL);
|
||||||
|
|
||||||
return api;
|
return api;
|
||||||
}
|
}
|
||||||
@@ -593,7 +590,7 @@ gdk_gl_context_get_scale (GdkGLContext *self)
|
|||||||
scale = gdk_surface_get_scale (surface);
|
scale = gdk_surface_get_scale (surface);
|
||||||
|
|
||||||
display = gdk_gl_context_get_display (self);
|
display = gdk_gl_context_get_display (self);
|
||||||
if (!(gdk_display_get_debug_flags (display) & GDK_DEBUG_GL_FRACTIONAL))
|
if (gdk_display_get_debug_flags (display) & GDK_DEBUG_GL_NO_FRACTIONAL)
|
||||||
scale = ceil (scale);
|
scale = ceil (scale);
|
||||||
|
|
||||||
return scale;
|
return scale;
|
||||||
@@ -669,7 +666,7 @@ gdk_gl_context_real_end_frame (GdkDrawContext *draw_context,
|
|||||||
|
|
||||||
egl_surface = gdk_surface_get_egl_surface (surface);
|
egl_surface = gdk_surface_get_egl_surface (surface);
|
||||||
|
|
||||||
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "EGL", "swap buffers");
|
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "EGL swap buffers", NULL);
|
||||||
|
|
||||||
if (priv->eglSwapBuffersWithDamage)
|
if (priv->eglSwapBuffersWithDamage)
|
||||||
{
|
{
|
||||||
@@ -1718,7 +1715,7 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
|
|||||||
}
|
}
|
||||||
|
|
||||||
priv->has_half_float = gdk_gl_context_check_version (context, "3.0", "3.0") ||
|
priv->has_half_float = gdk_gl_context_check_version (context, "3.0", "3.0") ||
|
||||||
epoxy_has_gl_extension ("OES_vertex_half_float");
|
epoxy_has_gl_extension ("GL_OES_vertex_half_float");
|
||||||
|
|
||||||
priv->has_sync = gdk_gl_context_check_version (context, "3.2", "3.0") ||
|
priv->has_sync = gdk_gl_context_check_version (context, "3.2", "3.0") ||
|
||||||
epoxy_has_gl_extension ("GL_ARB_sync") ||
|
epoxy_has_gl_extension ("GL_ARB_sync") ||
|
||||||
@@ -2042,15 +2039,6 @@ gdk_gl_context_has_sync (GdkGLContext *self)
|
|||||||
return priv->has_sync;
|
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
|
/* Return if glGenVertexArrays, glBindVertexArray and glDeleteVertexArrays
|
||||||
* can be used
|
* can be used
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -171,8 +171,6 @@ 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_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;
|
gboolean gdk_gl_context_has_vertex_arrays (GdkGLContext *self) G_GNUC_PURE;
|
||||||
|
|
||||||
double gdk_gl_context_get_scale (GdkGLContext *self);
|
double gdk_gl_context_get_scale (GdkGLContext *self);
|
||||||
|
|||||||
+74
-2
@@ -26,6 +26,8 @@
|
|||||||
#include "gdkenumtypes.h"
|
#include "gdkenumtypes.h"
|
||||||
#include "gdkrectangle.h"
|
#include "gdkrectangle.h"
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GdkMonitor:
|
* GdkMonitor:
|
||||||
*
|
*
|
||||||
@@ -46,6 +48,7 @@ enum {
|
|||||||
PROP_MODEL,
|
PROP_MODEL,
|
||||||
PROP_CONNECTOR,
|
PROP_CONNECTOR,
|
||||||
PROP_SCALE_FACTOR,
|
PROP_SCALE_FACTOR,
|
||||||
|
PROP_SCALE,
|
||||||
PROP_GEOMETRY,
|
PROP_GEOMETRY,
|
||||||
PROP_WIDTH_MM,
|
PROP_WIDTH_MM,
|
||||||
PROP_HEIGHT_MM,
|
PROP_HEIGHT_MM,
|
||||||
@@ -70,6 +73,8 @@ static void
|
|||||||
gdk_monitor_init (GdkMonitor *monitor)
|
gdk_monitor_init (GdkMonitor *monitor)
|
||||||
{
|
{
|
||||||
monitor->scale_factor = 1;
|
monitor->scale_factor = 1;
|
||||||
|
monitor->scale = 1.0;
|
||||||
|
monitor->scale_set = FALSE;
|
||||||
monitor->valid = TRUE;
|
monitor->valid = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,6 +112,10 @@ gdk_monitor_get_property (GObject *object,
|
|||||||
g_value_set_int (value, monitor->scale_factor);
|
g_value_set_int (value, monitor->scale_factor);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PROP_SCALE:
|
||||||
|
g_value_set_double (value, monitor->scale);
|
||||||
|
break;
|
||||||
|
|
||||||
case PROP_GEOMETRY:
|
case PROP_GEOMETRY:
|
||||||
g_value_set_boxed (value, &monitor->geometry);
|
g_value_set_boxed (value, &monitor->geometry);
|
||||||
break;
|
break;
|
||||||
@@ -233,13 +242,28 @@ gdk_monitor_class_init (GdkMonitorClass *class)
|
|||||||
* GdkMonitor:scale-factor: (attributes org.gtk.Property.get=gdk_monitor_get_scale_factor)
|
* GdkMonitor:scale-factor: (attributes org.gtk.Property.get=gdk_monitor_get_scale_factor)
|
||||||
*
|
*
|
||||||
* The scale factor.
|
* The scale factor.
|
||||||
|
*
|
||||||
|
* The scale factor is the next larger integer,
|
||||||
|
* compared to [property@Gdk.Surface:scale].
|
||||||
*/
|
*/
|
||||||
props[PROP_SCALE_FACTOR] =
|
props[PROP_SCALE_FACTOR] =
|
||||||
g_param_spec_int ("scale-factor", NULL, NULL,
|
g_param_spec_int ("scale-factor", NULL, NULL,
|
||||||
0, G_MAXINT,
|
1, G_MAXINT,
|
||||||
1,
|
1,
|
||||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GdkMonitor:scale: (attributes org.gtk.Property.get=gdk_monitor_get_scale)
|
||||||
|
*
|
||||||
|
* The scale of the monitor.
|
||||||
|
*
|
||||||
|
* Since: 4.14
|
||||||
|
*/
|
||||||
|
props[PROP_SCALE] =
|
||||||
|
g_param_spec_double ("scale", NULL, NULL,
|
||||||
|
1., G_MAXDOUBLE, 1.,
|
||||||
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GdkMonitor:geometry: (attributes org.gtk.Property.get=gdk_monitor_get_geometry)
|
* GdkMonitor:geometry: (attributes org.gtk.Property.get=gdk_monitor_get_geometry)
|
||||||
*
|
*
|
||||||
@@ -346,7 +370,7 @@ gdk_monitor_get_display (GdkMonitor *monitor)
|
|||||||
* display coordinate space.
|
* display coordinate space.
|
||||||
*
|
*
|
||||||
* The returned geometry is in ”application pixels”, not in
|
* The returned geometry is in ”application pixels”, not in
|
||||||
* ”device pixels” (see [method@Gdk.Monitor.get_scale_factor]).
|
* ”device pixels” (see [method@Gdk.Monitor.get_scale]).
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
gdk_monitor_get_geometry (GdkMonitor *monitor,
|
gdk_monitor_get_geometry (GdkMonitor *monitor,
|
||||||
@@ -472,6 +496,29 @@ gdk_monitor_get_scale_factor (GdkMonitor *monitor)
|
|||||||
return monitor->scale_factor;
|
return monitor->scale_factor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gdk_monitor_get_scale: (attributes org.gtk.Method.get_property=scale)
|
||||||
|
* @monitor: a `GdkMonitor`
|
||||||
|
*
|
||||||
|
* Gets the internal scale factor that maps from monitor coordinates
|
||||||
|
* to device pixels.
|
||||||
|
*
|
||||||
|
* This can be used if you want to create pixel based data for a
|
||||||
|
* particular monitor, but most of the time you’re drawing to a surface
|
||||||
|
* where it is better to use [method@Gdk.Surface.get_scale] instead.
|
||||||
|
*
|
||||||
|
* Returns: the scale
|
||||||
|
*
|
||||||
|
* Since: 4.14
|
||||||
|
*/
|
||||||
|
double
|
||||||
|
gdk_monitor_get_scale (GdkMonitor *monitor)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (GDK_IS_MONITOR (monitor), 1.);
|
||||||
|
|
||||||
|
return monitor->scale;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gdk_monitor_get_refresh_rate: (attributes org.gtk.Method.get_property=refresh-rate)
|
* gdk_monitor_get_refresh_rate: (attributes org.gtk.Method.get_property=refresh-rate)
|
||||||
* @monitor: a `GdkMonitor`
|
* @monitor: a `GdkMonitor`
|
||||||
@@ -583,12 +630,37 @@ void
|
|||||||
gdk_monitor_set_scale_factor (GdkMonitor *monitor,
|
gdk_monitor_set_scale_factor (GdkMonitor *monitor,
|
||||||
int scale_factor)
|
int scale_factor)
|
||||||
{
|
{
|
||||||
|
g_return_if_fail (scale_factor >= 1);
|
||||||
|
|
||||||
|
if (monitor->scale_set)
|
||||||
|
return;
|
||||||
|
|
||||||
if (monitor->scale_factor == scale_factor)
|
if (monitor->scale_factor == scale_factor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
monitor->scale_factor = scale_factor;
|
monitor->scale_factor = scale_factor;
|
||||||
|
monitor->scale = scale_factor;
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (monitor), "scale-factor");
|
g_object_notify (G_OBJECT (monitor), "scale-factor");
|
||||||
|
g_object_notify (G_OBJECT (monitor), "scale");
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gdk_monitor_set_scale (GdkMonitor *monitor,
|
||||||
|
double scale)
|
||||||
|
{
|
||||||
|
g_return_if_fail (scale >= 1.);
|
||||||
|
|
||||||
|
monitor->scale_set = TRUE;
|
||||||
|
|
||||||
|
if (monitor->scale == scale)
|
||||||
|
return;
|
||||||
|
|
||||||
|
monitor->scale = scale;
|
||||||
|
monitor->scale_factor = (int) ceil (scale);
|
||||||
|
|
||||||
|
g_object_notify (G_OBJECT (monitor), "scale");
|
||||||
|
g_object_notify (G_OBJECT (monitor), "scale-factor");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -77,6 +77,8 @@ GDK_AVAILABLE_IN_ALL
|
|||||||
const char * gdk_monitor_get_connector (GdkMonitor *monitor);
|
const char * gdk_monitor_get_connector (GdkMonitor *monitor);
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
int gdk_monitor_get_scale_factor (GdkMonitor *monitor);
|
int gdk_monitor_get_scale_factor (GdkMonitor *monitor);
|
||||||
|
GDK_AVAILABLE_IN_4_14
|
||||||
|
double gdk_monitor_get_scale (GdkMonitor *monitor);
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
int gdk_monitor_get_refresh_rate (GdkMonitor *monitor);
|
int gdk_monitor_get_refresh_rate (GdkMonitor *monitor);
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ struct _GdkMonitor {
|
|||||||
int refresh_rate;
|
int refresh_rate;
|
||||||
GdkSubpixelLayout subpixel_layout;
|
GdkSubpixelLayout subpixel_layout;
|
||||||
gboolean valid;
|
gboolean valid;
|
||||||
|
double scale;
|
||||||
|
gboolean scale_set;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GdkMonitorClass {
|
struct _GdkMonitorClass {
|
||||||
@@ -64,7 +66,9 @@ void gdk_monitor_set_physical_size (GdkMonitor *monitor,
|
|||||||
int width_mm,
|
int width_mm,
|
||||||
int height_mm);
|
int height_mm);
|
||||||
void gdk_monitor_set_scale_factor (GdkMonitor *monitor,
|
void gdk_monitor_set_scale_factor (GdkMonitor *monitor,
|
||||||
int scale);
|
int scale_factor);
|
||||||
|
void gdk_monitor_set_scale (GdkMonitor *monitor,
|
||||||
|
double scale);
|
||||||
void gdk_monitor_set_refresh_rate (GdkMonitor *monitor,
|
void gdk_monitor_set_refresh_rate (GdkMonitor *monitor,
|
||||||
int refresh_rate);
|
int refresh_rate);
|
||||||
void gdk_monitor_set_subpixel_layout (GdkMonitor *monitor,
|
void gdk_monitor_set_subpixel_layout (GdkMonitor *monitor,
|
||||||
|
|||||||
+7
-6
@@ -32,6 +32,7 @@
|
|||||||
#include "version/gdkversionmacros.h"
|
#include "version/gdkversionmacros.h"
|
||||||
#include "gdkframeclockprivate.h"
|
#include "gdkframeclockprivate.h"
|
||||||
|
|
||||||
|
#define CATEGORY "GTK"
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
gdk_profiler_is_running (void)
|
gdk_profiler_is_running (void)
|
||||||
@@ -50,7 +51,7 @@ void
|
|||||||
const char *message)
|
const char *message)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SYSPROF
|
#ifdef HAVE_SYSPROF
|
||||||
sysprof_collector_mark (begin_time, duration, "gtk", name, message);
|
sysprof_collector_mark (begin_time, duration, CATEGORY, name, message);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,7 +61,7 @@ void
|
|||||||
const char *message)
|
const char *message)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SYSPROF
|
#ifdef HAVE_SYSPROF
|
||||||
sysprof_collector_mark (begin_time, GDK_PROFILER_CURRENT_TIME - begin_time, "gtk", name, message);
|
sysprof_collector_mark (begin_time, GDK_PROFILER_CURRENT_TIME - begin_time, CATEGORY, name, message);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,7 +75,7 @@ void
|
|||||||
#ifdef HAVE_SYSPROF
|
#ifdef HAVE_SYSPROF
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start (args, message_format);
|
va_start (args, message_format);
|
||||||
sysprof_collector_mark_vprintf (begin_time, duration, "gtk", name, message_format, args);
|
sysprof_collector_mark_vprintf (begin_time, duration, CATEGORY, name, message_format, args);
|
||||||
va_end (args);
|
va_end (args);
|
||||||
#endif /* HAVE_SYSPROF */
|
#endif /* HAVE_SYSPROF */
|
||||||
}
|
}
|
||||||
@@ -88,7 +89,7 @@ void
|
|||||||
#ifdef HAVE_SYSPROF
|
#ifdef HAVE_SYSPROF
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start (args, message_format);
|
va_start (args, message_format);
|
||||||
sysprof_collector_mark_vprintf (begin_time, GDK_PROFILER_CURRENT_TIME - begin_time, "gtk", name, message_format, args);
|
sysprof_collector_mark_vprintf (begin_time, GDK_PROFILER_CURRENT_TIME - begin_time, CATEGORY, name, message_format, args);
|
||||||
va_end (args);
|
va_end (args);
|
||||||
#endif /* HAVE_SYSPROF */
|
#endif /* HAVE_SYSPROF */
|
||||||
}
|
}
|
||||||
@@ -103,7 +104,7 @@ guint
|
|||||||
counter.id = sysprof_collector_request_counters (1);
|
counter.id = sysprof_collector_request_counters (1);
|
||||||
counter.type = SYSPROF_CAPTURE_COUNTER_DOUBLE;
|
counter.type = SYSPROF_CAPTURE_COUNTER_DOUBLE;
|
||||||
counter.value.vdbl = 0.0;
|
counter.value.vdbl = 0.0;
|
||||||
g_strlcpy (counter.category, "gtk", sizeof counter.category);
|
g_strlcpy (counter.category, CATEGORY, sizeof counter.category);
|
||||||
g_strlcpy (counter.name, name, sizeof counter.name);
|
g_strlcpy (counter.name, name, sizeof counter.name);
|
||||||
g_strlcpy (counter.description, description, sizeof counter.name);
|
g_strlcpy (counter.description, description, sizeof counter.name);
|
||||||
|
|
||||||
@@ -125,7 +126,7 @@ guint
|
|||||||
counter.id = sysprof_collector_request_counters (1);
|
counter.id = sysprof_collector_request_counters (1);
|
||||||
counter.type = SYSPROF_CAPTURE_COUNTER_INT64;
|
counter.type = SYSPROF_CAPTURE_COUNTER_INT64;
|
||||||
counter.value.v64 = 0;
|
counter.value.v64 = 0;
|
||||||
g_strlcpy (counter.category, "gtk", sizeof counter.category);
|
g_strlcpy (counter.category, CATEGORY, sizeof counter.category);
|
||||||
g_strlcpy (counter.name, name, sizeof counter.name);
|
g_strlcpy (counter.name, name, sizeof counter.name);
|
||||||
g_strlcpy (counter.description, description, sizeof counter.name);
|
g_strlcpy (counter.description, description, sizeof counter.name);
|
||||||
|
|
||||||
|
|||||||
+108
-8
@@ -20,6 +20,7 @@
|
|||||||
#include "gdksubsurfaceprivate.h"
|
#include "gdksubsurfaceprivate.h"
|
||||||
#include "gdksurfaceprivate.h"
|
#include "gdksurfaceprivate.h"
|
||||||
#include "gdktexture.h"
|
#include "gdktexture.h"
|
||||||
|
#include "gsk/gskrectprivate.h"
|
||||||
|
|
||||||
G_DEFINE_TYPE (GdkSubsurface, gdk_subsurface, G_TYPE_OBJECT)
|
G_DEFINE_TYPE (GdkSubsurface, gdk_subsurface, G_TYPE_OBJECT)
|
||||||
|
|
||||||
@@ -55,19 +56,106 @@ gdk_subsurface_get_parent (GdkSubsurface *subsurface)
|
|||||||
return subsurface->parent;
|
return subsurface->parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
remove_subsurface (GdkSubsurface *subsurface)
|
||||||
|
{
|
||||||
|
GdkSurface *parent = subsurface->parent;
|
||||||
|
|
||||||
|
if (parent->subsurfaces_above == subsurface)
|
||||||
|
parent->subsurfaces_above = subsurface->sibling_above;
|
||||||
|
if (parent->subsurfaces_below == subsurface)
|
||||||
|
parent->subsurfaces_below = subsurface->sibling_below;
|
||||||
|
|
||||||
|
if (subsurface->sibling_above)
|
||||||
|
subsurface->sibling_above->sibling_below = subsurface->sibling_below;
|
||||||
|
if (subsurface->sibling_below)
|
||||||
|
subsurface->sibling_below->sibling_above = subsurface->sibling_above;
|
||||||
|
|
||||||
|
subsurface->sibling_above = NULL;
|
||||||
|
subsurface->sibling_below = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
insert_subsurface (GdkSubsurface *subsurface,
|
||||||
|
gboolean above,
|
||||||
|
GdkSubsurface *sibling)
|
||||||
|
{
|
||||||
|
GdkSurface *parent = subsurface->parent;
|
||||||
|
|
||||||
|
subsurface->above_parent = sibling->above_parent;
|
||||||
|
|
||||||
|
if (above)
|
||||||
|
{
|
||||||
|
subsurface->sibling_above = sibling->sibling_above;
|
||||||
|
sibling->sibling_above = subsurface;
|
||||||
|
subsurface->sibling_below = sibling;
|
||||||
|
if (subsurface->sibling_above)
|
||||||
|
subsurface->sibling_above->sibling_below = subsurface;
|
||||||
|
|
||||||
|
if (parent->subsurfaces_below == sibling)
|
||||||
|
parent->subsurfaces_below = subsurface;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
subsurface->sibling_below = sibling->sibling_below;
|
||||||
|
sibling->sibling_below = subsurface;
|
||||||
|
subsurface->sibling_above = sibling;
|
||||||
|
if (subsurface->sibling_below)
|
||||||
|
subsurface->sibling_below->sibling_above = subsurface;
|
||||||
|
|
||||||
|
if (parent->subsurfaces_above == sibling)
|
||||||
|
parent->subsurfaces_above = subsurface;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
gdk_subsurface_attach (GdkSubsurface *subsurface,
|
gdk_subsurface_attach (GdkSubsurface *subsurface,
|
||||||
GdkTexture *texture,
|
GdkTexture *texture,
|
||||||
const graphene_rect_t *rect,
|
const graphene_rect_t *source,
|
||||||
|
const graphene_rect_t *dest,
|
||||||
gboolean above,
|
gboolean above,
|
||||||
GdkSubsurface *sibling)
|
GdkSubsurface *sibling)
|
||||||
{
|
{
|
||||||
|
GdkSurface *parent = subsurface->parent;
|
||||||
|
|
||||||
g_return_val_if_fail (GDK_IS_SUBSURFACE (subsurface), FALSE);
|
g_return_val_if_fail (GDK_IS_SUBSURFACE (subsurface), FALSE);
|
||||||
g_return_val_if_fail (GDK_IS_TEXTURE (texture), FALSE);
|
g_return_val_if_fail (GDK_IS_TEXTURE (texture), FALSE);
|
||||||
g_return_val_if_fail (rect != NULL, FALSE);
|
g_return_val_if_fail (source != NULL &&
|
||||||
|
gsk_rect_contains_rect (&GRAPHENE_RECT_INIT (0, 0,
|
||||||
|
gdk_texture_get_width (texture),
|
||||||
|
gdk_texture_get_height (texture)),
|
||||||
|
source), FALSE);
|
||||||
|
g_return_val_if_fail (dest != NULL, FALSE);
|
||||||
|
g_return_val_if_fail (sibling != subsurface, FALSE);
|
||||||
g_return_val_if_fail (sibling == NULL || GDK_IS_SUBSURFACE (sibling), FALSE);
|
g_return_val_if_fail (sibling == NULL || GDK_IS_SUBSURFACE (sibling), FALSE);
|
||||||
|
g_return_val_if_fail (sibling == NULL || sibling->parent == subsurface->parent, FALSE);
|
||||||
|
|
||||||
return GDK_SUBSURFACE_GET_CLASS (subsurface)->attach (subsurface, texture, rect, above, sibling);
|
remove_subsurface (subsurface);
|
||||||
|
|
||||||
|
if (sibling)
|
||||||
|
{
|
||||||
|
insert_subsurface (subsurface, above, sibling);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sibling = above ? parent->subsurfaces_above : parent->subsurfaces_below;
|
||||||
|
|
||||||
|
if (sibling)
|
||||||
|
{
|
||||||
|
insert_subsurface (subsurface, !above, sibling);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
subsurface->above_parent = above;
|
||||||
|
|
||||||
|
if (above)
|
||||||
|
parent->subsurfaces_above = subsurface;
|
||||||
|
else
|
||||||
|
parent->subsurfaces_below = subsurface;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return GDK_SUBSURFACE_GET_CLASS (subsurface)->attach (subsurface, texture, source, dest, above, sibling);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -75,6 +163,8 @@ gdk_subsurface_detach (GdkSubsurface *subsurface)
|
|||||||
{
|
{
|
||||||
g_return_if_fail (GDK_IS_SUBSURFACE (subsurface));
|
g_return_if_fail (GDK_IS_SUBSURFACE (subsurface));
|
||||||
|
|
||||||
|
remove_subsurface (subsurface);
|
||||||
|
|
||||||
GDK_SUBSURFACE_GET_CLASS (subsurface)->detach (subsurface);
|
GDK_SUBSURFACE_GET_CLASS (subsurface)->detach (subsurface);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,13 +177,23 @@ gdk_subsurface_get_texture (GdkSubsurface *subsurface)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gdk_subsurface_get_rect (GdkSubsurface *subsurface,
|
gdk_subsurface_get_source (GdkSubsurface *subsurface,
|
||||||
graphene_rect_t *rect)
|
graphene_rect_t *source)
|
||||||
{
|
{
|
||||||
g_return_if_fail (GDK_IS_SUBSURFACE (subsurface));
|
g_return_if_fail (GDK_IS_SUBSURFACE (subsurface));
|
||||||
g_return_if_fail (rect != NULL);
|
g_return_if_fail (source != NULL);
|
||||||
|
|
||||||
GDK_SUBSURFACE_GET_CLASS (subsurface)->get_rect (subsurface, rect);
|
GDK_SUBSURFACE_GET_CLASS (subsurface)->get_source (subsurface, source);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gdk_subsurface_get_dest (GdkSubsurface *subsurface,
|
||||||
|
graphene_rect_t *dest)
|
||||||
|
{
|
||||||
|
g_return_if_fail (GDK_IS_SUBSURFACE (subsurface));
|
||||||
|
g_return_if_fail (dest != NULL);
|
||||||
|
|
||||||
|
GDK_SUBSURFACE_GET_CLASS (subsurface)->get_dest (subsurface, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
@@ -101,5 +201,5 @@ gdk_subsurface_is_above_parent (GdkSubsurface *subsurface)
|
|||||||
{
|
{
|
||||||
g_return_val_if_fail (GDK_IS_SUBSURFACE (subsurface), TRUE);
|
g_return_val_if_fail (GDK_IS_SUBSURFACE (subsurface), TRUE);
|
||||||
|
|
||||||
return GDK_SUBSURFACE_GET_CLASS (subsurface)->is_above_parent (subsurface);
|
return subsurface->above_parent;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,10 @@ struct _GdkSubsurface
|
|||||||
GdkSurface *parent;
|
GdkSurface *parent;
|
||||||
|
|
||||||
int ref_count;
|
int ref_count;
|
||||||
|
|
||||||
|
gboolean above_parent;
|
||||||
|
GdkSubsurface *sibling_above;
|
||||||
|
GdkSubsurface *sibling_below;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -50,14 +54,16 @@ struct _GdkSubsurfaceClass
|
|||||||
|
|
||||||
gboolean (* attach) (GdkSubsurface *subsurface,
|
gboolean (* attach) (GdkSubsurface *subsurface,
|
||||||
GdkTexture *texture,
|
GdkTexture *texture,
|
||||||
const graphene_rect_t *rect,
|
const graphene_rect_t *source,
|
||||||
|
const graphene_rect_t *dest,
|
||||||
gboolean above,
|
gboolean above,
|
||||||
GdkSubsurface *sibling);
|
GdkSubsurface *sibling);
|
||||||
void (* detach) (GdkSubsurface *subsurface);
|
void (* detach) (GdkSubsurface *subsurface);
|
||||||
GdkTexture * (* get_texture) (GdkSubsurface *subsurface);
|
GdkTexture * (* get_texture) (GdkSubsurface *subsurface);
|
||||||
void (* get_rect) (GdkSubsurface *subsurface,
|
void (* get_source) (GdkSubsurface *subsurface,
|
||||||
graphene_rect_t *rect);
|
graphene_rect_t *source);
|
||||||
gboolean (* is_above_parent) (GdkSubsurface *subsurface);
|
void (* get_dest) (GdkSubsurface *subsurface,
|
||||||
|
graphene_rect_t *dest);
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gdk_subsurface_get_type (void) G_GNUC_CONST;
|
GType gdk_subsurface_get_type (void) G_GNUC_CONST;
|
||||||
@@ -65,13 +71,16 @@ GType gdk_subsurface_get_type (void) G_GNUC_CONST;
|
|||||||
GdkSurface * gdk_subsurface_get_parent (GdkSubsurface *subsurface);
|
GdkSurface * gdk_subsurface_get_parent (GdkSubsurface *subsurface);
|
||||||
gboolean gdk_subsurface_attach (GdkSubsurface *subsurface,
|
gboolean gdk_subsurface_attach (GdkSubsurface *subsurface,
|
||||||
GdkTexture *texture,
|
GdkTexture *texture,
|
||||||
const graphene_rect_t *rect,
|
const graphene_rect_t *source,
|
||||||
|
const graphene_rect_t *dest,
|
||||||
gboolean above,
|
gboolean above,
|
||||||
GdkSubsurface *sibling);
|
GdkSubsurface *sibling);
|
||||||
void gdk_subsurface_detach (GdkSubsurface *subsurface);
|
void gdk_subsurface_detach (GdkSubsurface *subsurface);
|
||||||
GdkTexture * gdk_subsurface_get_texture (GdkSubsurface *subsurface);
|
GdkTexture * gdk_subsurface_get_texture (GdkSubsurface *subsurface);
|
||||||
void gdk_subsurface_get_rect (GdkSubsurface *subsurface,
|
void gdk_subsurface_get_source (GdkSubsurface *subsurface,
|
||||||
graphene_rect_t *rect);
|
graphene_rect_t *source);
|
||||||
|
void gdk_subsurface_get_dest (GdkSubsurface *subsurface,
|
||||||
|
graphene_rect_t *dest);
|
||||||
gboolean gdk_subsurface_is_above_parent (GdkSubsurface *subsurface);
|
gboolean gdk_subsurface_is_above_parent (GdkSubsurface *subsurface);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -2839,7 +2839,7 @@ add_event_mark (GdkEvent *event,
|
|||||||
class = g_type_class_ref (GDK_TYPE_EVENT_TYPE);
|
class = g_type_class_ref (GDK_TYPE_EVENT_TYPE);
|
||||||
value = g_enum_get_value (class, event_type);
|
value = g_enum_get_value (class, event_type);
|
||||||
g_type_class_unref (class);
|
g_type_class_unref (class);
|
||||||
kind = value ? value->value_nick : "event";
|
kind = value ? value->value_nick : "Event";
|
||||||
|
|
||||||
switch ((int) event_type)
|
switch ((int) event_type)
|
||||||
{
|
{
|
||||||
@@ -2909,7 +2909,7 @@ add_event_mark (GdkEvent *event,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
gdk_profiler_add_mark (time, end_time - time, "event", message ? message : kind);
|
gdk_profiler_add_mark (time, end_time - time, "Event", message ? message : kind);
|
||||||
|
|
||||||
g_free (message);
|
g_free (message);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -99,6 +99,12 @@ struct _GdkSurface
|
|||||||
GdkSeat *current_shortcuts_inhibited_seat;
|
GdkSeat *current_shortcuts_inhibited_seat;
|
||||||
|
|
||||||
GPtrArray *subsurfaces;
|
GPtrArray *subsurfaces;
|
||||||
|
|
||||||
|
/* We keep the subsurfaces above and below the surface in two linked
|
||||||
|
* lists, which start here.
|
||||||
|
*/
|
||||||
|
GdkSubsurface *subsurfaces_above;
|
||||||
|
GdkSubsurface *subsurfaces_below;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GdkSurfaceClass
|
struct _GdkSurfaceClass
|
||||||
@@ -345,8 +351,6 @@ void gdk_surface_request_motion (GdkSurface *surface);
|
|||||||
gboolean gdk_surface_supports_edge_constraints (GdkSurface *surface);
|
gboolean gdk_surface_supports_edge_constraints (GdkSurface *surface);
|
||||||
|
|
||||||
GdkSubsurface * gdk_surface_create_subsurface (GdkSurface *surface);
|
GdkSubsurface * gdk_surface_create_subsurface (GdkSurface *surface);
|
||||||
void gdk_surface_destroy_subsurface (GdkSurface *surface,
|
|
||||||
GdkSubsurface *subsurface);
|
|
||||||
gsize gdk_surface_get_n_subsurfaces (GdkSurface *surface);
|
gsize gdk_surface_get_n_subsurfaces (GdkSurface *surface);
|
||||||
GdkSubsurface * gdk_surface_get_subsurface (GdkSurface *surface,
|
GdkSubsurface * gdk_surface_get_subsurface (GdkSurface *surface,
|
||||||
gsize idx);
|
gsize idx);
|
||||||
|
|||||||
@@ -142,6 +142,9 @@ gdk_toplevel_size_set_min_size (GdkToplevelSize *size,
|
|||||||
* The shadow width corresponds to the part of the computed surface size
|
* The shadow width corresponds to the part of the computed surface size
|
||||||
* that would consist of the shadow margin surrounding the window, would
|
* that would consist of the shadow margin surrounding the window, would
|
||||||
* there be any.
|
* there be any.
|
||||||
|
*
|
||||||
|
* Shadow width should only be set if
|
||||||
|
* [method@Gtk.Display.supports_shadow_width] is %TRUE.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
gdk_toplevel_size_set_shadow_width (GdkToplevelSize *size,
|
gdk_toplevel_size_set_shadow_width (GdkToplevelSize *size,
|
||||||
|
|||||||
+23
-2
@@ -593,7 +593,8 @@ physical_device_check_features (VkPhysicalDevice device,
|
|||||||
v12_features.shaderStorageBufferArrayNonUniformIndexing)
|
v12_features.shaderStorageBufferArrayNonUniformIndexing)
|
||||||
*out_features |= GDK_VULKAN_FEATURE_NONUNIFORM_INDEXING;
|
*out_features |= GDK_VULKAN_FEATURE_NONUNIFORM_INDEXING;
|
||||||
|
|
||||||
if (ycbcr_features.samplerYcbcrConversion)
|
if (ycbcr_features.samplerYcbcrConversion ||
|
||||||
|
physical_device_supports_extension (device, VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME))
|
||||||
*out_features |= GDK_VULKAN_FEATURE_YCBCR;
|
*out_features |= GDK_VULKAN_FEATURE_YCBCR;
|
||||||
|
|
||||||
if (physical_device_supports_extension (device, VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME) &&
|
if (physical_device_supports_extension (device, VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME) &&
|
||||||
@@ -1466,13 +1467,27 @@ gdk_display_create_vulkan_device (GdkDisplay *display,
|
|||||||
g_ptr_array_add (device_extensions, (gpointer) VK_KHR_SWAPCHAIN_EXTENSION_NAME);
|
g_ptr_array_add (device_extensions, (gpointer) VK_KHR_SWAPCHAIN_EXTENSION_NAME);
|
||||||
if (features & GDK_VULKAN_FEATURE_DESCRIPTOR_INDEXING)
|
if (features & GDK_VULKAN_FEATURE_DESCRIPTOR_INDEXING)
|
||||||
g_ptr_array_add (device_extensions, (gpointer) VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME);
|
g_ptr_array_add (device_extensions, (gpointer) VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME);
|
||||||
|
if (features & GDK_VULKAN_FEATURE_YCBCR)
|
||||||
|
{
|
||||||
|
g_ptr_array_add (device_extensions, (gpointer) VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME);
|
||||||
|
g_ptr_array_add (device_extensions, (gpointer) VK_KHR_MAINTENANCE_1_EXTENSION_NAME);
|
||||||
|
g_ptr_array_add (device_extensions, (gpointer) VK_KHR_BIND_MEMORY_2_EXTENSION_NAME);
|
||||||
|
g_ptr_array_add (device_extensions, (gpointer) VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME);
|
||||||
|
}
|
||||||
if (features & GDK_VULKAN_FEATURE_DMABUF)
|
if (features & GDK_VULKAN_FEATURE_DMABUF)
|
||||||
{
|
{
|
||||||
|
g_assert (features & GDK_VULKAN_FEATURE_YCBCR);
|
||||||
|
|
||||||
g_ptr_array_add (device_extensions, (gpointer) VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME);
|
g_ptr_array_add (device_extensions, (gpointer) VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME);
|
||||||
|
g_ptr_array_add (device_extensions, (gpointer) VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME);
|
||||||
|
|
||||||
g_ptr_array_add (device_extensions, (gpointer) VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME);
|
g_ptr_array_add (device_extensions, (gpointer) VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME);
|
||||||
|
g_ptr_array_add (device_extensions, (gpointer) VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME);
|
||||||
}
|
}
|
||||||
if (features & (GDK_VULKAN_FEATURE_SEMAPHORE_IMPORT | GDK_VULKAN_FEATURE_SEMAPHORE_EXPORT))
|
if (features & (GDK_VULKAN_FEATURE_SEMAPHORE_IMPORT | GDK_VULKAN_FEATURE_SEMAPHORE_EXPORT))
|
||||||
g_ptr_array_add (device_extensions, (gpointer) VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME);
|
{
|
||||||
|
g_ptr_array_add (device_extensions, (gpointer) VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME);
|
||||||
|
}
|
||||||
if (features & GDK_VULKAN_FEATURE_INCREMENTAL_PRESENT)
|
if (features & GDK_VULKAN_FEATURE_INCREMENTAL_PRESENT)
|
||||||
g_ptr_array_add (device_extensions, (gpointer) VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME);
|
g_ptr_array_add (device_extensions, (gpointer) VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME);
|
||||||
|
|
||||||
@@ -1613,6 +1628,12 @@ gdk_display_create_vulkan_instance (GdkDisplay *display,
|
|||||||
g_ptr_array_add (used_extensions, (gpointer) VK_EXT_DEBUG_REPORT_EXTENSION_NAME);
|
g_ptr_array_add (used_extensions, (gpointer) VK_EXT_DEBUG_REPORT_EXTENSION_NAME);
|
||||||
have_debug_report = TRUE;
|
have_debug_report = TRUE;
|
||||||
}
|
}
|
||||||
|
if (g_str_equal (extensions[i].extensionName, VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME))
|
||||||
|
g_ptr_array_add (used_extensions, (gpointer) VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
|
||||||
|
if (g_str_equal (extensions[i].extensionName, VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME))
|
||||||
|
g_ptr_array_add (used_extensions, (gpointer) VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME);
|
||||||
|
if (g_str_equal (extensions[i].extensionName, VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME))
|
||||||
|
g_ptr_array_add (used_extensions, (gpointer) VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t n_layers;
|
uint32_t n_layers;
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ gdk_load_jpeg (GBytes *input_bytes,
|
|||||||
|
|
||||||
g_bytes_unref (bytes);
|
g_bytes_unref (bytes);
|
||||||
|
|
||||||
gdk_profiler_end_mark (before, "jpeg load", NULL);
|
gdk_profiler_end_mark (before, "Load jpeg", NULL);
|
||||||
|
|
||||||
return texture;
|
return texture;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -304,7 +304,7 @@ gdk_load_png (GBytes *bytes,
|
|||||||
{
|
{
|
||||||
gint64 end = GDK_PROFILER_CURRENT_TIME;
|
gint64 end = GDK_PROFILER_CURRENT_TIME;
|
||||||
if (end - before > 500000)
|
if (end - before > 500000)
|
||||||
gdk_profiler_add_mark (before, end - before, "png load", NULL);
|
gdk_profiler_add_mark (before, end - before, "Load png", NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return texture;
|
return texture;
|
||||||
|
|||||||
@@ -504,7 +504,7 @@ gdk_load_tiff (GBytes *input_bytes,
|
|||||||
{
|
{
|
||||||
gint64 end = GDK_PROFILER_CURRENT_TIME;
|
gint64 end = GDK_PROFILER_CURRENT_TIME;
|
||||||
if (end - before > 500000)
|
if (end - before > 500000)
|
||||||
gdk_profiler_add_mark (before, end - before, "tiff load", NULL);
|
gdk_profiler_add_mark (before, end - before, "Load tiff", NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return texture;
|
return texture;
|
||||||
|
|||||||
@@ -398,8 +398,7 @@ typedef NSString *CALayerContentsGravity;
|
|||||||
* in from a display-side change. We need to request a layout in
|
* in from a display-side change. We need to request a layout in
|
||||||
* addition to the configure event.
|
* addition to the configure event.
|
||||||
*/
|
*/
|
||||||
if (GDK_IS_MACOS_TOPLEVEL_SURFACE (gdk_surface) &&
|
if (GDK_IS_MACOS_TOPLEVEL_SURFACE (gdk_surface))
|
||||||
GDK_MACOS_TOPLEVEL_SURFACE (gdk_surface)->decorated)
|
|
||||||
gdk_surface_request_layout (GDK_SURFACE (gdk_surface));
|
gdk_surface_request_layout (GDK_SURFACE (gdk_surface));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -875,12 +874,21 @@ typedef NSString *CALayerContentsGravity;
|
|||||||
{
|
{
|
||||||
NSWindowStyleMask style_mask = [self styleMask];
|
NSWindowStyleMask style_mask = [self styleMask];
|
||||||
|
|
||||||
[self setHasShadow:decorated];
|
|
||||||
|
|
||||||
if (decorated)
|
if (decorated)
|
||||||
style_mask |= NSWindowStyleMaskTitled;
|
{
|
||||||
|
style_mask &= ~NSWindowStyleMaskFullSizeContentView;
|
||||||
|
[self setTitleVisibility:NSWindowTitleVisible];
|
||||||
|
}
|
||||||
else
|
else
|
||||||
style_mask &= ~NSWindowStyleMaskTitled;
|
{
|
||||||
|
style_mask |= NSWindowStyleMaskFullSizeContentView;
|
||||||
|
[self setTitleVisibility:NSWindowTitleHidden];
|
||||||
|
}
|
||||||
|
|
||||||
|
[self setTitlebarAppearsTransparent:!decorated];
|
||||||
|
[[self standardWindowButton:NSWindowCloseButton] setHidden:!decorated];
|
||||||
|
[[self standardWindowButton:NSWindowMiniaturizeButton] setHidden:!decorated];
|
||||||
|
[[self standardWindowButton:NSWindowZoomButton] setHidden:!decorated];
|
||||||
|
|
||||||
[self setStyleMask:style_mask];
|
[self setStyleMask:style_mask];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -271,6 +271,11 @@ _gdk_macos_cairo_context_end_frame (GdkDrawContext *draw_context,
|
|||||||
[CATransaction commit];
|
[CATransaction commit];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_gdk_macos_cairo_context_empty_frame (GdkDrawContext *draw_context)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_gdk_macos_cairo_context_surface_resized (GdkDrawContext *draw_context)
|
_gdk_macos_cairo_context_surface_resized (GdkDrawContext *draw_context)
|
||||||
{
|
{
|
||||||
@@ -287,6 +292,7 @@ _gdk_macos_cairo_context_class_init (GdkMacosCairoContextClass *klass)
|
|||||||
|
|
||||||
draw_context_class->begin_frame = _gdk_macos_cairo_context_begin_frame;
|
draw_context_class->begin_frame = _gdk_macos_cairo_context_begin_frame;
|
||||||
draw_context_class->end_frame = _gdk_macos_cairo_context_end_frame;
|
draw_context_class->end_frame = _gdk_macos_cairo_context_end_frame;
|
||||||
|
draw_context_class->empty_frame = _gdk_macos_cairo_context_empty_frame;
|
||||||
draw_context_class->surface_resized = _gdk_macos_cairo_context_surface_resized;
|
draw_context_class->surface_resized = _gdk_macos_cairo_context_surface_resized;
|
||||||
|
|
||||||
cairo_context_class->cairo_create = _gdk_macos_cairo_context_cairo_create;
|
cairo_context_class->cairo_create = _gdk_macos_cairo_context_cairo_create;
|
||||||
|
|||||||
@@ -625,6 +625,7 @@ gdk_macos_display_init (GdkMacosDisplay *self)
|
|||||||
gdk_display_set_composited (GDK_DISPLAY (self), TRUE);
|
gdk_display_set_composited (GDK_DISPLAY (self), TRUE);
|
||||||
gdk_display_set_input_shapes (GDK_DISPLAY (self), FALSE);
|
gdk_display_set_input_shapes (GDK_DISPLAY (self), FALSE);
|
||||||
gdk_display_set_rgba (GDK_DISPLAY (self), TRUE);
|
gdk_display_set_rgba (GDK_DISPLAY (self), TRUE);
|
||||||
|
gdk_display_set_shadow_width (GDK_DISPLAY (self), FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
GdkDisplay *
|
GdkDisplay *
|
||||||
|
|||||||
@@ -734,7 +734,14 @@ gdk_macos_event_source_dispatch (GSource *source,
|
|||||||
|
|
||||||
if (event)
|
if (event)
|
||||||
{
|
{
|
||||||
_gdk_event_emit (event);
|
gboolean handled = _gdk_event_emit (event);
|
||||||
|
|
||||||
|
if (!handled)
|
||||||
|
{
|
||||||
|
NSEvent *nsevent = _gdk_macos_display_get_nsevent (event);
|
||||||
|
if (nsevent != NULL)
|
||||||
|
[NSApp sendEvent: nsevent];
|
||||||
|
}
|
||||||
|
|
||||||
gdk_event_unref (event);
|
gdk_event_unref (event);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -545,6 +545,11 @@ gdk_macos_gl_context_end_frame (GdkDrawContext *context,
|
|||||||
[CATransaction commit];
|
[CATransaction commit];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gdk_macos_gl_context_empty_frame (GdkDrawContext *draw_context)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gdk_macos_gl_context_surface_resized (GdkDrawContext *draw_context)
|
gdk_macos_gl_context_surface_resized (GdkDrawContext *draw_context)
|
||||||
{
|
{
|
||||||
@@ -667,6 +672,7 @@ gdk_macos_gl_context_class_init (GdkMacosGLContextClass *klass)
|
|||||||
|
|
||||||
draw_context_class->begin_frame = gdk_macos_gl_context_begin_frame;
|
draw_context_class->begin_frame = gdk_macos_gl_context_begin_frame;
|
||||||
draw_context_class->end_frame = gdk_macos_gl_context_end_frame;
|
draw_context_class->end_frame = gdk_macos_gl_context_end_frame;
|
||||||
|
draw_context_class->empty_frame = gdk_macos_gl_context_empty_frame;
|
||||||
draw_context_class->surface_resized = gdk_macos_gl_context_surface_resized;
|
draw_context_class->surface_resized = gdk_macos_gl_context_surface_resized;
|
||||||
|
|
||||||
gl_class->get_damage = gdk_macos_gl_context_get_damage;
|
gl_class->get_damage = gdk_macos_gl_context_get_damage;
|
||||||
|
|||||||
+1
-1
@@ -219,7 +219,7 @@ gdk_deps = [
|
|||||||
platform_gio_dep,
|
platform_gio_dep,
|
||||||
pangocairo_dep,
|
pangocairo_dep,
|
||||||
vulkan_dep,
|
vulkan_dep,
|
||||||
dmabuf_dep,
|
libdrm_dep,
|
||||||
png_dep,
|
png_dep,
|
||||||
tiff_dep,
|
tiff_dep,
|
||||||
jpeg_dep,
|
jpeg_dep,
|
||||||
|
|||||||
@@ -266,10 +266,10 @@ _XcursorReadUInt (XcursorFile *file, XcursorUInt *u)
|
|||||||
|
|
||||||
if ((*file->read) (file, bytes, 4) != 4)
|
if ((*file->read) (file, bytes, 4) != 4)
|
||||||
return XcursorFalse;
|
return XcursorFalse;
|
||||||
*u = ((bytes[0] << 0) |
|
*u = ((((unsigned int)(bytes[0])) << 0) |
|
||||||
(bytes[1] << 8) |
|
(((unsigned int)(bytes[1])) << 8) |
|
||||||
(bytes[2] << 16) |
|
(((unsigned int)(bytes[2])) << 16) |
|
||||||
(bytes[3] << 24));
|
(((unsigned int)(bytes[3])) << 24));
|
||||||
return XcursorTrue;
|
return XcursorTrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ gdk_wayland_cairo_context_end_frame (GdkDrawContext *draw_context,
|
|||||||
gdk_wayland_surface_attach_image (surface, self->paint_surface, painted);
|
gdk_wayland_surface_attach_image (surface, self->paint_surface, painted);
|
||||||
gdk_wayland_surface_request_frame (surface);
|
gdk_wayland_surface_request_frame (surface);
|
||||||
|
|
||||||
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "wayland", "surface commit");
|
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "Wayland surface commit", NULL);
|
||||||
gdk_wayland_surface_commit (surface);
|
gdk_wayland_surface_commit (surface);
|
||||||
gdk_wayland_surface_notify_committed (surface);
|
gdk_wayland_surface_notify_committed (surface);
|
||||||
|
|
||||||
@@ -206,7 +206,7 @@ gdk_wayland_cairo_context_empty_frame (GdkDrawContext *draw_context)
|
|||||||
gdk_wayland_surface_sync (surface);
|
gdk_wayland_surface_sync (surface);
|
||||||
gdk_wayland_surface_request_frame (surface);
|
gdk_wayland_surface_request_frame (surface);
|
||||||
|
|
||||||
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "wayland", "surface commit");
|
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "Wayland surface commit", NULL);
|
||||||
gdk_wayland_surface_commit (surface);
|
gdk_wayland_surface_commit (surface);
|
||||||
gdk_wayland_surface_notify_committed (surface);
|
gdk_wayland_surface_notify_committed (surface);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1253,7 +1253,7 @@ _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *display_wayland)
|
|||||||
gdk_wayland_display_set_cursor_theme (GDK_DISPLAY (display_wayland), name, size);
|
gdk_wayland_display_set_cursor_theme (GDK_DISPLAY (display_wayland), name, size);
|
||||||
g_value_unset (&v);
|
g_value_unset (&v);
|
||||||
|
|
||||||
gdk_profiler_end_mark (before, "wayland", "load cursor theme");
|
gdk_profiler_end_mark (before, "Wayland cursor theme load", NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1795,7 +1795,7 @@ static TranslationEntry translations[] = {
|
|||||||
{ FALSE, "org.gnome.desktop.wm.preferences", "action-middle-click-titlebar", "gtk-titlebar-middle-click", G_TYPE_STRING, { .s = "none" } },
|
{ FALSE, "org.gnome.desktop.wm.preferences", "action-middle-click-titlebar", "gtk-titlebar-middle-click", G_TYPE_STRING, { .s = "none" } },
|
||||||
{ FALSE, "org.gnome.desktop.wm.preferences", "action-right-click-titlebar", "gtk-titlebar-right-click", G_TYPE_STRING, { .s = "menu" } },
|
{ FALSE, "org.gnome.desktop.wm.preferences", "action-right-click-titlebar", "gtk-titlebar-right-click", G_TYPE_STRING, { .s = "menu" } },
|
||||||
{ FALSE, "org.gnome.desktop.a11y", "always-show-text-caret", "gtk-keynav-use-caret", G_TYPE_BOOLEAN, { .b = FALSE } },
|
{ FALSE, "org.gnome.desktop.a11y", "always-show-text-caret", "gtk-keynav-use-caret", G_TYPE_BOOLEAN, { .b = FALSE } },
|
||||||
{ FALSE, "org.gnome.desktop.a11y.interface", "high-contrast", "high-contast", G_TYPE_NONE, { .b = FALSE } },
|
{ FALSE, "org.gnome.desktop.a11y.interface", "high-contrast", "high-contrast", G_TYPE_NONE, { .b = FALSE } },
|
||||||
{ FALSE, "org.gnome.desktop.a11y.interface", "show-status-shapes", "gtk-show-status-shapes", G_TYPE_BOOLEAN, { .b = FALSE } },
|
{ FALSE, "org.gnome.desktop.a11y.interface", "show-status-shapes", "gtk-show-status-shapes", G_TYPE_BOOLEAN, { .b = FALSE } },
|
||||||
/* Note, this setting doesn't exist, the portal and gsd fake it */
|
/* Note, this setting doesn't exist, the portal and gsd fake it */
|
||||||
{ FALSE, "org.gnome.fontconfig", "serial", "gtk-fontconfig-timestamp", G_TYPE_NONE, { .i = 0 } },
|
{ FALSE, "org.gnome.fontconfig", "serial", "gtk-fontconfig-timestamp", G_TYPE_NONE, { .i = 0 } },
|
||||||
@@ -2430,15 +2430,49 @@ apply_monitor_change (GdkWaylandMonitor *monitor)
|
|||||||
{
|
{
|
||||||
GDK_DEBUG (MISC, "monitor %d changed position %d %d, size %d %d",
|
GDK_DEBUG (MISC, "monitor %d changed position %d %d, size %d %d",
|
||||||
monitor->id,
|
monitor->id,
|
||||||
monitor->x, monitor->y,
|
monitor->output_geometry.x, monitor->output_geometry.y,
|
||||||
monitor->width, monitor->height);
|
monitor->output_geometry.width, monitor->output_geometry.height);
|
||||||
|
|
||||||
gdk_monitor_set_geometry (GDK_MONITOR (monitor),
|
GdkRectangle logical_geometry;
|
||||||
&(GdkRectangle) {
|
gboolean needs_scaling = FALSE;
|
||||||
monitor->x, monitor->y,
|
double scale;
|
||||||
monitor->width, monitor->height });
|
|
||||||
|
if (monitor_has_xdg_output (monitor) &&
|
||||||
|
monitor->xdg_output_geometry.width != 0 &&
|
||||||
|
monitor->xdg_output_geometry.height != 0)
|
||||||
|
{
|
||||||
|
logical_geometry = monitor->xdg_output_geometry;
|
||||||
|
needs_scaling = logical_geometry.width == monitor->output_geometry.width &&
|
||||||
|
logical_geometry.height == monitor->output_geometry.height;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
logical_geometry = monitor->output_geometry;
|
||||||
|
needs_scaling = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (needs_scaling)
|
||||||
|
{
|
||||||
|
int scale_factor = gdk_monitor_get_scale_factor (GDK_MONITOR (monitor));
|
||||||
|
|
||||||
|
logical_geometry.y /= scale_factor;
|
||||||
|
logical_geometry.x /= scale_factor;
|
||||||
|
logical_geometry.width /= scale_factor;
|
||||||
|
logical_geometry.height /= scale_factor;
|
||||||
|
|
||||||
|
scale = scale_factor;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
scale = MAX (monitor->output_geometry.width / (double) logical_geometry.width,
|
||||||
|
monitor->output_geometry.height / (double) logical_geometry.height);
|
||||||
|
}
|
||||||
|
|
||||||
|
gdk_monitor_set_geometry (GDK_MONITOR (monitor), &logical_geometry);
|
||||||
gdk_monitor_set_connector (GDK_MONITOR (monitor), monitor->name);
|
gdk_monitor_set_connector (GDK_MONITOR (monitor), monitor->name);
|
||||||
gdk_monitor_set_description (GDK_MONITOR (monitor), monitor->description);
|
gdk_monitor_set_description (GDK_MONITOR (monitor), monitor->description);
|
||||||
|
gdk_monitor_set_scale (GDK_MONITOR (monitor), scale);
|
||||||
|
|
||||||
monitor->wl_output_done = FALSE;
|
monitor->wl_output_done = FALSE;
|
||||||
monitor->xdg_output_done = FALSE;
|
monitor->xdg_output_done = FALSE;
|
||||||
|
|
||||||
@@ -2456,8 +2490,8 @@ xdg_output_handle_logical_position (void *data,
|
|||||||
GDK_DEBUG (MISC, "handle logical position xdg-output %d, position %d %d",
|
GDK_DEBUG (MISC, "handle logical position xdg-output %d, position %d %d",
|
||||||
monitor->id, x, y);
|
monitor->id, x, y);
|
||||||
|
|
||||||
monitor->x = x;
|
monitor->xdg_output_geometry.x = x;
|
||||||
monitor->y = y;
|
monitor->xdg_output_geometry.y = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -2471,8 +2505,8 @@ xdg_output_handle_logical_size (void *data,
|
|||||||
GDK_DEBUG (MISC, "handle logical size xdg-output %d, size %d %d",
|
GDK_DEBUG (MISC, "handle logical size xdg-output %d, size %d %d",
|
||||||
monitor->id, width, height);
|
monitor->id, width, height);
|
||||||
|
|
||||||
monitor->width = width;
|
monitor->xdg_output_geometry.width = width;
|
||||||
monitor->height = height;
|
monitor->xdg_output_geometry.height = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -2558,8 +2592,8 @@ output_handle_geometry (void *data,
|
|||||||
make, model,
|
make, model,
|
||||||
transform_to_string (transform));
|
transform_to_string (transform));
|
||||||
|
|
||||||
monitor->x = x;
|
monitor->output_geometry.x = x;
|
||||||
monitor->y = y;
|
monitor->output_geometry.y = y;
|
||||||
|
|
||||||
switch (transform)
|
switch (transform)
|
||||||
{
|
{
|
||||||
@@ -2603,28 +2637,12 @@ output_handle_scale (void *data,
|
|||||||
int32_t scale)
|
int32_t scale)
|
||||||
{
|
{
|
||||||
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)data;
|
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)data;
|
||||||
GdkRectangle previous_geometry;
|
|
||||||
int previous_scale;
|
|
||||||
int width;
|
|
||||||
int height;
|
|
||||||
|
|
||||||
GDK_DEBUG (MISC, "handle scale output %d, scale %d", monitor->id, scale);
|
GDK_DEBUG (MISC, "handle scale output %d, scale %d", monitor->id, scale);
|
||||||
|
|
||||||
gdk_monitor_get_geometry (GDK_MONITOR (monitor), &previous_geometry);
|
|
||||||
previous_scale = gdk_monitor_get_scale_factor (GDK_MONITOR (monitor));
|
|
||||||
|
|
||||||
/* Set the scale from wl_output protocol, regardless of xdg-output support */
|
/* Set the scale from wl_output protocol, regardless of xdg-output support */
|
||||||
gdk_monitor_set_scale_factor (GDK_MONITOR (monitor), scale);
|
gdk_monitor_set_scale_factor (GDK_MONITOR (monitor), scale);
|
||||||
|
|
||||||
if (monitor_has_xdg_output (monitor))
|
|
||||||
return;
|
|
||||||
|
|
||||||
width = previous_geometry.width * previous_scale;
|
|
||||||
height = previous_geometry.height * previous_scale;
|
|
||||||
|
|
||||||
monitor->width = width / scale;
|
|
||||||
monitor->height = height / scale;
|
|
||||||
|
|
||||||
if (should_update_monitor (monitor))
|
if (should_update_monitor (monitor))
|
||||||
apply_monitor_change (monitor);
|
apply_monitor_change (monitor);
|
||||||
}
|
}
|
||||||
@@ -2638,7 +2656,6 @@ output_handle_mode (void *data,
|
|||||||
int refresh)
|
int refresh)
|
||||||
{
|
{
|
||||||
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)data;
|
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)data;
|
||||||
int scale;
|
|
||||||
|
|
||||||
GDK_DEBUG (MISC, "handle mode output %d, size %d %d, rate %d",
|
GDK_DEBUG (MISC, "handle mode output %d, size %d %d, rate %d",
|
||||||
monitor->id, width, height, refresh);
|
monitor->id, width, height, refresh);
|
||||||
@@ -2646,9 +2663,8 @@ output_handle_mode (void *data,
|
|||||||
if ((flags & WL_OUTPUT_MODE_CURRENT) == 0)
|
if ((flags & WL_OUTPUT_MODE_CURRENT) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
scale = gdk_monitor_get_scale_factor (GDK_MONITOR (monitor));
|
monitor->output_geometry.width = width;
|
||||||
monitor->width = width / scale;
|
monitor->output_geometry.height = height;
|
||||||
monitor->height = height / scale;
|
|
||||||
gdk_monitor_set_refresh_rate (GDK_MONITOR (monitor), refresh);
|
gdk_monitor_set_refresh_rate (GDK_MONITOR (monitor), refresh);
|
||||||
|
|
||||||
if (should_update_monitor (monitor) || !monitor_has_xdg_output (monitor))
|
if (should_update_monitor (monitor) || !monitor_has_xdg_output (monitor))
|
||||||
|
|||||||
@@ -87,9 +87,8 @@ static void
|
|||||||
gdk_wayland_gl_context_empty_frame (GdkDrawContext *draw_context)
|
gdk_wayland_gl_context_empty_frame (GdkDrawContext *draw_context)
|
||||||
{
|
{
|
||||||
GdkSurface *surface = gdk_draw_context_get_surface (draw_context);
|
GdkSurface *surface = gdk_draw_context_get_surface (draw_context);
|
||||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
|
||||||
|
|
||||||
if (impl->has_pending_subsurface_commits)
|
if (gdk_wayland_surface_needs_commit (surface))
|
||||||
{
|
{
|
||||||
gdk_wayland_surface_sync (surface);
|
gdk_wayland_surface_sync (surface);
|
||||||
gdk_wayland_surface_request_frame (surface);
|
gdk_wayland_surface_request_frame (surface);
|
||||||
|
|||||||
@@ -31,11 +31,10 @@ struct _GdkWaylandMonitor {
|
|||||||
gboolean added;
|
gboolean added;
|
||||||
|
|
||||||
struct zxdg_output_v1 *xdg_output;
|
struct zxdg_output_v1 *xdg_output;
|
||||||
/* Size and position, can be either from wl_output or xdg_output */
|
/* Raw wl_output data */
|
||||||
int32_t x;
|
GdkRectangle output_geometry;
|
||||||
int32_t y;
|
/* Raw xdg_output data */
|
||||||
int32_t width;
|
GdkRectangle xdg_output_geometry;
|
||||||
int32_t height;
|
|
||||||
char *name;
|
char *name;
|
||||||
char *description;
|
char *description;
|
||||||
gboolean wl_output_done;
|
gboolean wl_output_done;
|
||||||
|
|||||||
@@ -1012,7 +1012,7 @@ gdk_wayland_surface_create_xdg_popup (GdkWaylandPopup *wayland_popup,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "wayland", "surface commit");
|
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "Wayland surface commit", NULL);
|
||||||
wl_surface_commit (impl->display_server.wl_surface);
|
wl_surface_commit (impl->display_server.wl_surface);
|
||||||
|
|
||||||
if (GDK_IS_POPUP (surface))
|
if (GDK_IS_POPUP (surface))
|
||||||
|
|||||||
@@ -129,6 +129,7 @@ guint _gdk_wayland_cursor_get_next_image_index (GdkWaylandDisplay *display,
|
|||||||
guint *next_image_delay);
|
guint *next_image_delay);
|
||||||
|
|
||||||
void gdk_wayland_surface_sync (GdkSurface *surface);
|
void gdk_wayland_surface_sync (GdkSurface *surface);
|
||||||
|
gboolean gdk_wayland_surface_needs_commit (GdkSurface *surface);
|
||||||
void gdk_wayland_surface_commit (GdkSurface *surface);
|
void gdk_wayland_surface_commit (GdkSurface *surface);
|
||||||
void gdk_wayland_surface_notify_committed (GdkSurface *surface);
|
void gdk_wayland_surface_notify_committed (GdkSurface *surface);
|
||||||
void gdk_wayland_surface_request_frame (GdkSurface *surface);
|
void gdk_wayland_surface_request_frame (GdkSurface *surface);
|
||||||
|
|||||||
@@ -3629,7 +3629,10 @@ tablet_pad_handle_leave (void *data,
|
|||||||
wp_tablet_pad, surface);
|
wp_tablet_pad, surface);
|
||||||
|
|
||||||
if (pad->current_tablet)
|
if (pad->current_tablet)
|
||||||
pad->current_tablet->pads = g_list_remove (pad->current_tablet->pads, pad);
|
{
|
||||||
|
pad->current_tablet->pads = g_list_remove (pad->current_tablet->pads, pad);
|
||||||
|
pad->current_tablet = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
@@ -22,12 +22,11 @@ struct _GdkWaylandSubsurface
|
|||||||
|
|
||||||
GdkTexture *texture;
|
GdkTexture *texture;
|
||||||
cairo_rectangle_int_t dest;
|
cairo_rectangle_int_t dest;
|
||||||
|
graphene_rect_t source;
|
||||||
|
|
||||||
struct wl_region *opaque_region;
|
struct wl_region *opaque_region;
|
||||||
|
|
||||||
struct wl_callback *frame_callback;
|
struct wl_callback *frame_callback;
|
||||||
|
|
||||||
gboolean above_parent;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GdkWaylandSubsurfaceClass
|
struct _GdkWaylandSubsurfaceClass
|
||||||
|
|||||||
@@ -152,7 +152,8 @@ get_wl_buffer (GdkWaylandSubsurface *self,
|
|||||||
static gboolean
|
static gboolean
|
||||||
gdk_wayland_subsurface_attach (GdkSubsurface *sub,
|
gdk_wayland_subsurface_attach (GdkSubsurface *sub,
|
||||||
GdkTexture *texture,
|
GdkTexture *texture,
|
||||||
const graphene_rect_t *rect,
|
const graphene_rect_t *source,
|
||||||
|
const graphene_rect_t *dest,
|
||||||
gboolean above,
|
gboolean above,
|
||||||
GdkSubsurface *sibling)
|
GdkSubsurface *sibling)
|
||||||
{
|
{
|
||||||
@@ -166,8 +167,8 @@ gdk_wayland_subsurface_attach (GdkSubsurface *sub,
|
|||||||
graphene_rect_t device_rect;
|
graphene_rect_t device_rect;
|
||||||
cairo_rectangle_int_t device_dest;
|
cairo_rectangle_int_t device_dest;
|
||||||
|
|
||||||
if (sib)
|
if (sibling)
|
||||||
will_be_above = sib->above_parent;
|
will_be_above = sibling->above_parent;
|
||||||
else
|
else
|
||||||
will_be_above = above;
|
will_be_above = above;
|
||||||
|
|
||||||
@@ -177,30 +178,37 @@ gdk_wayland_subsurface_attach (GdkSubsurface *sub,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
self->dest.x = rect->origin.x;
|
self->dest.x = dest->origin.x;
|
||||||
self->dest.y = rect->origin.y;
|
self->dest.y = dest->origin.y;
|
||||||
self->dest.width = rect->size.width;
|
self->dest.width = dest->size.width;
|
||||||
self->dest.height = rect->size.height;
|
self->dest.height = dest->size.height;
|
||||||
|
|
||||||
|
self->source.origin.x = source->origin.x;
|
||||||
|
self->source.origin.y = source->origin.y;
|
||||||
|
self->source.size.width = source->size.width;
|
||||||
|
self->source.size.height = source->size.height;
|
||||||
|
|
||||||
scale = gdk_fractional_scale_to_double (&parent->scale);
|
scale = gdk_fractional_scale_to_double (&parent->scale);
|
||||||
device_rect.origin.x = rect->origin.x * scale;
|
|
||||||
device_rect.origin.y = rect->origin.y * scale;
|
device_rect.origin.x = dest->origin.x * scale;
|
||||||
device_rect.size.width = rect->size.width * scale;
|
device_rect.origin.y = dest->origin.y * scale;
|
||||||
device_rect.size.height = rect->size.height * scale;
|
device_rect.size.width = dest->size.width * scale;
|
||||||
|
device_rect.size.height = dest->size.height * scale;
|
||||||
|
|
||||||
device_dest.x = device_rect.origin.x;
|
device_dest.x = device_rect.origin.x;
|
||||||
device_dest.y = device_rect.origin.y;
|
device_dest.y = device_rect.origin.y;
|
||||||
device_dest.width = device_rect.size.width;
|
device_dest.width = device_rect.size.width;
|
||||||
device_dest.height = device_rect.size.height;
|
device_dest.height = device_rect.size.height;
|
||||||
|
|
||||||
if (self->dest.x != rect->origin.x ||
|
if (self->dest.x != dest->origin.x ||
|
||||||
self->dest.y != rect->origin.y ||
|
self->dest.y != dest->origin.y ||
|
||||||
self->dest.width != rect->size.width ||
|
self->dest.width != dest->size.width ||
|
||||||
self->dest.height != rect->size.height)
|
self->dest.height != dest->size.height)
|
||||||
{
|
{
|
||||||
GDK_DISPLAY_DEBUG (gdk_surface_get_display (sub->parent), OFFLOAD,
|
GDK_DISPLAY_DEBUG (gdk_surface_get_display (sub->parent), OFFLOAD,
|
||||||
"Non-integer coordinates %g %g %g %g for %dx%d texture, hiding subsurface %p",
|
"Non-integer coordinates %g %g %g %g for %dx%d texture, hiding subsurface %p",
|
||||||
rect->origin.x, rect->origin.y,
|
dest->origin.x, dest->origin.y,
|
||||||
rect->size.width, rect->size.height,
|
dest->size.width, dest->size.height,
|
||||||
gdk_texture_get_width (texture),
|
gdk_texture_get_width (texture),
|
||||||
gdk_texture_get_height (texture),
|
gdk_texture_get_height (texture),
|
||||||
self);
|
self);
|
||||||
@@ -296,6 +304,11 @@ gdk_wayland_subsurface_attach (GdkSubsurface *sub,
|
|||||||
{
|
{
|
||||||
wl_subsurface_set_position (self->subsurface, self->dest.x, self->dest.y);
|
wl_subsurface_set_position (self->subsurface, self->dest.x, self->dest.y);
|
||||||
wp_viewport_set_destination (self->viewport, self->dest.width, self->dest.height);
|
wp_viewport_set_destination (self->viewport, self->dest.width, self->dest.height);
|
||||||
|
wp_viewport_set_source (self->viewport,
|
||||||
|
wl_fixed_from_double (self->source.origin.x),
|
||||||
|
wl_fixed_from_double (self->source.origin.y),
|
||||||
|
wl_fixed_from_double (self->source.size.width),
|
||||||
|
wl_fixed_from_double (self->source.size.height));
|
||||||
|
|
||||||
if (buffer)
|
if (buffer)
|
||||||
{
|
{
|
||||||
@@ -322,8 +335,6 @@ gdk_wayland_subsurface_attach (GdkSubsurface *sub,
|
|||||||
wl_subsurface_place_above (self->subsurface, sib->surface);
|
wl_subsurface_place_above (self->subsurface, sib->surface);
|
||||||
else
|
else
|
||||||
wl_subsurface_place_below (self->subsurface, sib->surface);
|
wl_subsurface_place_below (self->subsurface, sib->surface);
|
||||||
|
|
||||||
self->above_parent = sib->above_parent;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -333,7 +344,6 @@ gdk_wayland_subsurface_attach (GdkSubsurface *sub,
|
|||||||
else
|
else
|
||||||
wl_subsurface_place_below (self->subsurface,
|
wl_subsurface_place_below (self->subsurface,
|
||||||
GDK_WAYLAND_SURFACE (sub->parent)->display_server.wl_surface);
|
GDK_WAYLAND_SURFACE (sub->parent)->display_server.wl_surface);
|
||||||
self->above_parent = above;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wl_surface_commit (self->surface);
|
wl_surface_commit (self->surface);
|
||||||
@@ -373,23 +383,27 @@ gdk_wayland_subsurface_get_texture (GdkSubsurface *sub)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gdk_wayland_subsurface_get_rect (GdkSubsurface *sub,
|
gdk_wayland_subsurface_get_dest (GdkSubsurface *sub,
|
||||||
graphene_rect_t *rect)
|
graphene_rect_t *dest)
|
||||||
{
|
{
|
||||||
GdkWaylandSubsurface *self = GDK_WAYLAND_SUBSURFACE (sub);
|
GdkWaylandSubsurface *self = GDK_WAYLAND_SUBSURFACE (sub);
|
||||||
|
|
||||||
rect->origin.x = self->dest.x;
|
dest->origin.x = self->dest.x;
|
||||||
rect->origin.y = self->dest.y;
|
dest->origin.y = self->dest.y;
|
||||||
rect->size.width = self->dest.width;
|
dest->size.width = self->dest.width;
|
||||||
rect->size.height = self->dest.height;
|
dest->size.height = self->dest.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static void
|
||||||
gdk_wayland_subsurface_is_above_parent (GdkSubsurface *sub)
|
gdk_wayland_subsurface_get_source (GdkSubsurface *sub,
|
||||||
|
graphene_rect_t *source)
|
||||||
{
|
{
|
||||||
GdkWaylandSubsurface *self = (GdkWaylandSubsurface *)sub;
|
GdkWaylandSubsurface *self = GDK_WAYLAND_SUBSURFACE (sub);
|
||||||
|
|
||||||
return self->above_parent;
|
source->origin.x = self->source.origin.x;
|
||||||
|
source->origin.y = self->source.origin.y;
|
||||||
|
source->size.width = self->source.size.width;
|
||||||
|
source->size.height = self->source.size.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -403,8 +417,8 @@ gdk_wayland_subsurface_class_init (GdkWaylandSubsurfaceClass *class)
|
|||||||
subsurface_class->attach = gdk_wayland_subsurface_attach;
|
subsurface_class->attach = gdk_wayland_subsurface_attach;
|
||||||
subsurface_class->detach = gdk_wayland_subsurface_detach;
|
subsurface_class->detach = gdk_wayland_subsurface_detach;
|
||||||
subsurface_class->get_texture = gdk_wayland_subsurface_get_texture;
|
subsurface_class->get_texture = gdk_wayland_subsurface_get_texture;
|
||||||
subsurface_class->get_rect = gdk_wayland_subsurface_get_rect;
|
subsurface_class->get_source = gdk_wayland_subsurface_get_source;
|
||||||
subsurface_class->is_above_parent = gdk_wayland_subsurface_is_above_parent;
|
subsurface_class->get_dest = gdk_wayland_subsurface_get_dest;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -478,8 +492,6 @@ gdk_wayland_surface_create_subsurface (GdkSurface *surface)
|
|||||||
wl_region_add (sub->opaque_region, 0, 0, G_MAXINT, G_MAXINT);
|
wl_region_add (sub->opaque_region, 0, 0, G_MAXINT, G_MAXINT);
|
||||||
wl_surface_set_opaque_region (sub->surface, sub->opaque_region);
|
wl_surface_set_opaque_region (sub->surface, sub->opaque_region);
|
||||||
|
|
||||||
sub->above_parent = TRUE;
|
|
||||||
|
|
||||||
GDK_DISPLAY_DEBUG (display, OFFLOAD, "Subsurface %p of surface %p created", sub, impl);
|
GDK_DISPLAY_DEBUG (display, OFFLOAD, "Subsurface %p of surface %p created", sub, impl);
|
||||||
|
|
||||||
return GDK_SUBSURFACE (sub);
|
return GDK_SUBSURFACE (sub);
|
||||||
|
|||||||
@@ -199,20 +199,20 @@ get_egl_window_size (GdkSurface *surface,
|
|||||||
GdkDisplay *display = gdk_surface_get_display (surface);
|
GdkDisplay *display = gdk_surface_get_display (surface);
|
||||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||||
|
|
||||||
if (GDK_DISPLAY_DEBUG_CHECK (display, GL_FRACTIONAL))
|
if (GDK_DISPLAY_DEBUG_CHECK (display, GL_NO_FRACTIONAL))
|
||||||
{
|
|
||||||
GDK_DISPLAY_DEBUG (display, OPENGL, "Using fractional scale %g for EGL window", gdk_fractional_scale_to_double (&impl->scale));
|
|
||||||
|
|
||||||
*width = gdk_fractional_scale_scale (&impl->scale, surface->width),
|
|
||||||
*height = gdk_fractional_scale_scale (&impl->scale, surface->height);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
GDK_DISPLAY_DEBUG (display, OPENGL, "Using integer scale %d for EGL window", gdk_fractional_scale_to_int (&impl->scale));
|
GDK_DISPLAY_DEBUG (display, OPENGL, "Using integer scale %d for EGL window", gdk_fractional_scale_to_int (&impl->scale));
|
||||||
|
|
||||||
*width = surface->width * gdk_fractional_scale_to_int (&impl->scale);
|
*width = surface->width * gdk_fractional_scale_to_int (&impl->scale);
|
||||||
*height = surface->height * gdk_fractional_scale_to_int (&impl->scale);
|
*height = surface->height * gdk_fractional_scale_to_int (&impl->scale);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GDK_DISPLAY_DEBUG (display, OPENGL, "Using fractional scale %g for EGL window", gdk_fractional_scale_to_double (&impl->scale));
|
||||||
|
|
||||||
|
*width = gdk_fractional_scale_scale (&impl->scale, surface->width),
|
||||||
|
*height = gdk_fractional_scale_scale (&impl->scale, surface->height);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -274,7 +274,7 @@ gdk_wayland_surface_frame_callback (GdkSurface *surface,
|
|||||||
GdkFrameClock *clock = gdk_surface_get_frame_clock (surface);
|
GdkFrameClock *clock = gdk_surface_get_frame_clock (surface);
|
||||||
GdkFrameTimings *timings;
|
GdkFrameTimings *timings;
|
||||||
|
|
||||||
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "wayland", "frame event");
|
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "Wayland frame event", NULL);
|
||||||
GDK_DISPLAY_DEBUG (GDK_DISPLAY (display_wayland), EVENTS, "frame %p", surface);
|
GDK_DISPLAY_DEBUG (GDK_DISPLAY (display_wayland), EVENTS, "frame %p", surface);
|
||||||
|
|
||||||
g_clear_pointer (&impl->frame_callback, wl_callback_destroy);
|
g_clear_pointer (&impl->frame_callback, wl_callback_destroy);
|
||||||
@@ -646,9 +646,12 @@ gdk_wayland_surface_sync_opaque_region (GdkSurface *surface)
|
|||||||
cairo_region_t *region = cairo_region_copy (impl->opaque_region);
|
cairo_region_t *region = cairo_region_copy (impl->opaque_region);
|
||||||
for (gsize i = 0; i < gdk_surface_get_n_subsurfaces (surface); i++)
|
for (gsize i = 0; i < gdk_surface_get_n_subsurfaces (surface); i++)
|
||||||
{
|
{
|
||||||
GdkWaylandSubsurface *sub = (GdkWaylandSubsurface *)gdk_surface_get_subsurface (surface, i);
|
GdkSubsurface *subsurface = gdk_surface_get_subsurface (surface, i);
|
||||||
if (sub->above_parent)
|
GdkWaylandSubsurface *sub = (GdkWaylandSubsurface *) subsurface;
|
||||||
|
|
||||||
|
if (subsurface->above_parent)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (sub->texture != NULL)
|
if (sub->texture != NULL)
|
||||||
cairo_region_subtract_rectangle (region, &sub->dest);
|
cairo_region_subtract_rectangle (region, &sub->dest);
|
||||||
}
|
}
|
||||||
@@ -746,6 +749,18 @@ gdk_wayland_surface_sync (GdkSurface *surface)
|
|||||||
gdk_wayland_surface_sync_viewport (surface);
|
gdk_wayland_surface_sync_viewport (surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
gdk_wayland_surface_needs_commit (GdkSurface *surface)
|
||||||
|
{
|
||||||
|
GdkWaylandSurface *self = GDK_WAYLAND_SURFACE (surface);
|
||||||
|
|
||||||
|
return self->has_pending_subsurface_commits ||
|
||||||
|
self->opaque_region_dirty ||
|
||||||
|
self->input_region_dirty ||
|
||||||
|
self->buffer_scale_dirty ||
|
||||||
|
self->viewport_dirty;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gdk_wayland_surface_fractional_scale_preferred_scale_cb (void *data,
|
gdk_wayland_surface_fractional_scale_preferred_scale_cb (void *data,
|
||||||
struct wp_fractional_scale_v1 *fractional_scale,
|
struct wp_fractional_scale_v1 *fractional_scale,
|
||||||
|
|||||||
@@ -830,7 +830,7 @@ gdk_wayland_surface_create_xdg_toplevel (GdkWaylandToplevel *wayland_toplevel)
|
|||||||
maybe_set_gtk_surface_dbus_properties (wayland_toplevel);
|
maybe_set_gtk_surface_dbus_properties (wayland_toplevel);
|
||||||
maybe_set_gtk_surface_modal (wayland_toplevel);
|
maybe_set_gtk_surface_modal (wayland_toplevel);
|
||||||
|
|
||||||
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "wayland", "surface commit");
|
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "Wayland surface commit", NULL);
|
||||||
wl_surface_commit (wayland_surface->display_server.wl_surface);
|
wl_surface_commit (wayland_surface->display_server.wl_surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -153,6 +153,11 @@ gdk_win32_cairo_context_end_frame (GdkDrawContext *draw_context,
|
|||||||
g_clear_pointer (&self->window_surface, cairo_surface_destroy);
|
g_clear_pointer (&self->window_surface, cairo_surface_destroy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gdk_win32_cairo_context_empty_frame (GdkDrawContext *draw_context)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static cairo_t *
|
static cairo_t *
|
||||||
gdk_win32_cairo_context_cairo_create (GdkCairoContext *context)
|
gdk_win32_cairo_context_cairo_create (GdkCairoContext *context)
|
||||||
{
|
{
|
||||||
@@ -182,6 +187,7 @@ gdk_win32_cairo_context_class_init (GdkWin32CairoContextClass *klass)
|
|||||||
|
|
||||||
draw_context_class->begin_frame = gdk_win32_cairo_context_begin_frame;
|
draw_context_class->begin_frame = gdk_win32_cairo_context_begin_frame;
|
||||||
draw_context_class->end_frame = gdk_win32_cairo_context_end_frame;
|
draw_context_class->end_frame = gdk_win32_cairo_context_end_frame;
|
||||||
|
draw_context_class->empty_frame = gdk_win32_cairo_context_empty_frame;
|
||||||
|
|
||||||
cairo_context_class->cairo_create = gdk_win32_cairo_context_cairo_create;
|
cairo_context_class->cairo_create = gdk_win32_cairo_context_cairo_create;
|
||||||
}
|
}
|
||||||
|
|||||||
+21
-10
@@ -892,11 +892,11 @@ pixbuf_to_hicon (GdkPixbuf *pixbuf,
|
|||||||
int x,
|
int x,
|
||||||
int y);
|
int y);
|
||||||
|
|
||||||
static GdkWin32HCursor *
|
HICON
|
||||||
gdk_win32hcursor_create_for_texture (GdkWin32Display *display,
|
_gdk_win32_create_hicon_for_texture (GdkTexture *texture,
|
||||||
GdkTexture *texture,
|
gboolean is_icon,
|
||||||
int x,
|
int x,
|
||||||
int y)
|
int y)
|
||||||
{
|
{
|
||||||
cairo_surface_t *surface;
|
cairo_surface_t *surface;
|
||||||
GdkPixbuf *pixbuf;
|
GdkPixbuf *pixbuf;
|
||||||
@@ -906,13 +906,24 @@ gdk_win32hcursor_create_for_texture (GdkWin32Display *display,
|
|||||||
surface = gdk_texture_download_surface (texture);
|
surface = gdk_texture_download_surface (texture);
|
||||||
width = cairo_image_surface_get_width (surface);
|
width = cairo_image_surface_get_width (surface);
|
||||||
height = cairo_image_surface_get_height (surface);
|
height = cairo_image_surface_get_height (surface);
|
||||||
|
|
||||||
pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0, width, height);
|
pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0, width, height);
|
||||||
|
|
||||||
icon = pixbuf_to_hicon (pixbuf, FALSE, x, y);
|
icon = pixbuf_to_hicon (pixbuf, is_icon, x, y);
|
||||||
|
|
||||||
g_object_unref (pixbuf);
|
g_object_unref (pixbuf);
|
||||||
|
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
static GdkWin32HCursor *
|
||||||
|
gdk_win32hcursor_create_for_texture (GdkWin32Display *display,
|
||||||
|
GdkTexture *texture,
|
||||||
|
int x,
|
||||||
|
int y)
|
||||||
|
{
|
||||||
|
HICON icon = _gdk_win32_create_hicon_for_texture (texture, FALSE, x, y);
|
||||||
|
|
||||||
return gdk_win32_hcursor_new (display, (HCURSOR) icon, TRUE);
|
return gdk_win32_hcursor_new (display, (HCURSOR) icon, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1064,6 +1064,7 @@ gdk_win32_display_check_composited (GdkWin32Display *display)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gdk_display_set_composited (GDK_DISPLAY (display), composited);
|
gdk_display_set_composited (GDK_DISPLAY (display), composited);
|
||||||
|
gdk_display_set_shadow_width (GDK_DISPLAY (display), composited);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
@@ -117,6 +117,11 @@ gdk_win32_gl_context_egl_begin_frame (GdkDrawContext *draw_context,
|
|||||||
GDK_DRAW_CONTEXT_CLASS (gdk_win32_gl_context_egl_parent_class)->begin_frame (draw_context, depth, update_area);
|
GDK_DRAW_CONTEXT_CLASS (gdk_win32_gl_context_egl_parent_class)->begin_frame (draw_context, depth, update_area);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gdk_win32_gl_context_egl_empty_frame (GdkDrawContext *draw_context)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gdk_win32_gl_context_egl_class_init (GdkWin32GLContextClass *klass)
|
gdk_win32_gl_context_egl_class_init (GdkWin32GLContextClass *klass)
|
||||||
{
|
{
|
||||||
@@ -127,6 +132,7 @@ gdk_win32_gl_context_egl_class_init (GdkWin32GLContextClass *klass)
|
|||||||
|
|
||||||
draw_context_class->begin_frame = gdk_win32_gl_context_egl_begin_frame;
|
draw_context_class->begin_frame = gdk_win32_gl_context_egl_begin_frame;
|
||||||
draw_context_class->end_frame = gdk_win32_gl_context_egl_end_frame;
|
draw_context_class->end_frame = gdk_win32_gl_context_egl_end_frame;
|
||||||
|
draw_context_class->empty_frame = gdk_win32_gl_context_egl_empty_frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
@@ -116,6 +116,11 @@ gdk_win32_gl_context_wgl_end_frame (GdkDrawContext *draw_context,
|
|||||||
SwapBuffers (hdc);
|
SwapBuffers (hdc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gdk_win32_gl_context_wgl_empty_frame (GdkDrawContext *draw_context)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gdk_win32_gl_context_wgl_begin_frame (GdkDrawContext *draw_context,
|
gdk_win32_gl_context_wgl_begin_frame (GdkDrawContext *draw_context,
|
||||||
GdkMemoryDepth depth,
|
GdkMemoryDepth depth,
|
||||||
@@ -126,7 +131,7 @@ 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);
|
GDK_DRAW_CONTEXT_CLASS (gdk_win32_gl_context_wgl_parent_class)->begin_frame (draw_context, depth, update_area);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PIXEL_ATTRIBUTES 17
|
#define PIXEL_ATTRIBUTES 21
|
||||||
|
|
||||||
static int
|
static int
|
||||||
get_wgl_pfd (HDC hdc,
|
get_wgl_pfd (HDC hdc,
|
||||||
@@ -171,10 +176,19 @@ get_wgl_pfd (HDC hdc,
|
|||||||
pixelAttribs[i++] = WGL_ALPHA_BITS_ARB;
|
pixelAttribs[i++] = WGL_ALPHA_BITS_ARB;
|
||||||
pixelAttribs[i++] = 8;
|
pixelAttribs[i++] = 8;
|
||||||
|
|
||||||
|
pixelAttribs[i++] = WGL_DEPTH_BITS_ARB;
|
||||||
|
pixelAttribs[i++] = 0;
|
||||||
|
|
||||||
|
pixelAttribs[i++] = WGL_STENCIL_BITS_ARB;
|
||||||
|
pixelAttribs[i++] = 0;
|
||||||
|
|
||||||
|
pixelAttribs[i++] = WGL_ACCUM_BITS_ARB;
|
||||||
|
pixelAttribs[i++] = 0;
|
||||||
|
|
||||||
/* end of "Update PIXEL_ATTRIBUTES above if any groups are added here!" */
|
/* end of "Update PIXEL_ATTRIBUTES above if any groups are added here!" */
|
||||||
|
|
||||||
pixelAttribs[i++] = 0; /* end of pixelAttribs */
|
pixelAttribs[i++] = 0; /* end of pixelAttribs */
|
||||||
g_assert (i <= PIXEL_ATTRIBUTES);
|
g_assert (i == PIXEL_ATTRIBUTES);
|
||||||
|
|
||||||
if (!wglMakeCurrent (display_win32->dummy_context_wgl.hdc,
|
if (!wglMakeCurrent (display_win32->dummy_context_wgl.hdc,
|
||||||
display_win32->dummy_context_wgl.hglrc))
|
display_win32->dummy_context_wgl.hglrc))
|
||||||
@@ -200,7 +214,7 @@ get_wgl_pfd (HDC hdc,
|
|||||||
pfd->iPixelType = PFD_TYPE_RGBA;
|
pfd->iPixelType = PFD_TYPE_RGBA;
|
||||||
pfd->cColorBits = GetDeviceCaps (hdc, BITSPIXEL);
|
pfd->cColorBits = GetDeviceCaps (hdc, BITSPIXEL);
|
||||||
pfd->cAlphaBits = 8;
|
pfd->cAlphaBits = 8;
|
||||||
pfd->dwLayerMask = PFD_MAIN_PLANE;
|
pfd->iLayerType = PFD_MAIN_PLANE;
|
||||||
|
|
||||||
best_pf = ChoosePixelFormat (hdc, pfd);
|
best_pf = ChoosePixelFormat (hdc, pfd);
|
||||||
}
|
}
|
||||||
@@ -599,7 +613,7 @@ set_wgl_pixformat_for_hdc (GdkWin32Display *display_win32,
|
|||||||
{
|
{
|
||||||
gboolean skip_acquire = FALSE;
|
gboolean skip_acquire = FALSE;
|
||||||
gboolean set_pixel_format_result = FALSE;
|
gboolean set_pixel_format_result = FALSE;
|
||||||
PIXELFORMATDESCRIPTOR pfd;
|
PIXELFORMATDESCRIPTOR pfd = {0};
|
||||||
|
|
||||||
/* one is only allowed to call SetPixelFormat(), and so ChoosePixelFormat()
|
/* one is only allowed to call SetPixelFormat(), and so ChoosePixelFormat()
|
||||||
* one single time per window HDC
|
* one single time per window HDC
|
||||||
@@ -809,6 +823,8 @@ gdk_win32_gl_context_wgl_class_init (GdkWin32GLContextWGLClass *klass)
|
|||||||
|
|
||||||
draw_context_class->begin_frame = gdk_win32_gl_context_wgl_begin_frame;
|
draw_context_class->begin_frame = gdk_win32_gl_context_wgl_begin_frame;
|
||||||
draw_context_class->end_frame = gdk_win32_gl_context_wgl_end_frame;
|
draw_context_class->end_frame = gdk_win32_gl_context_wgl_end_frame;
|
||||||
|
draw_context_class->empty_frame = gdk_win32_gl_context_wgl_empty_frame;
|
||||||
|
|
||||||
gobject_class->dispose = gdk_win32_gl_context_wgl_dispose;
|
gobject_class->dispose = gdk_win32_gl_context_wgl_dispose;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -211,6 +211,11 @@ Win32Cursor * win32_cursor_theme_get_cursor (Win32CursorTheme *theme,
|
|||||||
void win32_cursor_theme_destroy (Win32CursorTheme *theme);
|
void win32_cursor_theme_destroy (Win32CursorTheme *theme);
|
||||||
Win32CursorTheme *_gdk_win32_display_get_cursor_theme (GdkWin32Display *win32_display);
|
Win32CursorTheme *_gdk_win32_display_get_cursor_theme (GdkWin32Display *win32_display);
|
||||||
|
|
||||||
|
HICON _gdk_win32_create_hicon_for_texture (GdkTexture *texture,
|
||||||
|
gboolean is_icon,
|
||||||
|
int x,
|
||||||
|
int y);
|
||||||
|
|
||||||
gboolean _gdk_win32_display_has_pending (GdkDisplay *display);
|
gboolean _gdk_win32_display_has_pending (GdkDisplay *display);
|
||||||
void _gdk_win32_display_queue_events (GdkDisplay *display);
|
void _gdk_win32_display_queue_events (GdkDisplay *display);
|
||||||
|
|
||||||
|
|||||||
@@ -4308,6 +4308,82 @@ gdk_win32_surface_set_shadow_width (GdkSurface *window,
|
|||||||
impl->shadow_y = top + bottom;
|
impl->shadow_y = top + bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gdk_win32_surface_set_icon_list (GdkSurface *surface,
|
||||||
|
GList *textures)
|
||||||
|
{
|
||||||
|
GdkTexture *texture, *big_texture, *small_texture;
|
||||||
|
gint big_diff, small_diff;
|
||||||
|
gint big_w, big_h, small_w, small_h;
|
||||||
|
gint w, h;
|
||||||
|
gint dw, dh, diff;
|
||||||
|
HICON small_hicon, big_hicon;
|
||||||
|
GdkWin32Surface *impl;
|
||||||
|
|
||||||
|
if (GDK_SURFACE_DESTROYED (surface))
|
||||||
|
return;
|
||||||
|
|
||||||
|
impl = GDK_WIN32_SURFACE (surface);
|
||||||
|
|
||||||
|
/* ideal sizes for small and large icons */
|
||||||
|
big_w = GetSystemMetrics (SM_CXICON);
|
||||||
|
big_h = GetSystemMetrics (SM_CYICON);
|
||||||
|
small_w = GetSystemMetrics (SM_CXSMICON);
|
||||||
|
small_h = GetSystemMetrics (SM_CYSMICON);
|
||||||
|
|
||||||
|
/* find closest sized icons in the list */
|
||||||
|
big_texture = NULL;
|
||||||
|
small_texture = NULL;
|
||||||
|
big_diff = 0;
|
||||||
|
small_diff = 0;
|
||||||
|
while (textures)
|
||||||
|
{
|
||||||
|
texture = (GdkTexture*) textures->data;
|
||||||
|
w = gdk_texture_get_width (texture);
|
||||||
|
h = gdk_texture_get_height (texture);
|
||||||
|
|
||||||
|
dw = ABS (w - big_w);
|
||||||
|
dh = ABS (h - big_h);
|
||||||
|
diff = dw*dw + dh*dh;
|
||||||
|
if (big_texture == NULL || diff < big_diff)
|
||||||
|
{
|
||||||
|
big_texture = texture;
|
||||||
|
big_diff = diff;
|
||||||
|
}
|
||||||
|
|
||||||
|
dw = ABS (w - small_w);
|
||||||
|
dh = ABS (h - small_h);
|
||||||
|
diff = dw*dw + dh*dh;
|
||||||
|
if (small_texture == NULL || diff < small_diff)
|
||||||
|
{
|
||||||
|
small_texture = texture;
|
||||||
|
small_diff = diff;
|
||||||
|
}
|
||||||
|
|
||||||
|
textures = textures->next;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (big_texture == NULL || small_texture == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* Create the icons */
|
||||||
|
big_hicon = big_texture ? _gdk_win32_create_hicon_for_texture (big_texture, TRUE, 0, 0) : NULL;
|
||||||
|
small_hicon = small_texture ? _gdk_win32_create_hicon_for_texture (small_texture, TRUE, 0, 0) : NULL;
|
||||||
|
|
||||||
|
/* Set the icons */
|
||||||
|
SendMessage (GDK_SURFACE_HWND (surface), WM_SETICON, ICON_BIG,
|
||||||
|
(LPARAM)big_hicon);
|
||||||
|
SendMessage (GDK_SURFACE_HWND (surface), WM_SETICON, ICON_SMALL,
|
||||||
|
(LPARAM)small_hicon);
|
||||||
|
|
||||||
|
/* Store the icons, destroying any previous icons */
|
||||||
|
if (impl->hicon_big)
|
||||||
|
GDI_CALL (DestroyIcon, (impl->hicon_big));
|
||||||
|
impl->hicon_big = big_hicon;
|
||||||
|
if (impl->hicon_small)
|
||||||
|
GDI_CALL (DestroyIcon, (impl->hicon_small));
|
||||||
|
impl->hicon_small = small_hicon;
|
||||||
|
}
|
||||||
|
|
||||||
double
|
double
|
||||||
_gdk_win32_surface_get_scale (GdkSurface *surface)
|
_gdk_win32_surface_get_scale (GdkSurface *surface)
|
||||||
@@ -4738,6 +4814,8 @@ gdk_win32_toplevel_set_property (GObject *object,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LAST_PROP + GDK_TOPLEVEL_PROP_ICON_LIST:
|
case LAST_PROP + GDK_TOPLEVEL_PROP_ICON_LIST:
|
||||||
|
gdk_win32_surface_set_icon_list (surface, g_value_get_pointer (value));
|
||||||
|
g_object_notify_by_pspec (G_OBJECT (surface), pspec);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LAST_PROP + GDK_TOPLEVEL_PROP_DECORATED:
|
case LAST_PROP + GDK_TOPLEVEL_PROP_DECORATED:
|
||||||
|
|||||||
@@ -74,6 +74,11 @@ gdk_win32_vulkan_context_begin_frame (GdkDrawContext *draw_context,
|
|||||||
GDK_DRAW_CONTEXT_CLASS (gdk_win32_vulkan_context_parent_class)->begin_frame (draw_context, depth, update_area);
|
GDK_DRAW_CONTEXT_CLASS (gdk_win32_vulkan_context_parent_class)->begin_frame (draw_context, depth, update_area);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gdk_win32_vulkan_context_empty_frame (GdkDrawContext *draw_context)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gdk_win32_vulkan_context_class_init (GdkWin32VulkanContextClass *klass)
|
gdk_win32_vulkan_context_class_init (GdkWin32VulkanContextClass *klass)
|
||||||
{
|
{
|
||||||
@@ -82,6 +87,7 @@ gdk_win32_vulkan_context_class_init (GdkWin32VulkanContextClass *klass)
|
|||||||
|
|
||||||
context_class->create_surface = gdk_win32_vulkan_context_create_surface;
|
context_class->create_surface = gdk_win32_vulkan_context_create_surface;
|
||||||
draw_context_class->begin_frame = gdk_win32_vulkan_context_begin_frame;
|
draw_context_class->begin_frame = gdk_win32_vulkan_context_begin_frame;
|
||||||
|
draw_context_class->empty_frame = gdk_win32_vulkan_context_empty_frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
@@ -1429,6 +1429,9 @@ gdk_x11_display_open (const char *display_name)
|
|||||||
int ignore;
|
int ignore;
|
||||||
int maj, min;
|
int maj, min;
|
||||||
char *cm_name;
|
char *cm_name;
|
||||||
|
gboolean frame_extents;
|
||||||
|
gboolean rgba;
|
||||||
|
gboolean composited;
|
||||||
|
|
||||||
XInitThreads ();
|
XInitThreads ();
|
||||||
|
|
||||||
@@ -1643,6 +1646,13 @@ gdk_x11_display_open (const char *display_name)
|
|||||||
gdk_x11_get_xatom_by_name_for_display (display, cm_name)) != None);
|
gdk_x11_get_xatom_by_name_for_display (display, cm_name)) != None);
|
||||||
g_free (cm_name);
|
g_free (cm_name);
|
||||||
|
|
||||||
|
frame_extents = gdk_x11_screen_supports_net_wm_hint (gdk_x11_display_get_screen (display),
|
||||||
|
g_intern_static_string ("_GTK_FRAME_EXTENTS"));
|
||||||
|
rgba = gdk_display_is_rgba (display);
|
||||||
|
composited = gdk_display_is_composited (display);
|
||||||
|
|
||||||
|
gdk_display_set_shadow_width (display, frame_extents && rgba && composited);
|
||||||
|
|
||||||
gdk_display_emit_opened (display);
|
gdk_display_emit_opened (display);
|
||||||
|
|
||||||
return display;
|
return display;
|
||||||
|
|||||||
@@ -316,7 +316,10 @@ gdk_x11_gl_context_glx_get_damage (GdkGLContext *context)
|
|||||||
for (i = 0; i < buffer_age - 1; i++)
|
for (i = 0; i < buffer_age - 1; i++)
|
||||||
{
|
{
|
||||||
if (context->old_updated_area[i] == NULL)
|
if (context->old_updated_area[i] == NULL)
|
||||||
return GDK_GL_CONTEXT_CLASS (gdk_x11_gl_context_glx_parent_class)->get_damage (context);
|
{
|
||||||
|
cairo_region_destroy (damage);
|
||||||
|
return GDK_GL_CONTEXT_CLASS (gdk_x11_gl_context_glx_parent_class)->get_damage (context);
|
||||||
|
}
|
||||||
|
|
||||||
cairo_region_union (damage, context->old_updated_area[i]);
|
cairo_region_union (damage, context->old_updated_area[i]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2655,6 +2655,7 @@ gdk_x11_surface_get_geometry (GdkSurface *surface,
|
|||||||
{
|
{
|
||||||
GdkX11Surface *impl;
|
GdkX11Surface *impl;
|
||||||
Window root;
|
Window root;
|
||||||
|
Window child;
|
||||||
int tx;
|
int tx;
|
||||||
int ty;
|
int ty;
|
||||||
guint twidth;
|
guint twidth;
|
||||||
@@ -2669,7 +2670,11 @@ gdk_x11_surface_get_geometry (GdkSurface *surface,
|
|||||||
XGetGeometry (GDK_SURFACE_XDISPLAY (surface),
|
XGetGeometry (GDK_SURFACE_XDISPLAY (surface),
|
||||||
GDK_SURFACE_XID (surface),
|
GDK_SURFACE_XID (surface),
|
||||||
&root, &tx, &ty, &twidth, &theight, &tborder_width, &tdepth);
|
&root, &tx, &ty, &twidth, &theight, &tborder_width, &tdepth);
|
||||||
|
|
||||||
|
XTranslateCoordinates (GDK_SURFACE_XDISPLAY (surface),
|
||||||
|
GDK_SURFACE_XID (surface),
|
||||||
|
root, 0, 0, &tx, &ty, &child);
|
||||||
|
|
||||||
if (x)
|
if (x)
|
||||||
*x = tx / impl->surface_scale;
|
*x = tx / impl->surface_scale;
|
||||||
if (y)
|
if (y)
|
||||||
|
|||||||
@@ -1066,8 +1066,7 @@ gsk_gl_command_queue_execute (GskGLCommandQueue *self,
|
|||||||
gsk_gl_profiler_begin_gpu_region (self->gl_profiler);
|
gsk_gl_profiler_begin_gpu_region (self->gl_profiler);
|
||||||
gsk_profiler_timer_begin (self->profiler, self->metrics.cpu_time);
|
gsk_profiler_timer_begin (self->profiler, self->metrics.cpu_time);
|
||||||
|
|
||||||
glEnable (GL_DEPTH_TEST);
|
glDisable (GL_DEPTH_TEST);
|
||||||
glDepthFunc (GL_LEQUAL);
|
|
||||||
|
|
||||||
/* Pre-multiplied alpha */
|
/* Pre-multiplied alpha */
|
||||||
glEnable (GL_BLEND);
|
glEnable (GL_BLEND);
|
||||||
@@ -1608,8 +1607,8 @@ gsk_gl_command_queue_do_upload_texture_chunk (GskGLCommandQueue *self,
|
|||||||
|
|
||||||
if (gdk_profiler_is_running ())
|
if (gdk_profiler_is_running ())
|
||||||
{
|
{
|
||||||
gdk_profiler_add_markf (start_time, GDK_PROFILER_CURRENT_TIME-start_time,
|
gdk_profiler_end_markf (start_time,
|
||||||
"Download Texture chunk",
|
"Download texture chunk",
|
||||||
"Tile %dx%d Size %dx%d", x, y, width, height);
|
"Tile %dx%d Size %dx%d", x, y, width, height);
|
||||||
start_time = GDK_PROFILER_CURRENT_TIME;
|
start_time = GDK_PROFILER_CURRENT_TIME;
|
||||||
}
|
}
|
||||||
@@ -1654,8 +1653,8 @@ gsk_gl_command_queue_do_upload_texture_chunk (GskGLCommandQueue *self,
|
|||||||
g_bytes_unref (bytes);
|
g_bytes_unref (bytes);
|
||||||
|
|
||||||
if (gdk_profiler_is_running ())
|
if (gdk_profiler_is_running ())
|
||||||
gdk_profiler_add_markf (start_time, GDK_PROFILER_CURRENT_TIME-start_time,
|
gdk_profiler_end_markf (start_time,
|
||||||
"Upload Texture chunk",
|
"Upload texture chunk",
|
||||||
"Tile %dx%d Size %dx%d", x, y, width, height);
|
"Tile %dx%d Size %dx%d", x, y, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -424,7 +424,7 @@ gsk_gl_driver_load_programs (GskGLDriver *self,
|
|||||||
failure:
|
failure:
|
||||||
g_clear_object (&compiler);
|
g_clear_object (&compiler);
|
||||||
|
|
||||||
gdk_profiler_end_mark (start_time, "load programs", NULL);
|
gdk_profiler_end_mark (start_time, "Load GL programs", NULL);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -477,7 +477,7 @@ gsk_gl_driver_new (GskGLCommandQueue *command_queue,
|
|||||||
self->icons_library = gsk_gl_icon_library_new (self);
|
self->icons_library = gsk_gl_icon_library_new (self);
|
||||||
self->shadows_library = gsk_gl_shadow_library_new (self);
|
self->shadows_library = gsk_gl_shadow_library_new (self);
|
||||||
|
|
||||||
gdk_profiler_end_mark (before, "create GskGLDriver", NULL);
|
gdk_profiler_end_mark (before, "Create GL driver", NULL);
|
||||||
|
|
||||||
return g_steal_pointer (&self);
|
return g_steal_pointer (&self);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,11 +119,7 @@ gsk_gl_glyph_library_init_atlas (GskGLTextureLibrary *self,
|
|||||||
|
|
||||||
memset (pixel_data, 255, sizeof pixel_data);
|
memset (pixel_data, 255, sizeof pixel_data);
|
||||||
|
|
||||||
if (!gdk_gl_context_has_bgra (gdk_gl_context_get_current ())
|
if (gdk_gl_context_get_use_es (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_format = GL_RGBA;
|
||||||
gl_type = GL_UNSIGNED_BYTE;
|
gl_type = GL_UNSIGNED_BYTE;
|
||||||
@@ -380,7 +376,7 @@ gsk_gl_glyph_library_upload_glyph (GskGLGlyphLibrary *self,
|
|||||||
{
|
{
|
||||||
char message[64];
|
char message[64];
|
||||||
g_snprintf (message, sizeof message, "Size %dx%d", width, height);
|
g_snprintf (message, sizeof message, "Size %dx%d", width, height);
|
||||||
gdk_profiler_add_mark (start_time, GDK_PROFILER_CURRENT_TIME-start_time, "Upload Glyph", message);
|
gdk_profiler_add_mark (start_time, GDK_PROFILER_CURRENT_TIME-start_time, "Upload glyph", message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -211,6 +211,6 @@ gsk_gl_icon_library_add (GskGLIconLibrary *self,
|
|||||||
{
|
{
|
||||||
char message[64];
|
char message[64];
|
||||||
g_snprintf (message, sizeof message, "Size %dx%d", width, height);
|
g_snprintf (message, sizeof message, "Size %dx%d", width, height);
|
||||||
gdk_profiler_add_mark (start_time, GDK_PROFILER_CURRENT_TIME-start_time, "Upload Icon", message);
|
gdk_profiler_add_mark (start_time, GDK_PROFILER_CURRENT_TIME-start_time, "Upload icon", message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+33
-33
@@ -830,8 +830,8 @@ rounded_rect_scale_corners (const GskRoundedRect *rect,
|
|||||||
{
|
{
|
||||||
for (guint i = 0; i < G_N_ELEMENTS (out_rect->corner); i++)
|
for (guint i = 0; i < G_N_ELEMENTS (out_rect->corner); i++)
|
||||||
{
|
{
|
||||||
out_rect->corner[i].width = rect->corner[i].width * fabs (scale_x);
|
out_rect->corner[i].width = rect->corner[i].width * fabsf (scale_x);
|
||||||
out_rect->corner[i].height = rect->corner[i].height * fabs (scale_y);
|
out_rect->corner[i].height = rect->corner[i].height * fabsf (scale_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scale_x < 0)
|
if (scale_x < 0)
|
||||||
@@ -1173,8 +1173,8 @@ gsk_gl_render_job_visit_as_fallback (GskGLRenderJob *job,
|
|||||||
{
|
{
|
||||||
float scale_x = job->scale_x;
|
float scale_x = job->scale_x;
|
||||||
float scale_y = job->scale_y;
|
float scale_y = job->scale_y;
|
||||||
int surface_width = ceilf (node->bounds.size.width * fabs (scale_x));
|
int surface_width = ceilf (node->bounds.size.width * fabsf (scale_x));
|
||||||
int surface_height = ceilf (node->bounds.size.height * fabs (scale_y));
|
int surface_height = ceilf (node->bounds.size.height * fabsf (scale_y));
|
||||||
GdkTexture *texture;
|
GdkTexture *texture;
|
||||||
cairo_surface_t *surface;
|
cairo_surface_t *surface;
|
||||||
cairo_surface_t *rendered_surface;
|
cairo_surface_t *rendered_surface;
|
||||||
@@ -1203,7 +1203,7 @@ gsk_gl_render_job_visit_as_fallback (GskGLRenderJob *job,
|
|||||||
surface_width,
|
surface_width,
|
||||||
surface_height);
|
surface_height);
|
||||||
|
|
||||||
cairo_surface_set_device_scale (rendered_surface, fabs (scale_x), fabs (scale_y));
|
cairo_surface_set_device_scale (rendered_surface, fabsf (scale_x), fabsf (scale_y));
|
||||||
cr = cairo_create (rendered_surface);
|
cr = cairo_create (rendered_surface);
|
||||||
|
|
||||||
cairo_save (cr);
|
cairo_save (cr);
|
||||||
@@ -1217,16 +1217,16 @@ gsk_gl_render_job_visit_as_fallback (GskGLRenderJob *job,
|
|||||||
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
|
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
|
||||||
surface_width,
|
surface_width,
|
||||||
surface_height);
|
surface_height);
|
||||||
cairo_surface_set_device_scale (surface, fabs (scale_x), fabs (scale_y));
|
cairo_surface_set_device_scale (surface, fabsf (scale_x), fabsf (scale_y));
|
||||||
cr = cairo_create (surface);
|
cr = cairo_create (surface);
|
||||||
|
|
||||||
/* We draw upside down here, so it matches what GL does. */
|
/* We draw upside down here, so it matches what GL does. */
|
||||||
cairo_save (cr);
|
cairo_save (cr);
|
||||||
cairo_scale (cr, scale_x < 0 ? -1 : 1, scale_y < 0 ? 1 : -1);
|
cairo_scale (cr, scale_x < 0 ? -1 : 1, scale_y < 0 ? 1 : -1);
|
||||||
cairo_translate (cr, scale_x < 0 ? - surface_width / fabs (scale_x) : 0,
|
cairo_translate (cr, scale_x < 0 ? - surface_width / fabsf (scale_x) : 0,
|
||||||
scale_y < 0 ? 0 : - surface_height / fabs (scale_y));
|
scale_y < 0 ? 0 : - surface_height / fabsf (scale_y));
|
||||||
cairo_set_source_surface (cr, rendered_surface, 0, 0);
|
cairo_set_source_surface (cr, rendered_surface, 0, 0);
|
||||||
cairo_rectangle (cr, 0, 0, surface_width / fabs (scale_x), surface_height / fabs (scale_y));
|
cairo_rectangle (cr, 0, 0, surface_width / fabsf (scale_x), surface_height / fabsf (scale_y));
|
||||||
cairo_fill (cr);
|
cairo_fill (cr);
|
||||||
cairo_restore (cr);
|
cairo_restore (cr);
|
||||||
cairo_destroy (cr);
|
cairo_destroy (cr);
|
||||||
@@ -1432,10 +1432,10 @@ blur_node (GskGLRenderJob *job,
|
|||||||
|
|
||||||
offscreen->texture_id = blur_offscreen (job,
|
offscreen->texture_id = blur_offscreen (job,
|
||||||
offscreen,
|
offscreen,
|
||||||
texture_width * fabs (scale_x),
|
texture_width * fabsf (scale_x),
|
||||||
texture_height * fabs (scale_y),
|
texture_height * fabsf (scale_y),
|
||||||
blur_radius * fabs (scale_x),
|
blur_radius * fabsf (scale_x),
|
||||||
blur_radius * fabs (scale_y));
|
blur_radius * fabsf (scale_y));
|
||||||
init_full_texture_region (offscreen);
|
init_full_texture_region (offscreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2019,9 +2019,9 @@ result_is_axis_aligned (GskTransform *transform,
|
|||||||
for (guint i = 0; i < 4; i++)
|
for (guint i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
p = graphene_quad_get_point (&q, i);
|
p = graphene_quad_get_point (&q, i);
|
||||||
if (fabs (p->x - b1.x) > FLT_EPSILON && fabs (p->x - b2.x) > FLT_EPSILON)
|
if (fabsf (p->x - b1.x) > FLT_EPSILON && fabsf (p->x - b2.x) > FLT_EPSILON)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (fabs (p->y - b1.y) > FLT_EPSILON && fabs (p->y - b2.y) > FLT_EPSILON)
|
if (fabsf (p->y - b1.y) > FLT_EPSILON && fabsf (p->y - b2.y) > FLT_EPSILON)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2304,8 +2304,8 @@ gsk_gl_render_job_visit_blurred_inset_shadow_node (GskGLRenderJob *job,
|
|||||||
&offscreen,
|
&offscreen,
|
||||||
texture_width,
|
texture_width,
|
||||||
texture_height,
|
texture_height,
|
||||||
blur_radius * fabs (scale_x),
|
blur_radius * fabsf (scale_x),
|
||||||
blur_radius * fabs (scale_y));
|
blur_radius * fabsf (scale_y));
|
||||||
|
|
||||||
gsk_gl_driver_release_render_target (job->driver, render_target, TRUE);
|
gsk_gl_driver_release_render_target (job->driver, render_target, TRUE);
|
||||||
|
|
||||||
@@ -2501,8 +2501,8 @@ gsk_gl_render_job_visit_blurred_outset_shadow_node (GskGLRenderJob *job,
|
|||||||
do_slicing = TRUE;
|
do_slicing = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
texture_width = (int)ceil ((scaled_outline.bounds.size.width + blur_extra) * scale_x);
|
texture_width = (int)ceilf ((scaled_outline.bounds.size.width + blur_extra) * scale_x);
|
||||||
texture_height = (int)ceil ((scaled_outline.bounds.size.height + blur_extra) * scale_y);
|
texture_height = (int)ceilf ((scaled_outline.bounds.size.height + blur_extra) * scale_y);
|
||||||
|
|
||||||
scaled_outline.bounds.origin.x = extra_blur_pixels_x;
|
scaled_outline.bounds.origin.x = extra_blur_pixels_x;
|
||||||
scaled_outline.bounds.origin.y = extra_blur_pixels_y;
|
scaled_outline.bounds.origin.y = extra_blur_pixels_y;
|
||||||
@@ -2577,8 +2577,8 @@ gsk_gl_render_job_visit_blurred_outset_shadow_node (GskGLRenderJob *job,
|
|||||||
&offscreen,
|
&offscreen,
|
||||||
texture_width,
|
texture_width,
|
||||||
texture_height,
|
texture_height,
|
||||||
blur_radius * fabs (scale_x),
|
blur_radius * fabsf (scale_x),
|
||||||
blur_radius * fabs (scale_y));
|
blur_radius * fabsf (scale_y));
|
||||||
|
|
||||||
gsk_gl_shadow_library_insert (job->driver->shadows_library,
|
gsk_gl_shadow_library_insert (job->driver->shadows_library,
|
||||||
&scaled_outline,
|
&scaled_outline,
|
||||||
@@ -2834,7 +2834,7 @@ gsk_gl_render_job_visit_cross_fade_node (GskGLRenderJob *job,
|
|||||||
offscreen_end.reset_clip = TRUE;
|
offscreen_end.reset_clip = TRUE;
|
||||||
offscreen_end.bounds = &node->bounds;
|
offscreen_end.bounds = &node->bounds;
|
||||||
|
|
||||||
gsk_gl_render_job_set_modelview (job, gsk_transform_scale (NULL, fabs (job->scale_x), fabs (job->scale_y)));
|
gsk_gl_render_job_set_modelview (job, gsk_transform_scale (NULL, fabsf (job->scale_x), fabsf (job->scale_y)));
|
||||||
|
|
||||||
if (!gsk_gl_render_job_visit_node_with_offscreen (job, start_node, &offscreen_start))
|
if (!gsk_gl_render_job_visit_node_with_offscreen (job, start_node, &offscreen_start))
|
||||||
{
|
{
|
||||||
@@ -2964,7 +2964,7 @@ gsk_gl_render_job_visit_text_node (GskGLRenderJob *job,
|
|||||||
const PangoFont *font = gsk_text_node_get_font (node);
|
const PangoFont *font = gsk_text_node_get_font (node);
|
||||||
const PangoGlyphInfo *glyphs = gsk_text_node_get_glyphs (node, NULL);
|
const PangoGlyphInfo *glyphs = gsk_text_node_get_glyphs (node, NULL);
|
||||||
const graphene_point_t *offset = gsk_text_node_get_offset (node);
|
const graphene_point_t *offset = gsk_text_node_get_offset (node);
|
||||||
float text_scale = MAX (fabs (job->scale_x), fabs (job->scale_y)); /* TODO: Fix for uneven scales? */
|
float text_scale = MAX (fabsf (job->scale_x), fabsf (job->scale_y)); /* TODO: Fix for uneven scales? */
|
||||||
guint num_glyphs = gsk_text_node_get_num_glyphs (node);
|
guint num_glyphs = gsk_text_node_get_num_glyphs (node);
|
||||||
float x = offset->x + job->offset_x;
|
float x = offset->x + job->offset_x;
|
||||||
float y = offset->y + job->offset_y;
|
float y = offset->y + job->offset_y;
|
||||||
@@ -3263,7 +3263,7 @@ gsk_gl_render_job_visit_blend_node (GskGLRenderJob *job,
|
|||||||
bottom_offscreen.force_offscreen = TRUE;
|
bottom_offscreen.force_offscreen = TRUE;
|
||||||
bottom_offscreen.reset_clip = TRUE;
|
bottom_offscreen.reset_clip = TRUE;
|
||||||
|
|
||||||
gsk_gl_render_job_set_modelview (job, gsk_transform_scale (NULL, fabs (job->scale_x), fabs (job->scale_y)));
|
gsk_gl_render_job_set_modelview (job, gsk_transform_scale (NULL, fabsf (job->scale_x), fabsf (job->scale_y)));
|
||||||
|
|
||||||
/* TODO: We create 2 textures here as big as the blend node, but both the
|
/* TODO: We create 2 textures here as big as the blend node, but both the
|
||||||
* start and the end node might be a lot smaller than that. */
|
* start and the end node might be a lot smaller than that. */
|
||||||
@@ -3344,8 +3344,8 @@ gsk_gl_render_job_texture_mask_for_color (GskGLRenderJob *job,
|
|||||||
gboolean use_mipmap;
|
gboolean use_mipmap;
|
||||||
guint16 cc[4];
|
guint16 cc[4];
|
||||||
|
|
||||||
use_mipmap = (scale_x * fabs (job->scale_x)) < 0.5 ||
|
use_mipmap = (scale_x * fabsf (job->scale_x)) < 0.5 ||
|
||||||
(scale_y * fabs (job->scale_y)) < 0.5;
|
(scale_y * fabsf (job->scale_y)) < 0.5;
|
||||||
|
|
||||||
rgba_to_half (rgba, cc);
|
rgba_to_half (rgba, cc);
|
||||||
gsk_gl_render_job_upload_texture (job, texture, use_mipmap, &offscreen);
|
gsk_gl_render_job_upload_texture (job, texture, use_mipmap, &offscreen);
|
||||||
@@ -3396,7 +3396,7 @@ gsk_gl_render_job_visit_mask_node (GskGLRenderJob *job,
|
|||||||
mask_offscreen.reset_clip = TRUE;
|
mask_offscreen.reset_clip = TRUE;
|
||||||
mask_offscreen.do_not_cache = TRUE;
|
mask_offscreen.do_not_cache = TRUE;
|
||||||
|
|
||||||
gsk_gl_render_job_set_modelview (job, gsk_transform_scale (NULL, fabs (job->scale_x), fabs (job->scale_y)));
|
gsk_gl_render_job_set_modelview (job, gsk_transform_scale (NULL, fabsf (job->scale_x), fabsf (job->scale_y)));
|
||||||
|
|
||||||
/* TODO: We create 2 textures here as big as the mask node, but both
|
/* TODO: We create 2 textures here as big as the mask node, but both
|
||||||
* nodes might be a lot smaller than that.
|
* nodes might be a lot smaller than that.
|
||||||
@@ -3664,8 +3664,8 @@ gsk_gl_render_job_visit_texture (GskGLRenderJob *job,
|
|||||||
float scale_y = bounds->size.height / texture->height;
|
float scale_y = bounds->size.height / texture->height;
|
||||||
gboolean use_mipmap;
|
gboolean use_mipmap;
|
||||||
|
|
||||||
use_mipmap = (scale_x * fabs (job->scale_x)) < 0.5 ||
|
use_mipmap = (scale_x * fabsf (job->scale_x)) < 0.5 ||
|
||||||
(scale_y * fabs (job->scale_y)) < 0.5;
|
(scale_y * fabsf (job->scale_y)) < 0.5;
|
||||||
|
|
||||||
if G_LIKELY (texture->width <= max_texture_size &&
|
if G_LIKELY (texture->width <= max_texture_size &&
|
||||||
texture->height <= max_texture_size)
|
texture->height <= max_texture_size)
|
||||||
@@ -4322,7 +4322,7 @@ gsk_gl_render_job_visit_node_with_offscreen (GskGLRenderJob *job,
|
|||||||
gsk_gl_render_job_push_modelview (job, transform);
|
gsk_gl_render_job_push_modelview (job, transform);
|
||||||
gsk_transform_unref (transform);
|
gsk_transform_unref (transform);
|
||||||
gsk_gl_render_job_transform_bounds (job, offscreen->bounds, &viewport);
|
gsk_gl_render_job_transform_bounds (job, offscreen->bounds, &viewport);
|
||||||
graphene_rect_scale (&viewport, downscale_x, downscale_y, &viewport);
|
gsk_rect_scale (&viewport, downscale_x, downscale_y, &viewport);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (downscale_x == 1)
|
if (downscale_x == 1)
|
||||||
@@ -4416,7 +4416,7 @@ gsk_gl_render_job_visit_node_with_offscreen (GskGLRenderJob *job,
|
|||||||
float scale_x = flipped_x ? - downscale_x : downscale_x;
|
float scale_x = flipped_x ? - downscale_x : downscale_x;
|
||||||
float scale_y = flipped_y ? - downscale_y : downscale_y;
|
float scale_y = flipped_y ? - downscale_y : downscale_y;
|
||||||
|
|
||||||
graphene_rect_scale (&job->current_clip->rect.bounds, scale_x, scale_y, &new_clip.bounds);
|
gsk_rect_scale (&job->current_clip->rect.bounds, scale_x, scale_y, &new_clip.bounds);
|
||||||
rounded_rect_scale_corners (&job->current_clip->rect, &new_clip, scale_x, scale_y);
|
rounded_rect_scale_corners (&job->current_clip->rect, &new_clip, scale_x, scale_y);
|
||||||
gsk_gl_render_job_push_clip (job, &new_clip);
|
gsk_gl_render_job_push_clip (job, &new_clip);
|
||||||
reset_clip = TRUE;
|
reset_clip = TRUE;
|
||||||
@@ -4544,7 +4544,7 @@ gsk_gl_render_job_render (GskGLRenderJob *job,
|
|||||||
gsk_gl_render_job_visit_node (job, root);
|
gsk_gl_render_job_visit_node (job, root);
|
||||||
gdk_gl_context_pop_debug_group (job->command_queue->context);
|
gdk_gl_context_pop_debug_group (job->command_queue->context);
|
||||||
|
|
||||||
gdk_profiler_add_mark (start_time, GDK_PROFILER_CURRENT_TIME-start_time, "Build GL command queue", "");
|
gdk_profiler_end_mark (start_time, "Build GL command queue", "");
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* At this point the atlases have uploaded content while we processed
|
/* At this point the atlases have uploaded content while we processed
|
||||||
@@ -4562,7 +4562,7 @@ gsk_gl_render_job_render (GskGLRenderJob *job,
|
|||||||
gdk_gl_context_push_debug_group (job->command_queue->context, "Executing command queue");
|
gdk_gl_context_push_debug_group (job->command_queue->context, "Executing command queue");
|
||||||
gsk_gl_command_queue_execute (job->command_queue, surface_height, scale, job->region, job->default_framebuffer);
|
gsk_gl_command_queue_execute (job->command_queue, surface_height, scale, job->region, job->default_framebuffer);
|
||||||
gdk_gl_context_pop_debug_group (job->command_queue->context);
|
gdk_gl_context_pop_debug_group (job->command_queue->context);
|
||||||
gdk_profiler_add_mark (start_time, GDK_PROFILER_CURRENT_TIME-start_time, "Execute GL command queue", "");
|
gdk_profiler_end_mark (start_time, "Execute GL command queue", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|||||||
@@ -117,9 +117,8 @@ gsk_gl_texture_library_real_compact (GskGLTextureLibrary *self,
|
|||||||
g_hash_table_iter_remove (&iter);
|
g_hash_table_iter_remove (&iter);
|
||||||
dropped++;
|
dropped++;
|
||||||
}
|
}
|
||||||
|
else if (periodic_scan)
|
||||||
if (periodic_scan)
|
entry->accessed = FALSE;
|
||||||
entry->accessed = FALSE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -440,7 +439,6 @@ gsk_gl_texture_library_pack (GskGLTextureLibrary *self,
|
|||||||
|
|
||||||
entry->texture = texture;
|
entry->texture = texture;
|
||||||
entry->is_atlased = FALSE;
|
entry->is_atlased = FALSE;
|
||||||
entry->accessed = TRUE;
|
|
||||||
entry->area.x = padding / (float) (padding + width + padding);
|
entry->area.x = padding / (float) (padding + width + padding);
|
||||||
entry->area.y = padding / (float) (padding + height + padding);
|
entry->area.y = padding / (float) (padding + height + padding);
|
||||||
entry->area.x2 = (padding + width) / (float) (padding + width + padding);
|
entry->area.x2 = (padding + width) / (float) (padding + width + padding);
|
||||||
|
|||||||
@@ -125,6 +125,12 @@ gsk_gl_device_create_atlas_image (GskGpuDevice *device,
|
|||||||
height);
|
height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gsk_gl_device_make_current (GskGpuDevice *device)
|
||||||
|
{
|
||||||
|
gdk_gl_context_make_current (gdk_display_get_gl_context (gsk_gpu_device_get_display (device)));
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gsk_gl_device_finalize (GObject *object)
|
gsk_gl_device_finalize (GObject *object)
|
||||||
{
|
{
|
||||||
@@ -151,6 +157,7 @@ gsk_gl_device_class_init (GskGLDeviceClass *klass)
|
|||||||
gpu_device_class->create_atlas_image = gsk_gl_device_create_atlas_image;
|
gpu_device_class->create_atlas_image = gsk_gl_device_create_atlas_image;
|
||||||
gpu_device_class->create_upload_image = gsk_gl_device_create_upload_image;
|
gpu_device_class->create_upload_image = gsk_gl_device_create_upload_image;
|
||||||
gpu_device_class->create_download_image = gsk_gl_device_create_download_image;
|
gpu_device_class->create_download_image = gsk_gl_device_create_download_image;
|
||||||
|
gpu_device_class->make_current = gsk_gl_device_make_current;
|
||||||
|
|
||||||
object_class->finalize = gsk_gl_device_finalize;
|
object_class->finalize = gsk_gl_device_finalize;
|
||||||
}
|
}
|
||||||
@@ -235,7 +242,7 @@ gsk_gl_device_get_for_display (GdkDisplay *display,
|
|||||||
if (!gdk_gl_context_check_version (context, "3.0", "3.0"))
|
if (!gdk_gl_context_check_version (context, "3.0", "3.0"))
|
||||||
{
|
{
|
||||||
g_set_error (error, GDK_GL_ERROR, GDK_GL_ERROR_NOT_AVAILABLE,
|
g_set_error (error, GDK_GL_ERROR, GDK_GL_ERROR_NOT_AVAILABLE,
|
||||||
_("OpenGL ES 2.0 is not supported by this renderer."));
|
_("OpenGL ES 3.0 is not supported by this renderer."));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -144,8 +144,7 @@ gsk_gl_frame_submit (GskGpuFrame *frame,
|
|||||||
|
|
||||||
glEnable (GL_SCISSOR_TEST);
|
glEnable (GL_SCISSOR_TEST);
|
||||||
|
|
||||||
glEnable (GL_DEPTH_TEST);
|
glDisable (GL_DEPTH_TEST);
|
||||||
glDepthFunc (GL_LEQUAL);
|
|
||||||
glEnable (GL_BLEND);
|
glEnable (GL_BLEND);
|
||||||
|
|
||||||
if (vertex_buffer)
|
if (vertex_buffer)
|
||||||
|
|||||||
+11
-1
@@ -43,7 +43,7 @@ gsk_gl_image_finalize (GObject *object)
|
|||||||
{
|
{
|
||||||
GskGLImage *self = GSK_GL_IMAGE (object);
|
GskGLImage *self = GSK_GL_IMAGE (object);
|
||||||
|
|
||||||
if (self->framebuffer_id)
|
if (self->texture_id && self->framebuffer_id)
|
||||||
glDeleteFramebuffers (1, &self->framebuffer_id);
|
glDeleteFramebuffers (1, &self->framebuffer_id);
|
||||||
|
|
||||||
if (self->owns_texture)
|
if (self->owns_texture)
|
||||||
@@ -70,6 +70,7 @@ gsk_gl_image_init (GskGLImage *self)
|
|||||||
|
|
||||||
GskGpuImage *
|
GskGpuImage *
|
||||||
gsk_gl_image_new_backbuffer (GskGLDevice *device,
|
gsk_gl_image_new_backbuffer (GskGLDevice *device,
|
||||||
|
GdkGLContext *context,
|
||||||
GdkMemoryFormat format,
|
GdkMemoryFormat format,
|
||||||
gsize width,
|
gsize width,
|
||||||
gsize height)
|
gsize height)
|
||||||
@@ -95,6 +96,13 @@ gsk_gl_image_new_backbuffer (GskGLDevice *device,
|
|||||||
|
|
||||||
/* texture_id == 0 means backbuffer */
|
/* texture_id == 0 means backbuffer */
|
||||||
|
|
||||||
|
/* Check for non-standard framebuffer binding as we might not be using
|
||||||
|
* the default framebuffer on systems like macOS where we've bound an
|
||||||
|
* IOSurface to a GL_TEXTURE_RECTANGLE. Otherwise, no scissor clip will
|
||||||
|
* be applied in the command queue causing overdrawing.
|
||||||
|
*/
|
||||||
|
self->framebuffer_id = GDK_GL_CONTEXT_GET_CLASS (context)->get_default_framebuffer (context);
|
||||||
|
|
||||||
return GSK_GPU_IMAGE (self);
|
return GSK_GPU_IMAGE (self);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,6 +195,8 @@ gsk_gl_image_new_for_texture (GskGLDevice *device,
|
|||||||
if (format != real_format)
|
if (format != real_format)
|
||||||
flags = GSK_GPU_IMAGE_NO_BLIT |
|
flags = GSK_GPU_IMAGE_NO_BLIT |
|
||||||
(gdk_memory_format_alpha (format) == GDK_MEMORY_ALPHA_STRAIGHT ? GSK_GPU_IMAGE_STRAIGHT_ALPHA : 0);
|
(gdk_memory_format_alpha (format) == GDK_MEMORY_ALPHA_STRAIGHT ? GSK_GPU_IMAGE_STRAIGHT_ALPHA : 0);
|
||||||
|
else
|
||||||
|
flags &= ~(GSK_GPU_IMAGE_CAN_MIPMAP | GSK_GPU_IMAGE_MIPMAP);
|
||||||
|
|
||||||
gsk_gpu_image_setup (GSK_GPU_IMAGE (self),
|
gsk_gpu_image_setup (GSK_GPU_IMAGE (self),
|
||||||
flags | extra_flags,
|
flags | extra_flags,
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ G_BEGIN_DECLS
|
|||||||
G_DECLARE_FINAL_TYPE (GskGLImage, gsk_gl_image, GSK, GL_IMAGE, GskGpuImage)
|
G_DECLARE_FINAL_TYPE (GskGLImage, gsk_gl_image, GSK, GL_IMAGE, GskGpuImage)
|
||||||
|
|
||||||
GskGpuImage * gsk_gl_image_new_backbuffer (GskGLDevice *device,
|
GskGpuImage * gsk_gl_image_new_backbuffer (GskGLDevice *device,
|
||||||
|
GdkGLContext *context,
|
||||||
GdkMemoryFormat format,
|
GdkMemoryFormat format,
|
||||||
gsize width,
|
gsize width,
|
||||||
gsize height);
|
gsize height);
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ gsk_gpu_blend_mode_op_print (GskGpuOp *op,
|
|||||||
instance = (GskGpuBlendmodeInstance *) gsk_gpu_frame_get_vertex_data (frame, shader->vertex_offset);
|
instance = (GskGpuBlendmodeInstance *) gsk_gpu_frame_get_vertex_data (frame, shader->vertex_offset);
|
||||||
|
|
||||||
gsk_gpu_print_op (string, indent, "blend-mode");
|
gsk_gpu_print_op (string, indent, "blend-mode");
|
||||||
|
gsk_gpu_print_shader_info (string, shader->clip);
|
||||||
gsk_gpu_print_rect (string, instance->rect);
|
gsk_gpu_print_rect (string, instance->rect);
|
||||||
gsk_gpu_print_image_descriptor (string, shader->desc, instance->bottom_id);
|
gsk_gpu_print_image_descriptor (string, shader->desc, instance->bottom_id);
|
||||||
gsk_gpu_print_enum (string, GSK_TYPE_BLEND_MODE, shader->variation);
|
gsk_gpu_print_enum (string, GSK_TYPE_BLEND_MODE, shader->variation);
|
||||||
|
|||||||
@@ -36,6 +36,9 @@ gsk_gpu_blend_op_print (GskGpuOp *op,
|
|||||||
case GSK_GPU_BLEND_ADD:
|
case GSK_GPU_BLEND_ADD:
|
||||||
gsk_gpu_print_string (string, "add");
|
gsk_gpu_print_string (string, "add");
|
||||||
break;
|
break;
|
||||||
|
case GSK_GPU_BLEND_CLEAR:
|
||||||
|
gsk_gpu_print_string (string, "clear");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
break;
|
break;
|
||||||
@@ -72,6 +75,9 @@ gsk_gpu_blend_op_gl_command (GskGpuOp *op,
|
|||||||
case GSK_GPU_BLEND_ADD:
|
case GSK_GPU_BLEND_ADD:
|
||||||
glBlendFunc (GL_ONE, GL_ONE);
|
glBlendFunc (GL_ONE, GL_ONE);
|
||||||
break;
|
break;
|
||||||
|
case GSK_GPU_BLEND_CLEAR:
|
||||||
|
glBlendFunc (GL_ZERO, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -85,7 +85,6 @@ gsk_gpu_blit_op_vk_command (GskGpuOp *op,
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
G_GNUC_FALLTHROUGH;
|
|
||||||
case GSK_GPU_BLIT_LINEAR:
|
case GSK_GPU_BLIT_LINEAR:
|
||||||
filter = VK_FILTER_LINEAR;
|
filter = VK_FILTER_LINEAR;
|
||||||
break;
|
break;
|
||||||
@@ -160,7 +159,6 @@ gsk_gpu_blit_op_gl_command (GskGpuOp *op,
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
G_GNUC_FALLTHROUGH;
|
|
||||||
case GSK_GPU_BLIT_LINEAR:
|
case GSK_GPU_BLIT_LINEAR:
|
||||||
filter = GL_LINEAR;
|
filter = GL_LINEAR;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ gsk_gpu_blur_op_print (GskGpuOp *op,
|
|||||||
instance = (GskGpuBlurInstance *) gsk_gpu_frame_get_vertex_data (frame, shader->vertex_offset);
|
instance = (GskGpuBlurInstance *) gsk_gpu_frame_get_vertex_data (frame, shader->vertex_offset);
|
||||||
|
|
||||||
gsk_gpu_print_op (string, indent, "blur");
|
gsk_gpu_print_op (string, indent, "blur");
|
||||||
|
gsk_gpu_print_shader_info (string, shader->clip);
|
||||||
|
g_string_append_printf (string, "%g,%g ", instance->blur_direction[0], instance->blur_direction[1]);
|
||||||
gsk_gpu_print_rect (string, instance->rect);
|
gsk_gpu_print_rect (string, instance->rect);
|
||||||
gsk_gpu_print_image_descriptor (string, shader->desc, instance->tex_id);
|
gsk_gpu_print_image_descriptor (string, shader->desc, instance->tex_id);
|
||||||
gsk_gpu_print_newline (string);
|
gsk_gpu_print_newline (string);
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ gsk_gpu_border_op_print (GskGpuOp *op,
|
|||||||
instance = (GskGpuBorderInstance *) gsk_gpu_frame_get_vertex_data (frame, shader->vertex_offset);
|
instance = (GskGpuBorderInstance *) gsk_gpu_frame_get_vertex_data (frame, shader->vertex_offset);
|
||||||
|
|
||||||
gsk_gpu_print_op (string, indent, "border");
|
gsk_gpu_print_op (string, indent, "border");
|
||||||
|
gsk_gpu_print_shader_info (string, shader->clip);
|
||||||
gsk_gpu_print_rounded_rect (string, instance->outline);
|
gsk_gpu_print_rounded_rect (string, instance->outline);
|
||||||
|
|
||||||
gsk_gpu_print_rgba (string, (const float *) &instance->border_colors[0]);
|
gsk_gpu_print_rgba (string, (const float *) &instance->border_colors[0]);
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ gsk_gpu_box_shadow_op_print (GskGpuOp *op,
|
|||||||
instance = (GskGpuBoxshadowInstance *) gsk_gpu_frame_get_vertex_data (frame, shader->vertex_offset);
|
instance = (GskGpuBoxshadowInstance *) gsk_gpu_frame_get_vertex_data (frame, shader->vertex_offset);
|
||||||
|
|
||||||
gsk_gpu_print_op (string, indent, shader->variation & VARIATION_INSET ? "inset-shadow" : "outset-shadow");
|
gsk_gpu_print_op (string, indent, shader->variation & VARIATION_INSET ? "inset-shadow" : "outset-shadow");
|
||||||
|
gsk_gpu_print_shader_info (string, shader->clip);
|
||||||
gsk_gpu_print_rounded_rect (string, instance->outline);
|
gsk_gpu_print_rounded_rect (string, instance->outline);
|
||||||
gsk_gpu_print_rgba (string, instance->color);
|
gsk_gpu_print_rgba (string, instance->color);
|
||||||
g_string_append_printf (string, "%g %g %g %g ",
|
g_string_append_printf (string, "%g %g %g %g ",
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ gsk_gpu_colorize_op_print (GskGpuOp *op,
|
|||||||
instance = (GskGpuColorizeInstance *) gsk_gpu_frame_get_vertex_data (frame, shader->vertex_offset);
|
instance = (GskGpuColorizeInstance *) gsk_gpu_frame_get_vertex_data (frame, shader->vertex_offset);
|
||||||
|
|
||||||
gsk_gpu_print_op (string, indent, "colorize");
|
gsk_gpu_print_op (string, indent, "colorize");
|
||||||
|
gsk_gpu_print_shader_info (string, shader->clip);
|
||||||
gsk_gpu_print_rect (string, instance->rect);
|
gsk_gpu_print_rect (string, instance->rect);
|
||||||
gsk_gpu_print_image_descriptor (string, shader->desc, instance->tex_id);
|
gsk_gpu_print_image_descriptor (string, shader->desc, instance->tex_id);
|
||||||
gsk_gpu_print_rgba (string, instance->color);
|
gsk_gpu_print_rgba (string, instance->color);
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ gsk_gpu_color_matrix_op_print (GskGpuOp *op,
|
|||||||
instance = (GskGpuColormatrixInstance *) gsk_gpu_frame_get_vertex_data (frame, shader->vertex_offset);
|
instance = (GskGpuColormatrixInstance *) gsk_gpu_frame_get_vertex_data (frame, shader->vertex_offset);
|
||||||
|
|
||||||
gsk_gpu_print_op (string, indent, "color-matrix");
|
gsk_gpu_print_op (string, indent, "color-matrix");
|
||||||
|
gsk_gpu_print_shader_info (string, shader->clip);
|
||||||
gsk_gpu_print_rect (string, instance->rect);
|
gsk_gpu_print_rect (string, instance->rect);
|
||||||
gsk_gpu_print_image_descriptor (string, shader->desc, instance->tex_id);
|
gsk_gpu_print_image_descriptor (string, shader->desc, instance->tex_id);
|
||||||
gsk_gpu_print_newline (string);
|
gsk_gpu_print_newline (string);
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ gsk_gpu_color_op_print (GskGpuOp *op,
|
|||||||
instance = (GskGpuColorInstance *) gsk_gpu_frame_get_vertex_data (frame, shader->vertex_offset);
|
instance = (GskGpuColorInstance *) gsk_gpu_frame_get_vertex_data (frame, shader->vertex_offset);
|
||||||
|
|
||||||
gsk_gpu_print_op (string, indent, "color");
|
gsk_gpu_print_op (string, indent, "color");
|
||||||
|
gsk_gpu_print_shader_info (string, shader->clip);
|
||||||
gsk_gpu_print_rect (string, instance->rect);
|
gsk_gpu_print_rect (string, instance->rect);
|
||||||
gsk_gpu_print_rgba (string, instance->color);
|
gsk_gpu_print_rgba (string, instance->color);
|
||||||
gsk_gpu_print_newline (string);
|
gsk_gpu_print_newline (string);
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ gsk_gpu_conic_gradient_op_print (GskGpuOp *op,
|
|||||||
instance = (GskGpuConicgradientInstance *) gsk_gpu_frame_get_vertex_data (frame, shader->vertex_offset);
|
instance = (GskGpuConicgradientInstance *) gsk_gpu_frame_get_vertex_data (frame, shader->vertex_offset);
|
||||||
|
|
||||||
gsk_gpu_print_op (string, indent, "conic-gradient");
|
gsk_gpu_print_op (string, indent, "conic-gradient");
|
||||||
|
gsk_gpu_print_shader_info (string, shader->clip);
|
||||||
gsk_gpu_print_rect (string, instance->rect);
|
gsk_gpu_print_rect (string, instance->rect);
|
||||||
gsk_gpu_print_newline (string);
|
gsk_gpu_print_newline (string);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ gsk_gpu_cross_fade_op_print (GskGpuOp *op,
|
|||||||
instance = (GskGpuCrossfadeInstance *) gsk_gpu_frame_get_vertex_data (frame, shader->vertex_offset);
|
instance = (GskGpuCrossfadeInstance *) gsk_gpu_frame_get_vertex_data (frame, shader->vertex_offset);
|
||||||
|
|
||||||
gsk_gpu_print_op (string, indent, "cross-fade");
|
gsk_gpu_print_op (string, indent, "cross-fade");
|
||||||
|
gsk_gpu_print_shader_info (string, shader->clip);
|
||||||
gsk_gpu_print_rect (string, instance->rect);
|
gsk_gpu_print_rect (string, instance->rect);
|
||||||
gsk_gpu_print_image_descriptor (string, shader->desc, instance->start_id);
|
gsk_gpu_print_image_descriptor (string, shader->desc, instance->start_id);
|
||||||
gsk_gpu_print_image_descriptor (string, shader->desc, instance->end_id);
|
gsk_gpu_print_image_descriptor (string, shader->desc, instance->end_id);
|
||||||
|
|||||||
+450
-100
@@ -3,10 +3,15 @@
|
|||||||
#include "gskgpudeviceprivate.h"
|
#include "gskgpudeviceprivate.h"
|
||||||
|
|
||||||
#include "gskgpuframeprivate.h"
|
#include "gskgpuframeprivate.h"
|
||||||
|
#include "gskgpuimageprivate.h"
|
||||||
#include "gskgpuuploadopprivate.h"
|
#include "gskgpuuploadopprivate.h"
|
||||||
|
|
||||||
#include "gdk/gdkdisplayprivate.h"
|
#include "gdk/gdkdisplayprivate.h"
|
||||||
#include "gdk/gdktextureprivate.h"
|
#include "gdk/gdktextureprivate.h"
|
||||||
|
#include "gdk/gdkprofilerprivate.h"
|
||||||
|
|
||||||
|
#include "gsk/gskdebugprivate.h"
|
||||||
|
#include "gsk/gskprivate.h"
|
||||||
|
|
||||||
#define MAX_SLICES_PER_ATLAS 64
|
#define MAX_SLICES_PER_ATLAS 64
|
||||||
|
|
||||||
@@ -14,6 +19,13 @@
|
|||||||
|
|
||||||
#define MAX_ATLAS_ITEM_SIZE 256
|
#define MAX_ATLAS_ITEM_SIZE 256
|
||||||
|
|
||||||
|
#define MAX_DEAD_PIXELS (ATLAS_SIZE * ATLAS_SIZE / 2)
|
||||||
|
|
||||||
|
#define CACHE_TIMEOUT 15 /* seconds */
|
||||||
|
|
||||||
|
G_STATIC_ASSERT (MAX_ATLAS_ITEM_SIZE < ATLAS_SIZE);
|
||||||
|
G_STATIC_ASSERT (MAX_DEAD_PIXELS < ATLAS_SIZE * ATLAS_SIZE);
|
||||||
|
|
||||||
typedef struct _GskGpuCached GskGpuCached;
|
typedef struct _GskGpuCached GskGpuCached;
|
||||||
typedef struct _GskGpuCachedClass GskGpuCachedClass;
|
typedef struct _GskGpuCachedClass GskGpuCachedClass;
|
||||||
typedef struct _GskGpuCachedAtlas GskGpuCachedAtlas;
|
typedef struct _GskGpuCachedAtlas GskGpuCachedAtlas;
|
||||||
@@ -21,6 +33,37 @@ typedef struct _GskGpuCachedGlyph GskGpuCachedGlyph;
|
|||||||
typedef struct _GskGpuCachedTexture GskGpuCachedTexture;
|
typedef struct _GskGpuCachedTexture GskGpuCachedTexture;
|
||||||
typedef struct _GskGpuDevicePrivate GskGpuDevicePrivate;
|
typedef struct _GskGpuDevicePrivate GskGpuDevicePrivate;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
PangoFont *font;
|
||||||
|
float scale;
|
||||||
|
} FontCacheKey;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
PangoGlyph glyph;
|
||||||
|
GskGpuGlyphLookupFlags flags;
|
||||||
|
} GlyphCacheKey;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
FontCacheKey key;
|
||||||
|
|
||||||
|
GHashTable *cache;
|
||||||
|
} FontGlyphCache;
|
||||||
|
|
||||||
|
static void
|
||||||
|
font_glyph_cache_free (gpointer data)
|
||||||
|
{
|
||||||
|
FontGlyphCache *cache = data;
|
||||||
|
|
||||||
|
g_object_unref (cache->key.font);
|
||||||
|
g_hash_table_unref (cache->cache);
|
||||||
|
g_free (cache);
|
||||||
|
}
|
||||||
|
|
||||||
|
static FontGlyphCache no_font_cache = {
|
||||||
|
.key = { .font = NULL, .scale = -1 },
|
||||||
|
.cache = NULL
|
||||||
|
};
|
||||||
|
|
||||||
struct _GskGpuDevicePrivate
|
struct _GskGpuDevicePrivate
|
||||||
{
|
{
|
||||||
GdkDisplay *display;
|
GdkDisplay *display;
|
||||||
@@ -29,11 +72,15 @@ struct _GskGpuDevicePrivate
|
|||||||
GskGpuCached *first_cached;
|
GskGpuCached *first_cached;
|
||||||
GskGpuCached *last_cached;
|
GskGpuCached *last_cached;
|
||||||
guint cache_gc_source;
|
guint cache_gc_source;
|
||||||
|
int cache_timeout; /* in seconds, or -1 to disable gc */
|
||||||
|
|
||||||
GHashTable *texture_cache;
|
GHashTable *texture_cache;
|
||||||
GHashTable *glyph_cache;
|
GHashTable *glyph_cache;
|
||||||
|
FontGlyphCache *last_font_cache;
|
||||||
|
|
||||||
GskGpuCachedAtlas *current_atlas;
|
GskGpuCachedAtlas *current_atlas;
|
||||||
|
|
||||||
|
/* atomic */ gsize dead_texture_pixels;
|
||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_PRIVATE (GskGpuDevice, gsk_gpu_device, G_TYPE_OBJECT)
|
G_DEFINE_TYPE_WITH_PRIVATE (GskGpuDevice, gsk_gpu_device, G_TYPE_OBJECT)
|
||||||
@@ -54,12 +101,35 @@ struct _GskGpuCachedClass
|
|||||||
struct _GskGpuCached
|
struct _GskGpuCached
|
||||||
{
|
{
|
||||||
const GskGpuCachedClass *class;
|
const GskGpuCachedClass *class;
|
||||||
|
|
||||||
GskGpuCachedAtlas *atlas;
|
GskGpuCachedAtlas *atlas;
|
||||||
GskGpuCached *next;
|
GskGpuCached *next;
|
||||||
GskGpuCached *prev;
|
GskGpuCached *prev;
|
||||||
|
|
||||||
|
gint64 timestamp;
|
||||||
|
|
||||||
|
unsigned int stale : 1;
|
||||||
|
unsigned int pixels : 31; /* For glyphs and textures, pixels. For atlases, dead pixels */
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
mark_as_stale (GskGpuCached *cached,
|
||||||
|
gboolean stale)
|
||||||
|
{
|
||||||
|
if (cached->stale != stale)
|
||||||
|
{
|
||||||
|
cached->stale = stale;
|
||||||
|
|
||||||
|
if (cached->atlas)
|
||||||
|
{
|
||||||
|
if (stale)
|
||||||
|
((GskGpuCached *) cached->atlas)->pixels += cached->pixels;
|
||||||
|
else
|
||||||
|
((GskGpuCached *) cached->atlas)->pixels -= cached->pixels;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gsk_gpu_cached_free (GskGpuDevice *device,
|
gsk_gpu_cached_free (GskGpuDevice *device,
|
||||||
GskGpuCached *cached)
|
GskGpuCached *cached)
|
||||||
@@ -75,6 +145,8 @@ gsk_gpu_cached_free (GskGpuDevice *device,
|
|||||||
else
|
else
|
||||||
priv->first_cached = cached->next;
|
priv->first_cached = cached->next;
|
||||||
|
|
||||||
|
mark_as_stale (cached, TRUE);
|
||||||
|
|
||||||
cached->class->free (device, cached);
|
cached->class->free (device, cached);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,7 +186,21 @@ gsk_gpu_cached_use (GskGpuDevice *device,
|
|||||||
GskGpuCached *cached,
|
GskGpuCached *cached,
|
||||||
gint64 timestamp)
|
gint64 timestamp)
|
||||||
{
|
{
|
||||||
/* FIXME */
|
cached->timestamp = timestamp;
|
||||||
|
mark_as_stale (cached, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline gboolean
|
||||||
|
gsk_gpu_cached_is_old (GskGpuDevice *device,
|
||||||
|
GskGpuCached *cached,
|
||||||
|
gint64 timestamp)
|
||||||
|
{
|
||||||
|
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (device);
|
||||||
|
|
||||||
|
if (priv->cache_timeout < 0)
|
||||||
|
return FALSE;
|
||||||
|
else
|
||||||
|
return timestamp - cached->timestamp > priv->cache_timeout * G_TIME_SPAN_SECOND;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* }}} */
|
/* }}} */
|
||||||
@@ -137,10 +223,23 @@ static void
|
|||||||
gsk_gpu_cached_atlas_free (GskGpuDevice *device,
|
gsk_gpu_cached_atlas_free (GskGpuDevice *device,
|
||||||
GskGpuCached *cached)
|
GskGpuCached *cached)
|
||||||
{
|
{
|
||||||
|
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (device);
|
||||||
GskGpuCachedAtlas *self = (GskGpuCachedAtlas *) cached;
|
GskGpuCachedAtlas *self = (GskGpuCachedAtlas *) cached;
|
||||||
|
GskGpuCached *c, *next;
|
||||||
|
|
||||||
|
/* Free all remaining glyphs on this atlas */
|
||||||
|
for (c = priv->first_cached; c != NULL; c = next)
|
||||||
|
{
|
||||||
|
next = c->next;
|
||||||
|
if (c->atlas == self)
|
||||||
|
gsk_gpu_cached_free (device, c);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (priv->current_atlas == self)
|
||||||
|
priv->current_atlas = NULL;
|
||||||
|
|
||||||
g_object_unref (self->image);
|
g_object_unref (self->image);
|
||||||
|
|
||||||
g_free (self);
|
g_free (self);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,8 +248,7 @@ gsk_gpu_cached_atlas_should_collect (GskGpuDevice *device,
|
|||||||
GskGpuCached *cached,
|
GskGpuCached *cached,
|
||||||
gint64 timestamp)
|
gint64 timestamp)
|
||||||
{
|
{
|
||||||
/* FIXME */
|
return cached->pixels > MAX_DEAD_PIXELS;
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const GskGpuCachedClass GSK_GPU_CACHED_ATLAS_CLASS =
|
static const GskGpuCachedClass GSK_GPU_CACHED_ATLAS_CLASS =
|
||||||
@@ -178,7 +276,14 @@ struct _GskGpuCachedTexture
|
|||||||
{
|
{
|
||||||
GskGpuCached parent;
|
GskGpuCached parent;
|
||||||
|
|
||||||
/* atomic */ GdkTexture *texture;
|
/* atomic */ int use_count; /* We count the use by the device (via the linked
|
||||||
|
* list) and by the texture (via render data or
|
||||||
|
* weak ref.
|
||||||
|
*/
|
||||||
|
|
||||||
|
gsize *dead_pixels_counter;
|
||||||
|
|
||||||
|
GdkTexture *texture;
|
||||||
GskGpuImage *image;
|
GskGpuImage *image;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -186,14 +291,37 @@ static void
|
|||||||
gsk_gpu_cached_texture_free (GskGpuDevice *device,
|
gsk_gpu_cached_texture_free (GskGpuDevice *device,
|
||||||
GskGpuCached *cached)
|
GskGpuCached *cached)
|
||||||
{
|
{
|
||||||
|
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (device);
|
||||||
GskGpuCachedTexture *self = (GskGpuCachedTexture *) cached;
|
GskGpuCachedTexture *self = (GskGpuCachedTexture *) cached;
|
||||||
gboolean texture_still_alive;
|
gpointer key, value;
|
||||||
|
|
||||||
texture_still_alive = g_atomic_pointer_exchange (&self->texture, NULL) != NULL;
|
g_clear_object (&self->image);
|
||||||
g_object_unref (self->image);
|
|
||||||
|
if (g_hash_table_steal_extended (priv->texture_cache, self->texture, &key, &value))
|
||||||
if (!texture_still_alive)
|
{
|
||||||
g_free (self);
|
/* If the texture has been reused already, we put the entry back */
|
||||||
|
if ((GskGpuCached *) value != cached)
|
||||||
|
g_hash_table_insert (priv->texture_cache, key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If the cached item itself is still in use by the texture, we leave
|
||||||
|
* it to the weak ref or render data to free it.
|
||||||
|
*/
|
||||||
|
if (g_atomic_int_dec_and_test (&self->use_count))
|
||||||
|
{
|
||||||
|
g_free (self);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline gboolean
|
||||||
|
gsk_gpu_cached_texture_is_invalid (GskGpuCachedTexture *self)
|
||||||
|
{
|
||||||
|
/* If the use count is less than 2, the orignal texture has died,
|
||||||
|
* and the memory may have been reused for a new texture, so we
|
||||||
|
* can't hand out the image that is for the original texture.
|
||||||
|
*/
|
||||||
|
return g_atomic_int_get (&self->use_count) < 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@@ -201,8 +329,10 @@ gsk_gpu_cached_texture_should_collect (GskGpuDevice *device,
|
|||||||
GskGpuCached *cached,
|
GskGpuCached *cached,
|
||||||
gint64 timestamp)
|
gint64 timestamp)
|
||||||
{
|
{
|
||||||
/* FIXME */
|
GskGpuCachedTexture *self = (GskGpuCachedTexture *) cached;
|
||||||
return FALSE;
|
|
||||||
|
return gsk_gpu_cached_is_old (device, cached, timestamp) ||
|
||||||
|
gsk_gpu_cached_texture_is_invalid (self);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const GskGpuCachedClass GSK_GPU_CACHED_TEXTURE_CLASS =
|
static const GskGpuCachedClass GSK_GPU_CACHED_TEXTURE_CLASS =
|
||||||
@@ -212,16 +342,19 @@ static const GskGpuCachedClass GSK_GPU_CACHED_TEXTURE_CLASS =
|
|||||||
gsk_gpu_cached_texture_should_collect
|
gsk_gpu_cached_texture_should_collect
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Note: this function can run in an arbitrary thread, so it can
|
||||||
|
* only access things atomically
|
||||||
|
*/
|
||||||
static void
|
static void
|
||||||
gsk_gpu_cached_texture_destroy_cb (gpointer data)
|
gsk_gpu_cached_texture_destroy_cb (gpointer data)
|
||||||
{
|
{
|
||||||
GskGpuCachedTexture *cache = data;
|
GskGpuCachedTexture *self = data;
|
||||||
gboolean cache_still_alive;
|
|
||||||
|
|
||||||
cache_still_alive = g_atomic_pointer_exchange (&cache->texture, NULL) != NULL;
|
if (!gsk_gpu_cached_texture_is_invalid (self))
|
||||||
|
g_atomic_pointer_add (self->dead_pixels_counter, ((GskGpuCached *) self)->pixels);
|
||||||
|
|
||||||
if (!cache_still_alive)
|
if (g_atomic_int_dec_and_test (&self->use_count))
|
||||||
g_free (cache);
|
g_free (self);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GskGpuCachedTexture *
|
static GskGpuCachedTexture *
|
||||||
@@ -235,18 +368,19 @@ gsk_gpu_cached_texture_new (GskGpuDevice *device,
|
|||||||
if (gdk_texture_get_render_data (texture, device))
|
if (gdk_texture_get_render_data (texture, device))
|
||||||
gdk_texture_clear_render_data (texture);
|
gdk_texture_clear_render_data (texture);
|
||||||
else if ((self = g_hash_table_lookup (priv->texture_cache, texture)))
|
else if ((self = g_hash_table_lookup (priv->texture_cache, texture)))
|
||||||
{
|
g_hash_table_remove (priv->texture_cache, texture);
|
||||||
g_hash_table_remove (priv->texture_cache, texture);
|
|
||||||
g_object_weak_unref (G_OBJECT (texture), (GWeakNotify) gsk_gpu_cached_texture_destroy_cb, self);
|
|
||||||
}
|
|
||||||
|
|
||||||
self = gsk_gpu_cached_new (device, &GSK_GPU_CACHED_TEXTURE_CLASS, NULL);
|
self = gsk_gpu_cached_new (device, &GSK_GPU_CACHED_TEXTURE_CLASS, NULL);
|
||||||
self->texture = texture;
|
self->texture = texture;
|
||||||
self->image = g_object_ref (image);
|
self->image = g_object_ref (image);
|
||||||
|
((GskGpuCached *)self)->pixels = gsk_gpu_image_get_width (image) * gsk_gpu_image_get_height (image);
|
||||||
|
self->dead_pixels_counter = &priv->dead_texture_pixels;
|
||||||
|
self->use_count = 2;
|
||||||
|
|
||||||
if (!gdk_texture_set_render_data (texture, device, self, gsk_gpu_cached_texture_destroy_cb))
|
if (!gdk_texture_set_render_data (texture, device, self, gsk_gpu_cached_texture_destroy_cb))
|
||||||
{
|
{
|
||||||
g_object_weak_ref (G_OBJECT (texture), (GWeakNotify) gsk_gpu_cached_texture_destroy_cb, self);
|
g_object_weak_ref (G_OBJECT (texture), (GWeakNotify) gsk_gpu_cached_texture_destroy_cb, self);
|
||||||
|
|
||||||
g_hash_table_insert (priv->texture_cache, texture, self);
|
g_hash_table_insert (priv->texture_cache, texture, self);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,10 +394,8 @@ struct _GskGpuCachedGlyph
|
|||||||
{
|
{
|
||||||
GskGpuCached parent;
|
GskGpuCached parent;
|
||||||
|
|
||||||
PangoFont *font;
|
FontGlyphCache *font_cache;
|
||||||
PangoGlyph glyph;
|
GlyphCacheKey glyph_key;
|
||||||
GskGpuGlyphLookupFlags flags;
|
|
||||||
float scale;
|
|
||||||
|
|
||||||
GskGpuImage *image;
|
GskGpuImage *image;
|
||||||
graphene_rect_t bounds;
|
graphene_rect_t bounds;
|
||||||
@@ -274,9 +406,19 @@ static void
|
|||||||
gsk_gpu_cached_glyph_free (GskGpuDevice *device,
|
gsk_gpu_cached_glyph_free (GskGpuDevice *device,
|
||||||
GskGpuCached *cached)
|
GskGpuCached *cached)
|
||||||
{
|
{
|
||||||
|
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (device);
|
||||||
GskGpuCachedGlyph *self = (GskGpuCachedGlyph *) cached;
|
GskGpuCachedGlyph *self = (GskGpuCachedGlyph *) cached;
|
||||||
|
FontGlyphCache *font_cache;
|
||||||
|
|
||||||
|
font_cache = self->font_cache;
|
||||||
|
g_hash_table_remove (font_cache->cache, self);
|
||||||
|
if (g_hash_table_size (font_cache->cache) == 0)
|
||||||
|
{
|
||||||
|
if (priv->last_font_cache == font_cache)
|
||||||
|
priv->last_font_cache = &no_font_cache;
|
||||||
|
g_hash_table_remove (priv->glyph_cache, font_cache);
|
||||||
|
}
|
||||||
|
|
||||||
g_object_unref (self->font);
|
|
||||||
g_object_unref (self->image);
|
g_object_unref (self->image);
|
||||||
|
|
||||||
g_free (self);
|
g_free (self);
|
||||||
@@ -287,19 +429,47 @@ gsk_gpu_cached_glyph_should_collect (GskGpuDevice *device,
|
|||||||
GskGpuCached *cached,
|
GskGpuCached *cached,
|
||||||
gint64 timestamp)
|
gint64 timestamp)
|
||||||
{
|
{
|
||||||
/* FIXME */
|
if (gsk_gpu_cached_is_old (device, cached, timestamp))
|
||||||
|
{
|
||||||
|
if (cached->atlas)
|
||||||
|
mark_as_stale (cached, TRUE);
|
||||||
|
else
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Glyphs are only collected when their atlas is freed */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static guint
|
||||||
|
gsk_gpu_cached_font_hash (gconstpointer data)
|
||||||
|
{
|
||||||
|
const FontGlyphCache *cache = data;
|
||||||
|
const FontCacheKey *key = &cache->key;
|
||||||
|
|
||||||
|
return GPOINTER_TO_UINT (key->font) ^ ((guint) key->scale * PANGO_SCALE);
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
gsk_gpu_cached_font_equal (gconstpointer v1,
|
||||||
|
gconstpointer v2)
|
||||||
|
{
|
||||||
|
const FontGlyphCache *c1 = v1;
|
||||||
|
const FontCacheKey *key1 = &c1->key;
|
||||||
|
const FontGlyphCache *c2 = v2;
|
||||||
|
const FontCacheKey *key2 = &c2->key;
|
||||||
|
|
||||||
|
return key1->font == key2->font &&
|
||||||
|
key1->scale == key2->scale;
|
||||||
|
}
|
||||||
|
|
||||||
static guint
|
static guint
|
||||||
gsk_gpu_cached_glyph_hash (gconstpointer data)
|
gsk_gpu_cached_glyph_hash (gconstpointer data)
|
||||||
{
|
{
|
||||||
const GskGpuCachedGlyph *glyph = data;
|
const GskGpuCachedGlyph *glyph = data;
|
||||||
|
const GlyphCacheKey *key = &glyph->glyph_key;
|
||||||
|
|
||||||
return GPOINTER_TO_UINT (glyph->font) ^
|
return key->glyph ^ (key->flags << 24);
|
||||||
glyph->glyph ^
|
|
||||||
(glyph->flags << 24) ^
|
|
||||||
((guint) glyph->scale * PANGO_SCALE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@@ -308,11 +478,11 @@ gsk_gpu_cached_glyph_equal (gconstpointer v1,
|
|||||||
{
|
{
|
||||||
const GskGpuCachedGlyph *glyph1 = v1;
|
const GskGpuCachedGlyph *glyph1 = v1;
|
||||||
const GskGpuCachedGlyph *glyph2 = v2;
|
const GskGpuCachedGlyph *glyph2 = v2;
|
||||||
|
const GlyphCacheKey *key1 = &glyph1->glyph_key;
|
||||||
|
const GlyphCacheKey *key2 = &glyph2->glyph_key;
|
||||||
|
|
||||||
return glyph1->font == glyph2->font
|
return key1->glyph == key2->glyph &&
|
||||||
&& glyph1->glyph == glyph2->glyph
|
key1->flags == key2->flags;
|
||||||
&& glyph1->flags == glyph2->flags
|
|
||||||
&& glyph1->scale == glyph2->scale;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const GskGpuCachedClass GSK_GPU_CACHED_GLYPH_CLASS =
|
static const GskGpuCachedClass GSK_GPU_CACHED_GLYPH_CLASS =
|
||||||
@@ -325,19 +495,127 @@ static const GskGpuCachedClass GSK_GPU_CACHED_GLYPH_CLASS =
|
|||||||
/* }}} */
|
/* }}} */
|
||||||
/* {{{ GskGpuDevice */
|
/* {{{ GskGpuDevice */
|
||||||
|
|
||||||
void
|
static void
|
||||||
|
print_cache_stats (GskGpuDevice *self)
|
||||||
|
{
|
||||||
|
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
|
||||||
|
GskGpuCached *cached;
|
||||||
|
guint glyphs = 0;
|
||||||
|
guint stale_glyphs = 0;
|
||||||
|
guint textures = 0;
|
||||||
|
guint atlases = 0;
|
||||||
|
GString *ratios = g_string_new ("");
|
||||||
|
|
||||||
|
for (cached = priv->first_cached; cached != NULL; cached = cached->next)
|
||||||
|
{
|
||||||
|
if (cached->class == &GSK_GPU_CACHED_GLYPH_CLASS)
|
||||||
|
{
|
||||||
|
glyphs++;
|
||||||
|
if (cached->stale)
|
||||||
|
stale_glyphs++;
|
||||||
|
}
|
||||||
|
else if (cached->class == &GSK_GPU_CACHED_TEXTURE_CLASS)
|
||||||
|
{
|
||||||
|
textures++;
|
||||||
|
}
|
||||||
|
else if (cached->class == &GSK_GPU_CACHED_ATLAS_CLASS)
|
||||||
|
{
|
||||||
|
double ratio;
|
||||||
|
|
||||||
|
atlases++;
|
||||||
|
|
||||||
|
ratio = (double) cached->pixels / (double) (ATLAS_SIZE * ATLAS_SIZE);
|
||||||
|
|
||||||
|
if (ratios->len == 0)
|
||||||
|
g_string_append (ratios, " (ratios ");
|
||||||
|
else
|
||||||
|
g_string_append (ratios, ", ");
|
||||||
|
g_string_append_printf (ratios, "%.2f", ratio);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ratios->len > 0)
|
||||||
|
g_string_append (ratios, ")");
|
||||||
|
|
||||||
|
gdk_debug_message ("Cached items\n"
|
||||||
|
" glyphs: %5u (%u stale)\n"
|
||||||
|
" textures: %5u (%u in hash)\n"
|
||||||
|
" atlases: %5u%s",
|
||||||
|
glyphs, stale_glyphs,
|
||||||
|
textures, g_hash_table_size (priv->texture_cache),
|
||||||
|
atlases, ratios->str);
|
||||||
|
|
||||||
|
g_string_free (ratios, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
gsk_gpu_device_gc (GskGpuDevice *self,
|
gsk_gpu_device_gc (GskGpuDevice *self,
|
||||||
gint64 timestamp)
|
gint64 timestamp)
|
||||||
{
|
{
|
||||||
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
|
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
|
||||||
GskGpuCached *cached, *next;
|
GskGpuCached *cached, *prev;
|
||||||
|
gint64 before G_GNUC_UNUSED = GDK_PROFILER_CURRENT_TIME;
|
||||||
|
|
||||||
for (cached = priv->first_cached; cached != NULL; cached = next)
|
gsk_gpu_device_make_current (self);
|
||||||
|
|
||||||
|
/* We walk the cache from the end so we don't end up with prev
|
||||||
|
* being a leftover glyph on the atlas we are freeing
|
||||||
|
*/
|
||||||
|
for (cached = priv->last_cached; cached != NULL; cached = prev)
|
||||||
{
|
{
|
||||||
next = cached->next;
|
prev = cached->prev;
|
||||||
if (gsk_gpu_cached_should_collect (self, cached, timestamp))
|
if (gsk_gpu_cached_should_collect (self, cached, timestamp))
|
||||||
gsk_gpu_cached_free (self, cached);
|
gsk_gpu_cached_free (self, cached);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_atomic_pointer_set (&priv->dead_texture_pixels, 0);
|
||||||
|
|
||||||
|
if (GSK_DEBUG_CHECK (GLYPH_CACHE))
|
||||||
|
print_cache_stats (self);
|
||||||
|
|
||||||
|
gdk_profiler_end_mark (before, "Glyph cache GC", NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
cache_gc_cb (gpointer data)
|
||||||
|
{
|
||||||
|
GskGpuDevice *self = data;
|
||||||
|
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
|
||||||
|
|
||||||
|
GSK_DEBUG (GLYPH_CACHE, "Periodic GC");
|
||||||
|
|
||||||
|
gsk_gpu_device_gc (self, g_get_monotonic_time ());
|
||||||
|
|
||||||
|
priv->cache_gc_source = 0;
|
||||||
|
|
||||||
|
return G_SOURCE_REMOVE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gsk_gpu_device_maybe_gc (GskGpuDevice *self)
|
||||||
|
{
|
||||||
|
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
|
||||||
|
gsize dead_texture_pixels;
|
||||||
|
|
||||||
|
if (priv->cache_timeout < 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
dead_texture_pixels = GPOINTER_TO_SIZE (g_atomic_pointer_get (&priv->dead_texture_pixels));
|
||||||
|
|
||||||
|
if (priv->cache_timeout == 0 || dead_texture_pixels > 1000000)
|
||||||
|
{
|
||||||
|
GSK_DEBUG (GLYPH_CACHE, "Pre-frame GC (%lu dead pixels)", dead_texture_pixels);
|
||||||
|
gsk_gpu_device_gc (self, g_get_monotonic_time ());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gsk_gpu_device_queue_gc (GskGpuDevice *self)
|
||||||
|
{
|
||||||
|
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
|
||||||
|
|
||||||
|
if (priv->cache_timeout > 0 && !priv->cache_gc_source)
|
||||||
|
priv->cache_gc_source = g_timeout_add_seconds (priv->cache_timeout, cache_gc_cb, self);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -357,8 +635,9 @@ gsk_gpu_device_clear_cache (GskGpuDevice *self)
|
|||||||
g_assert (cached->next->prev == cached);
|
g_assert (cached->next->prev == cached);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (priv->first_cached)
|
/* We clear the cache from the end so glyphs get freed before their atlas */
|
||||||
gsk_gpu_cached_free (self, priv->first_cached);
|
while (priv->last_cached)
|
||||||
|
gsk_gpu_cached_free (self, priv->last_cached);
|
||||||
|
|
||||||
g_assert (priv->last_cached == NULL);
|
g_assert (priv->last_cached == NULL);
|
||||||
}
|
}
|
||||||
@@ -372,6 +651,7 @@ gsk_gpu_device_dispose (GObject *object)
|
|||||||
gsk_gpu_device_clear_cache (self);
|
gsk_gpu_device_clear_cache (self);
|
||||||
g_hash_table_unref (priv->glyph_cache);
|
g_hash_table_unref (priv->glyph_cache);
|
||||||
g_hash_table_unref (priv->texture_cache);
|
g_hash_table_unref (priv->texture_cache);
|
||||||
|
g_clear_handle_id (&priv->cache_gc_source, g_source_remove);
|
||||||
|
|
||||||
G_OBJECT_CLASS (gsk_gpu_device_parent_class)->dispose (object);
|
G_OBJECT_CLASS (gsk_gpu_device_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
@@ -401,10 +681,13 @@ gsk_gpu_device_init (GskGpuDevice *self)
|
|||||||
{
|
{
|
||||||
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
|
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
|
||||||
|
|
||||||
priv->glyph_cache = g_hash_table_new (gsk_gpu_cached_glyph_hash,
|
priv->glyph_cache = g_hash_table_new_full (gsk_gpu_cached_font_hash,
|
||||||
gsk_gpu_cached_glyph_equal);
|
gsk_gpu_cached_font_equal,
|
||||||
|
NULL,
|
||||||
|
font_glyph_cache_free);
|
||||||
priv->texture_cache = g_hash_table_new (g_direct_hash,
|
priv->texture_cache = g_hash_table_new (g_direct_hash,
|
||||||
g_direct_equal);
|
g_direct_equal);
|
||||||
|
priv->last_font_cache = &no_font_cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -413,9 +696,38 @@ gsk_gpu_device_setup (GskGpuDevice *self,
|
|||||||
gsize max_image_size)
|
gsize max_image_size)
|
||||||
{
|
{
|
||||||
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
|
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
|
||||||
|
const char *str;
|
||||||
|
|
||||||
priv->display = g_object_ref (display);
|
priv->display = g_object_ref (display);
|
||||||
priv->max_image_size = max_image_size;
|
priv->max_image_size = max_image_size;
|
||||||
|
priv->cache_timeout = CACHE_TIMEOUT;
|
||||||
|
|
||||||
|
str = g_getenv ("GSK_CACHE_TIMEOUT");
|
||||||
|
if (str != NULL)
|
||||||
|
{
|
||||||
|
gint64 value;
|
||||||
|
GError *error = NULL;
|
||||||
|
|
||||||
|
if (!g_ascii_string_to_signed (str, 10, -1, G_MAXINT, &value, &error))
|
||||||
|
{
|
||||||
|
g_warning ("Failed to parse GSK_CACHE_TIMEOUT: %s", error->message);
|
||||||
|
g_error_free (error);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
priv->cache_timeout = (int) value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GSK_DEBUG_CHECK (GLYPH_CACHE))
|
||||||
|
{
|
||||||
|
if (priv->cache_timeout < 0)
|
||||||
|
gdk_debug_message ("Cache GC disabled");
|
||||||
|
else if (priv->cache_timeout == 0)
|
||||||
|
gdk_debug_message ("Cache GC before every frame");
|
||||||
|
else
|
||||||
|
gdk_debug_message ("Cache GC timeout: %d seconds", priv->cache_timeout);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GdkDisplay *
|
GdkDisplay *
|
||||||
@@ -454,6 +766,12 @@ gsk_gpu_device_create_upload_image (GskGpuDevice *self,
|
|||||||
return GSK_GPU_DEVICE_GET_CLASS (self)->create_upload_image (self, with_mipmap, format, width, height);
|
return GSK_GPU_DEVICE_GET_CLASS (self)->create_upload_image (self, with_mipmap, format, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gsk_gpu_device_make_current (GskGpuDevice *self)
|
||||||
|
{
|
||||||
|
GSK_GPU_DEVICE_GET_CLASS (self)->make_current (self);
|
||||||
|
}
|
||||||
|
|
||||||
GskGpuImage *
|
GskGpuImage *
|
||||||
gsk_gpu_device_create_download_image (GskGpuDevice *self,
|
gsk_gpu_device_create_download_image (GskGpuDevice *self,
|
||||||
GdkMemoryDepth depth,
|
GdkMemoryDepth depth,
|
||||||
@@ -517,15 +835,21 @@ gsk_gpu_cached_atlas_allocate (GskGpuCachedAtlas *atlas,
|
|||||||
|
|
||||||
if (best_slice >= i && i == atlas->n_slices)
|
if (best_slice >= i && i == atlas->n_slices)
|
||||||
{
|
{
|
||||||
|
gsize slice_height;
|
||||||
|
|
||||||
if (!can_add_slice)
|
if (!can_add_slice)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
slice_height = round_up_atlas_size (MAX (height, 4));
|
||||||
|
if (slice_height > ATLAS_SIZE - y)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
atlas->n_slices++;
|
atlas->n_slices++;
|
||||||
if (atlas->n_slices == MAX_SLICES_PER_ATLAS)
|
if (atlas->n_slices == MAX_SLICES_PER_ATLAS)
|
||||||
atlas->slices[i].height = ATLAS_SIZE - y;
|
slice_height = ATLAS_SIZE - y;
|
||||||
else
|
|
||||||
atlas->slices[i].height = round_up_atlas_size (MAX (height, 4));
|
|
||||||
atlas->slices[i].width = 0;
|
atlas->slices[i].width = 0;
|
||||||
|
atlas->slices[i].height = slice_height;
|
||||||
best_y = y;
|
best_y = y;
|
||||||
best_slice = i;
|
best_slice = i;
|
||||||
}
|
}
|
||||||
@@ -541,8 +865,7 @@ gsk_gpu_cached_atlas_allocate (GskGpuCachedAtlas *atlas,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
gsk_gpu_device_ensure_atlas (GskGpuDevice *self,
|
gsk_gpu_device_ensure_atlas (GskGpuDevice *self,
|
||||||
gboolean recreate,
|
gboolean recreate)
|
||||||
gint64 timestamp)
|
|
||||||
{
|
{
|
||||||
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
|
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
|
||||||
|
|
||||||
@@ -557,14 +880,13 @@ gsk_gpu_device_get_atlas_image (GskGpuDevice *self)
|
|||||||
{
|
{
|
||||||
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
|
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
|
||||||
|
|
||||||
gsk_gpu_device_ensure_atlas (self, FALSE, g_get_monotonic_time ());
|
gsk_gpu_device_ensure_atlas (self, FALSE);
|
||||||
|
|
||||||
return priv->current_atlas->image;
|
return priv->current_atlas->image;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GskGpuImage *
|
static GskGpuImage *
|
||||||
gsk_gpu_device_add_atlas_image (GskGpuDevice *self,
|
gsk_gpu_device_add_atlas_image (GskGpuDevice *self,
|
||||||
gint64 timestamp,
|
|
||||||
gsize width,
|
gsize width,
|
||||||
gsize height,
|
gsize height,
|
||||||
gsize *out_x,
|
gsize *out_x,
|
||||||
@@ -575,21 +897,15 @@ gsk_gpu_device_add_atlas_image (GskGpuDevice *self,
|
|||||||
if (width > MAX_ATLAS_ITEM_SIZE || height > MAX_ATLAS_ITEM_SIZE)
|
if (width > MAX_ATLAS_ITEM_SIZE || height > MAX_ATLAS_ITEM_SIZE)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
gsk_gpu_device_ensure_atlas (self, FALSE, timestamp);
|
gsk_gpu_device_ensure_atlas (self, FALSE);
|
||||||
|
|
||||||
if (gsk_gpu_cached_atlas_allocate (priv->current_atlas, width, height, out_x, out_y))
|
|
||||||
{
|
|
||||||
gsk_gpu_cached_use (self, (GskGpuCached *) priv->current_atlas, timestamp);
|
|
||||||
return priv->current_atlas->image;
|
|
||||||
}
|
|
||||||
|
|
||||||
gsk_gpu_device_ensure_atlas (self, TRUE, timestamp);
|
|
||||||
|
|
||||||
if (gsk_gpu_cached_atlas_allocate (priv->current_atlas, width, height, out_x, out_y))
|
if (gsk_gpu_cached_atlas_allocate (priv->current_atlas, width, height, out_x, out_y))
|
||||||
{
|
return priv->current_atlas->image;
|
||||||
gsk_gpu_cached_use (self, (GskGpuCached *) priv->current_atlas, timestamp);
|
|
||||||
return priv->current_atlas->image;
|
gsk_gpu_device_ensure_atlas (self, TRUE);
|
||||||
}
|
|
||||||
|
if (gsk_gpu_cached_atlas_allocate (priv->current_atlas, width, height, out_x, out_y))
|
||||||
|
return priv->current_atlas->image;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -606,12 +922,12 @@ gsk_gpu_device_lookup_texture_image (GskGpuDevice *self,
|
|||||||
if (cache == NULL)
|
if (cache == NULL)
|
||||||
cache = g_hash_table_lookup (priv->texture_cache, texture);
|
cache = g_hash_table_lookup (priv->texture_cache, texture);
|
||||||
|
|
||||||
if (cache)
|
if (!cache || !cache->image || gsk_gpu_cached_texture_is_invalid (cache))
|
||||||
{
|
return NULL;
|
||||||
return g_object_ref (cache->image);
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
gsk_gpu_cached_use (self, (GskGpuCached *) cache, timestamp);
|
||||||
|
|
||||||
|
return g_object_ref (cache->image);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -635,41 +951,74 @@ gsk_gpu_device_lookup_glyph_image (GskGpuDevice *self,
|
|||||||
GskGpuGlyphLookupFlags flags,
|
GskGpuGlyphLookupFlags flags,
|
||||||
float scale,
|
float scale,
|
||||||
graphene_rect_t *out_bounds,
|
graphene_rect_t *out_bounds,
|
||||||
graphene_point_t *out_origin)
|
graphene_point_t *out_origin,
|
||||||
|
PangoFont **out_scaled_font)
|
||||||
{
|
{
|
||||||
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
|
GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (self);
|
||||||
GskGpuCachedGlyph lookup = {
|
FontGlyphCache font_lookup = {
|
||||||
.font = font,
|
.key = { .font = font, .scale = scale }
|
||||||
.glyph = glyph,
|
|
||||||
.flags = flags,
|
|
||||||
.scale = scale
|
|
||||||
};
|
};
|
||||||
GskGpuCachedGlyph *cache;
|
GskGpuCachedGlyph glyph_lookup = {
|
||||||
|
.glyph_key = { .glyph = glyph, .flags = flags }
|
||||||
|
};
|
||||||
|
FontGlyphCache *font_cache = NULL;
|
||||||
|
GskGpuCachedGlyph *cache = NULL;
|
||||||
PangoRectangle ink_rect;
|
PangoRectangle ink_rect;
|
||||||
graphene_rect_t rect;
|
graphene_rect_t rect;
|
||||||
graphene_point_t origin;
|
graphene_point_t origin;
|
||||||
GskGpuImage *image;
|
GskGpuImage *image;
|
||||||
gsize atlas_x, atlas_y, padding;
|
gsize atlas_x, atlas_y, padding;
|
||||||
|
float subpixel_x, subpixel_y;
|
||||||
|
PangoFont *scaled_font;
|
||||||
|
|
||||||
cache = g_hash_table_lookup (priv->glyph_cache, &lookup);
|
if (priv->last_font_cache->key.font == font &&
|
||||||
if (cache)
|
priv->last_font_cache->key.scale == scale)
|
||||||
|
font_cache = priv->last_font_cache;
|
||||||
|
else
|
||||||
|
font_cache = g_hash_table_lookup (priv->glyph_cache, &font_lookup);
|
||||||
|
|
||||||
|
if (font_cache)
|
||||||
{
|
{
|
||||||
gsk_gpu_cached_use (self, (GskGpuCached *) cache, gsk_gpu_frame_get_timestamp (frame));
|
cache = g_hash_table_lookup (font_cache->cache, &glyph_lookup);
|
||||||
|
if (cache)
|
||||||
|
{
|
||||||
|
gsk_gpu_cached_use (self, (GskGpuCached *) cache, gsk_gpu_frame_get_timestamp (frame));
|
||||||
|
|
||||||
*out_bounds = cache->bounds;
|
*out_bounds = cache->bounds;
|
||||||
*out_origin = cache->origin;
|
*out_origin = cache->origin;
|
||||||
return cache->image;
|
|
||||||
|
priv->last_font_cache = font_cache;
|
||||||
|
|
||||||
|
return cache->image;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
font_cache = g_new (FontGlyphCache, 1);
|
||||||
|
font_cache->key.font = g_object_ref (font);
|
||||||
|
font_cache->key.scale = scale;
|
||||||
|
font_cache->cache = g_hash_table_new (gsk_gpu_cached_glyph_hash,
|
||||||
|
gsk_gpu_cached_glyph_equal);
|
||||||
|
g_hash_table_insert (priv->glyph_cache, font_cache, font_cache);
|
||||||
}
|
}
|
||||||
|
|
||||||
pango_font_get_glyph_extents (font, glyph, &ink_rect, NULL);
|
priv->last_font_cache = font_cache;
|
||||||
origin.x = floor (ink_rect.x * scale / PANGO_SCALE);
|
|
||||||
origin.y = floor (ink_rect.y * scale / PANGO_SCALE);
|
if (*out_scaled_font)
|
||||||
rect.size.width = ceil ((ink_rect.x + ink_rect.width) * scale / PANGO_SCALE) - origin.x;
|
scaled_font = *out_scaled_font;
|
||||||
rect.size.height = ceil ((ink_rect.y + ink_rect.height) * scale / PANGO_SCALE) - origin.y;
|
else
|
||||||
|
scaled_font = gsk_get_scaled_font (font, scale);
|
||||||
|
|
||||||
|
subpixel_x = (flags & 3) / 4.f;
|
||||||
|
subpixel_y = ((flags >> 2) & 3) / 4.f;
|
||||||
|
pango_font_get_glyph_extents (scaled_font, glyph, &ink_rect, NULL);
|
||||||
|
origin.x = floor (ink_rect.x * 1.0 / PANGO_SCALE + subpixel_x);
|
||||||
|
origin.y = floor (ink_rect.y * 1.0 / PANGO_SCALE + subpixel_y);
|
||||||
|
rect.size.width = ceil ((ink_rect.x + ink_rect.width) * 1.0 / PANGO_SCALE + subpixel_x) - origin.x;
|
||||||
|
rect.size.height = ceil ((ink_rect.y + ink_rect.height) * 1.0 / PANGO_SCALE + subpixel_y) - origin.y;
|
||||||
padding = 1;
|
padding = 1;
|
||||||
|
|
||||||
image = gsk_gpu_device_add_atlas_image (self,
|
image = gsk_gpu_device_add_atlas_image (self,
|
||||||
gsk_gpu_frame_get_timestamp (frame),
|
|
||||||
rect.size.width + 2 * padding, rect.size.height + 2 * padding,
|
rect.size.width + 2 * padding, rect.size.height + 2 * padding,
|
||||||
&atlas_x, &atlas_y);
|
&atlas_x, &atlas_y);
|
||||||
if (image)
|
if (image)
|
||||||
@@ -688,18 +1037,18 @@ gsk_gpu_device_lookup_glyph_image (GskGpuDevice *self,
|
|||||||
cache = gsk_gpu_cached_new (self, &GSK_GPU_CACHED_GLYPH_CLASS, NULL);
|
cache = gsk_gpu_cached_new (self, &GSK_GPU_CACHED_GLYPH_CLASS, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
cache->font = g_object_ref (font),
|
cache->font_cache = font_cache;
|
||||||
cache->glyph = glyph,
|
cache->glyph_key.glyph = glyph;
|
||||||
cache->flags = flags,
|
cache->glyph_key.flags = flags;
|
||||||
cache->scale = scale,
|
cache->bounds = rect;
|
||||||
cache->bounds = rect,
|
cache->image = image;
|
||||||
cache->image = image,
|
cache->origin = GRAPHENE_POINT_INIT (- origin.x + subpixel_x,
|
||||||
cache->origin = GRAPHENE_POINT_INIT (- origin.x + (flags & 3) / 4.f,
|
- origin.y + subpixel_y);
|
||||||
- origin.y + ((flags >> 2) & 3) / 4.f);
|
((GskGpuCached *) cache)->pixels = (rect.size.width + 2 * padding) * (rect.size.height + 2 * padding);
|
||||||
|
|
||||||
gsk_gpu_upload_glyph_op (frame,
|
gsk_gpu_upload_glyph_op (frame,
|
||||||
cache->image,
|
cache->image,
|
||||||
font,
|
scaled_font,
|
||||||
glyph,
|
glyph,
|
||||||
&(cairo_rectangle_int_t) {
|
&(cairo_rectangle_int_t) {
|
||||||
.x = rect.origin.x - padding,
|
.x = rect.origin.x - padding,
|
||||||
@@ -707,15 +1056,16 @@ gsk_gpu_device_lookup_glyph_image (GskGpuDevice *self,
|
|||||||
.width = rect.size.width + 2 * padding,
|
.width = rect.size.width + 2 * padding,
|
||||||
.height = rect.size.height + 2 * padding,
|
.height = rect.size.height + 2 * padding,
|
||||||
},
|
},
|
||||||
scale,
|
|
||||||
&GRAPHENE_POINT_INIT (cache->origin.x + padding,
|
&GRAPHENE_POINT_INIT (cache->origin.x + padding,
|
||||||
cache->origin.y + padding));
|
cache->origin.y + padding));
|
||||||
|
|
||||||
g_hash_table_insert (priv->glyph_cache, cache, cache);
|
g_hash_table_insert (font_cache->cache, cache, cache);
|
||||||
gsk_gpu_cached_use (self, (GskGpuCached *) cache, gsk_gpu_frame_get_timestamp (frame));
|
gsk_gpu_cached_use (self, (GskGpuCached *) cache, gsk_gpu_frame_get_timestamp (frame));
|
||||||
|
|
||||||
*out_bounds = cache->bounds;
|
*out_bounds = cache->bounds;
|
||||||
*out_origin = cache->origin;
|
*out_origin = cache->origin;
|
||||||
|
*out_scaled_font = scaled_font;
|
||||||
|
|
||||||
return cache->image;
|
return cache->image;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ struct _GskGpuDeviceClass
|
|||||||
GdkMemoryDepth depth,
|
GdkMemoryDepth depth,
|
||||||
gsize width,
|
gsize width,
|
||||||
gsize height);
|
gsize height);
|
||||||
|
void (* make_current) (GskGpuDevice *self);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gsk_gpu_device_get_type (void) G_GNUC_CONST;
|
GType gsk_gpu_device_get_type (void) G_GNUC_CONST;
|
||||||
@@ -48,9 +50,8 @@ GType gsk_gpu_device_get_type (void) G
|
|||||||
void gsk_gpu_device_setup (GskGpuDevice *self,
|
void gsk_gpu_device_setup (GskGpuDevice *self,
|
||||||
GdkDisplay *display,
|
GdkDisplay *display,
|
||||||
gsize max_image_size);
|
gsize max_image_size);
|
||||||
void gsk_gpu_device_gc (GskGpuDevice *self,
|
void gsk_gpu_device_maybe_gc (GskGpuDevice *self);
|
||||||
gint64 timestamp);
|
void gsk_gpu_device_queue_gc (GskGpuDevice *self);
|
||||||
|
|
||||||
GdkDisplay * gsk_gpu_device_get_display (GskGpuDevice *self);
|
GdkDisplay * gsk_gpu_device_get_display (GskGpuDevice *self);
|
||||||
gsize gsk_gpu_device_get_max_image_size (GskGpuDevice *self);
|
gsize gsk_gpu_device_get_max_image_size (GskGpuDevice *self);
|
||||||
GskGpuImage * gsk_gpu_device_get_atlas_image (GskGpuDevice *self);
|
GskGpuImage * gsk_gpu_device_get_atlas_image (GskGpuDevice *self);
|
||||||
@@ -69,7 +70,7 @@ GskGpuImage * gsk_gpu_device_create_download_image (GskGpuD
|
|||||||
GdkMemoryDepth depth,
|
GdkMemoryDepth depth,
|
||||||
gsize width,
|
gsize width,
|
||||||
gsize height);
|
gsize height);
|
||||||
|
void gsk_gpu_device_make_current (GskGpuDevice *self);
|
||||||
GskGpuImage * gsk_gpu_device_lookup_texture_image (GskGpuDevice *self,
|
GskGpuImage * gsk_gpu_device_lookup_texture_image (GskGpuDevice *self,
|
||||||
GdkTexture *texture,
|
GdkTexture *texture,
|
||||||
gint64 timestamp);
|
gint64 timestamp);
|
||||||
@@ -95,7 +96,8 @@ GskGpuImage * gsk_gpu_device_lookup_glyph_image (GskGpuD
|
|||||||
GskGpuGlyphLookupFlags flags,
|
GskGpuGlyphLookupFlags flags,
|
||||||
float scale,
|
float scale,
|
||||||
graphene_rect_t *out_bounds,
|
graphene_rect_t *out_bounds,
|
||||||
graphene_point_t *out_origin);
|
graphene_point_t *out_origin,
|
||||||
|
PangoFont **out_scaled_font);
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GskGpuDevice, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GskGpuDevice, g_object_unref)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user