| 1 | #cxx . . $ `<file>/testsuite/gdk/udmabuf.c`/include "config.h"cxx . . $ `<file>/build/config.h`/ |
| 2 | |
| 3 | #include "udmabuf.h"cxx . . $ `<file>/testsuite/gdk/udmabuf.h`/ |
| 4 | |
| 5 | #if defined(HAVE_DMABUFcxx . . $ `build/config.h:34:9`!) && defined(HAVE_UDMABUFcxx . . $ `build/config.h:90:9`!) |
| 6 | |
| 7 | #include <inttypes.h> |
| 8 | #include <fcntl.h> |
| 9 | #include <sys/mman.h> |
| 10 | #include <sys/ioctl.h> |
| 11 | #include <linux/udmabuf.h> |
| 12 | #include <errno.h> |
| 13 | #include <gtk/gtk.h>cxx . . $ `<file>/gtk/gtk.h`/ |
| 14 | #include <gio/gio.h> |
| 15 | #include "gdk/gdkdmabuffourccprivate.h"cxx . . $ `<file>/gdk/gdkdmabuffourccprivate.h`/ |
| 16 | |
| 17 | |
| 18 | typedef structcxx . . $ $anonymous_type_5084e6cc1454d024_0# |
| 19 | { |
| 20 | int mem_fdcxx . . $ $anonymous_type_5084e6cc1454d024_0#mem_fd.; |
| 21 | int dmabuf_fdcxx . . $ $anonymous_type_5084e6cc1454d024_0#dmabuf_fd.; |
| 22 | size_t sizecxx . . $ $anonymous_type_5084e6cc1454d024_0#size.; |
| 23 | gpointercxx . . $ gpointer# datacxx . . $ $anonymous_type_5084e6cc1454d024_0#data.; |
| 24 | } UDmabufcxx . . $ UDmabuf#; |
| 25 | |
| 26 | static int udmabuf_fdcxx . . $ udmabuf_fd.; |
| 27 | |
| 28 | gbooleancxx . . $ gboolean# |
| 29 | udmabuf_initializecxx . . $ udmabuf_initialize(99147cdc3c1dad38). (GErrorcxx . . $ GError# **error) |
| 30 | { |
| 31 | if (udmabuf_fdcxx . . $ udmabuf_fd. == 0) |
| 32 | { |
| 33 | udmabuf_fdcxx . . $ udmabuf_fd. = opencxx . . $ open(e156e3aa1e5c4ad1). ("/dev/udmabuf", O_RDWRcxx . . $ `<external>/14578502075116107718/fcntl-linux.h:45:9`!); |
| 34 | if (udmabuf_fdcxx . . $ udmabuf_fd. == -1) |
| 35 | { |
| 36 | g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error, |
| 37 | G_IO_ERRORcxx . . $ `<external>/13894955190784973534/gioerror.h:42:9`!, G_IO_ERROR_FAILEDcxx . . $ G_IO_ERROR_FAILED., |
| 38 | "Failed to open /dev/udmabuf: %s", |
| 39 | g_strerrorcxx . . $ g_strerror(f7ae7e56280f18ae). (errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!)); |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | return udmabuf_fdcxx . . $ udmabuf_fd. != -1; |
| 44 | } |
| 45 | |
| 46 | static void |
| 47 | udmabuf_freecxx . . $ udmabuf_free(5d22bdacc48458e8). (gpointercxx . . $ gpointer# data) |
| 48 | { |
| 49 | UDmabufcxx . . $ UDmabuf# *udmabuf = data; |
| 50 | |
| 51 | munmapcxx . . $ munmap(c0a5f96701d3f89). (udmabuf->datacxx . . $ $anonymous_type_5084e6cc1454d024_0#data., udmabuf->sizecxx . . $ $anonymous_type_5084e6cc1454d024_0#size.); |
| 52 | closecxx . . $ close(7864480464b09eea). (udmabuf->mem_fdcxx . . $ $anonymous_type_5084e6cc1454d024_0#mem_fd.); |
| 53 | closecxx . . $ close(7864480464b09eea). (udmabuf->dmabuf_fdcxx . . $ $anonymous_type_5084e6cc1454d024_0#dmabuf_fd.); |
| 54 | |
| 55 | g_freecxx . . $ g_free(5d22bdacc48458e8). (udmabuf); |
| 56 | } |
| 57 | |
| 58 | #define aligncxx . . $ `testsuite/gdk/udmabuf.c:58:9`!(x,y) (((x) + (y) - 1) & ~((y) - 1)) |
| 59 | |
| 60 | static UDmabufcxx . . $ UDmabuf# * |
| 61 | udmabuf_allocatecxx . . $ udmabuf_allocate(54b7da3aa4c1353a). (size_t size, |
| 62 | GErrorcxx . . $ GError# **error) |
| 63 | { |
| 64 | int mem_fd = -1; |
| 65 | int dmabuf_fd = -1; |
| 66 | uint64_tcxx . . $ uint64_t# alignment; |
| 67 | int res; |
| 68 | gpointercxx . . $ gpointer# data; |
| 69 | UDmabufcxx . . $ UDmabuf# *udmabuf; |
| 70 | |
| 71 | if (udmabuf_fdcxx . . $ udmabuf_fd. == 0) |
| 72 | { |
| 73 | if (!udmabuf_initializecxx . . $ udmabuf_initialize(99147cdc3c1dad38). (error)) |
| 74 | goto fail; |
| 75 | } |
| 76 | |
| 77 | if (udmabuf_fdcxx . . $ udmabuf_fd. == -1) |
| 78 | { |
| 79 | g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error, |
| 80 | G_IO_ERRORcxx . . $ `<external>/13894955190784973534/gioerror.h:42:9`!, G_IO_ERROR_FAILEDcxx . . $ G_IO_ERROR_FAILED., |
| 81 | "udmabuf not available"); |
| 82 | goto fail; |
| 83 | } |
| 84 | |
| 85 | alignment = sysconfcxx . . $ sysconf(dc1f09c09fbff20f). (_SC_PAGE_SIZEcxx . . $ `<external>/6393649343499073842/confname.h:135:9`!); |
| 86 | |
| 87 | size = aligncxx . . $ `testsuite/gdk/udmabuf.c:58:9`! (size, alignment); |
| 88 | |
| 89 | mem_fd = memfd_createcxx . . $ memfd_create(1df18506ef0a631b). ("gtk", MFD_ALLOW_SEALINGcxx . . $ `<external>/14338791556689567014/mman-shared.h:32:11`!); |
| 90 | if (mem_fd == -1) |
| 91 | { |
| 92 | g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error, |
| 93 | G_IO_ERRORcxx . . $ `<external>/13894955190784973534/gioerror.h:42:9`!, G_IO_ERROR_FAILEDcxx . . $ G_IO_ERROR_FAILED., |
| 94 | "Failed to open /dev/udmabuf: %s", |
| 95 | g_strerrorcxx . . $ g_strerror(f7ae7e56280f18ae). (errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!)); |
| 96 | goto fail; |
| 97 | } |
| 98 | |
| 99 | res = ftruncatecxx . . $ ftruncate(bba9d6e9fb34fad7). (mem_fd, size); |
| 100 | if (res == -1) |
| 101 | { |
| 102 | g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error, |
| 103 | G_IO_ERRORcxx . . $ `<external>/13894955190784973534/gioerror.h:42:9`!, G_IO_ERROR_FAILEDcxx . . $ G_IO_ERROR_FAILED., |
| 104 | "ftruncate failed: %s", |
| 105 | g_strerrorcxx . . $ g_strerror(f7ae7e56280f18ae). (errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!)); |
| 106 | goto fail; |
| 107 | } |
| 108 | |
| 109 | if (fcntlcxx . . $ fcntl(cac4efb70f20a0fb). (mem_fd, F_ADD_SEALScxx . . $ `<external>/14578502075116107718/fcntl-linux.h:205:10`!, F_SEAL_SHRINKcxx . . $ `<external>/14578502075116107718/fcntl-linux.h:284:10`!) < 0) |
| 110 | { |
| 111 | g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error, |
| 112 | G_IO_ERRORcxx . . $ `<external>/13894955190784973534/gioerror.h:42:9`!, G_IO_ERROR_FAILEDcxx . . $ G_IO_ERROR_FAILED., |
| 113 | "ftruncate failed: %s", |
| 114 | g_strerrorcxx . . $ g_strerror(f7ae7e56280f18ae). (errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!)); |
| 115 | goto fail; |
| 116 | } |
| 117 | |
| 118 | dmabuf_fd = ioctlcxx . . $ ioctl(67fa1c773b05068c). (udmabuf_fdcxx . . $ udmabuf_fd., |
| 119 | UDMABUF_CREATEcxx . . $ `<external>/16608306439705632575/udmabuf.h:30:9`!, |
| 120 | &(struct udmabuf_createcxx . . $ udmabuf_create#) { |
| 121 | .memfd = mem_fd, |
| 122 | .flags = UDMABUF_FLAGS_CLOEXECcxx . . $ `<external>/16608306439705632575/udmabuf.h:8:9`!, |
| 123 | .offset = 0, |
| 124 | .size = size |
| 125 | }); |
| 126 | |
| 127 | if (dmabuf_fd < 0) |
| 128 | { |
| 129 | g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error, |
| 130 | G_IO_ERRORcxx . . $ `<external>/13894955190784973534/gioerror.h:42:9`!, G_IO_ERROR_FAILEDcxx . . $ G_IO_ERROR_FAILED., |
| 131 | "UDMABUF_CREATE ioctl failed: %s", |
| 132 | g_strerrorcxx . . $ g_strerror(f7ae7e56280f18ae). (errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!)); |
| 133 | goto fail; |
| 134 | } |
| 135 | |
| 136 | data = mmapcxx . . $ mmap(ff06c1c904cdf0e2). (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, size, PROT_WRITEcxx . . $ `<external>/17226767460805440860/mman-linux.h:33:9`! | PROT_READcxx . . $ `<external>/17226767460805440860/mman-linux.h:32:9`!, MAP_SHAREDcxx . . $ `<external>/17226767460805440860/mman-linux.h:42:9`!, mem_fd, 0); |
| 137 | |
| 138 | if (data == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || data == MAP_FAILEDcxx . . $ `<external>/6724834311684550606/mman.h:44:9`!) |
| 139 | { |
| 140 | g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error, |
| 141 | G_IO_ERRORcxx . . $ `<external>/13894955190784973534/gioerror.h:42:9`!, G_IO_ERROR_FAILEDcxx . . $ G_IO_ERROR_FAILED., |
| 142 | "mmap failed: %s", |
| 143 | g_strerrorcxx . . $ g_strerror(f7ae7e56280f18ae). (errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!)); |
| 144 | goto fail; |
| 145 | } |
| 146 | |
| 147 | udmabuf = g_new0cxx . . $ `<external>/1123956534522462559/gmem.h:335:9`! (UDmabuf, 1); |
| 148 | |
| 149 | udmabuf->mem_fdcxx . . $ $anonymous_type_5084e6cc1454d024_0#mem_fd. = mem_fd; |
| 150 | udmabuf->dmabuf_fdcxx . . $ $anonymous_type_5084e6cc1454d024_0#dmabuf_fd. = dmabuf_fd; |
| 151 | udmabuf->sizecxx . . $ $anonymous_type_5084e6cc1454d024_0#size. = size; |
| 152 | udmabuf->datacxx . . $ $anonymous_type_5084e6cc1454d024_0#data. = data; |
| 153 | |
| 154 | return udmabuf; |
| 155 | |
| 156 | fail: |
| 157 | if (mem_fd != -1) |
| 158 | closecxx . . $ close(7864480464b09eea). (mem_fd); |
| 159 | if (dmabuf_fd != -1) |
| 160 | closecxx . . $ close(7864480464b09eea). (dmabuf_fd); |
| 161 | |
| 162 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 163 | } |
| 164 | |
| 165 | |
| 166 | GdkTexturecxx . . $ GdkTexture# * |
| 167 | udmabuf_texture_newcxx . . $ udmabuf_texture_new(bd239635fa29721f). (gsizecxx . . $ gsize# width, |
| 168 | gsizecxx . . $ gsize# height, |
| 169 | guintcxx . . $ guint# fourcc, |
| 170 | GdkColorStatecxx . . $ GdkColorState# *color_state, |
| 171 | gbooleancxx . . $ gboolean# premultiplied, |
| 172 | GBytescxx . . $ GBytes# *bytes, |
| 173 | gsizecxx . . $ gsize# stride, |
| 174 | GErrorcxx . . $ GError# **error) |
| 175 | { |
| 176 | GdkDmabufTextureBuildercxx . . $ GdkDmabufTextureBuilder# *builder; |
| 177 | GdkTexturecxx . . $ GdkTexture# *texture; |
| 178 | UDmabufcxx . . $ UDmabuf# *udmabuf; |
| 179 | gconstpointercxx . . $ gconstpointer# data; |
| 180 | gsizecxx . . $ gsize# size; |
| 181 | |
| 182 | /* Many graphics cards need this and Mesa tries to align its own buffers this way */ |
| 183 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (stride % UDMABUF_STRIDE_ALIGNcxx . . $ `testsuite/gdk/udmabuf.h:5:9`! == 0); |
| 184 | |
| 185 | data = g_bytes_get_datacxx . . $ g_bytes_get_data(e1c692f77020eb9f). (bytes, &size); |
| 186 | |
| 187 | udmabuf = udmabuf_allocatecxx . . $ udmabuf_allocate(54b7da3aa4c1353a). (size, error); |
| 188 | if (udmabuf == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 189 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 190 | |
| 191 | memcpycxx . . $ memcpy(cc817cb175f282d). (udmabuf->datacxx . . $ $anonymous_type_5084e6cc1454d024_0#data., data, size); |
| 192 | |
| 193 | builder = gdk_dmabuf_texture_builder_newcxx . . $ gdk_dmabuf_texture_builder_new(3ac516e86cd7e87e). (); |
| 194 | |
| 195 | gdk_dmabuf_texture_builder_set_displaycxx . . $ gdk_dmabuf_texture_builder_set_display(a287a5162a42ca05). (builder, gdk_display_get_defaultcxx . . $ gdk_display_get_default(b31d93ef98fc5572). ()); |
| 196 | gdk_dmabuf_texture_builder_set_widthcxx . . $ gdk_dmabuf_texture_builder_set_width(c5a74fad691ad46). (builder, width); |
| 197 | gdk_dmabuf_texture_builder_set_heightcxx . . $ gdk_dmabuf_texture_builder_set_height(c5a74fad691ad46). (builder, height); |
| 198 | gdk_dmabuf_texture_builder_set_fourcccxx . . $ gdk_dmabuf_texture_builder_set_fourcc(c5a74fad691ad46). (builder, fourcc); |
| 199 | gdk_dmabuf_texture_builder_set_modifiercxx . . $ gdk_dmabuf_texture_builder_set_modifier(d523176e4bb167c2). (builder, 0); |
| 200 | gdk_dmabuf_texture_builder_set_color_statecxx . . $ gdk_dmabuf_texture_builder_set_color_state(e9353b12365bed84). (builder, color_state); |
| 201 | gdk_dmabuf_texture_builder_set_premultipliedcxx . . $ gdk_dmabuf_texture_builder_set_premultiplied(8849e63316d6d93d). (builder, premultiplied); |
| 202 | gdk_dmabuf_texture_builder_set_n_planescxx . . $ gdk_dmabuf_texture_builder_set_n_planes(c5a74fad691ad46). (builder, 1); |
| 203 | gdk_dmabuf_texture_builder_set_fdcxx . . $ gdk_dmabuf_texture_builder_set_fd(13b1190cfba6cca). (builder, 0, udmabuf->dmabuf_fdcxx . . $ $anonymous_type_5084e6cc1454d024_0#dmabuf_fd.); |
| 204 | gdk_dmabuf_texture_builder_set_stridecxx . . $ gdk_dmabuf_texture_builder_set_stride(99111c64f93fa375). (builder, 0, stride); |
| 205 | gdk_dmabuf_texture_builder_set_offsetcxx . . $ gdk_dmabuf_texture_builder_set_offset(99111c64f93fa375). (builder, 0, 0); |
| 206 | |
| 207 | texture = gdk_dmabuf_texture_builder_buildcxx . . $ gdk_dmabuf_texture_builder_build(351b6e640d4c3b36). (builder, udmabuf_freecxx . . $ udmabuf_free(5d22bdacc48458e8)., udmabuf, error); |
| 208 | |
| 209 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (builder); |
| 210 | |
| 211 | return texture; |
| 212 | } |
| 213 | |
| 214 | #else |
| 215 | |
| 216 | GdkTexture * |
| 217 | udmabuf_texture_new (gsize width, |
| 218 | gsize height, |
| 219 | guint fourcc, |
| 220 | GdkColorState *color_state, |
| 221 | gboolean premultiplied, |
| 222 | GBytes *bytes, |
| 223 | gsize stride, |
| 224 | GError **error) |
| 225 | { |
| 226 | g_set_error (error, |
| 227 | G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, |
| 228 | "Dmabufs are not supported"); |
| 229 | return NULL; |
| 230 | } |
| 231 | |
| 232 | #endif |
| 233 | |
| 234 | GdkTexturecxx . . $ GdkTexture# * |
| 235 | udmabuf_texture_from_texturecxx . . $ udmabuf_texture_from_texture(443dec26b3d8ab02). (GdkTexturecxx . . $ GdkTexture# *texture, |
| 236 | GErrorcxx . . $ GError# **error) |
| 237 | { |
| 238 | GdkTextureDownloadercxx . . $ GdkTextureDownloader# *downloader; |
| 239 | guintcxx . . $ guint# fourcc; |
| 240 | gbooleancxx . . $ gboolean# premultiplied; |
| 241 | gucharcxx . . $ guchar# *data; |
| 242 | gsizecxx . . $ gsize# width, height, stride; |
| 243 | GBytescxx . . $ GBytes# *bytes; |
| 244 | GdkTexturecxx . . $ GdkTexture# *texture2; |
| 245 | |
| 246 | switch ((int) gdk_texture_get_formatcxx . . $ gdk_texture_get_format(1cda2554811ccb0b). (texture)) |
| 247 | { |
| 248 | #ifdef HAVE_DMABUFcxx . . $ `build/config.h:34:9`! |
| 249 | case GDK_MEMORY_B8G8R8A8_PREMULTIPLIEDcxx . . $ GDK_MEMORY_B8G8R8A8_PREMULTIPLIED.: |
| 250 | fourcc = DRM_FORMAT_ARGB8888cxx . . $ `<external>/2156383389880240121/drm_fourcc.h:180:9`!; |
| 251 | premultiplied = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 252 | break; |
| 253 | case GDK_MEMORY_A8R8G8B8_PREMULTIPLIEDcxx . . $ GDK_MEMORY_A8R8G8B8_PREMULTIPLIED.: |
| 254 | fourcc = DRM_FORMAT_BGRA8888cxx . . $ `<external>/2156383389880240121/drm_fourcc.h:183:9`!; |
| 255 | premultiplied = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 256 | break; |
| 257 | case GDK_MEMORY_R8G8B8A8_PREMULTIPLIEDcxx . . $ GDK_MEMORY_R8G8B8A8_PREMULTIPLIED.: |
| 258 | fourcc = DRM_FORMAT_ABGR8888cxx . . $ `<external>/2156383389880240121/drm_fourcc.h:181:9`!; |
| 259 | premultiplied = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 260 | break; |
| 261 | case GDK_MEMORY_A8B8G8R8_PREMULTIPLIEDcxx . . $ GDK_MEMORY_A8B8G8R8_PREMULTIPLIED.: |
| 262 | fourcc = DRM_FORMAT_RGBA8888cxx . . $ `<external>/2156383389880240121/drm_fourcc.h:182:9`!; |
| 263 | premultiplied = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 264 | break; |
| 265 | case GDK_MEMORY_B8G8R8A8cxx . . $ GDK_MEMORY_B8G8R8A8.: |
| 266 | fourcc = DRM_FORMAT_ARGB8888cxx . . $ `<external>/2156383389880240121/drm_fourcc.h:180:9`!; |
| 267 | premultiplied = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 268 | break; |
| 269 | case GDK_MEMORY_A8R8G8B8cxx . . $ GDK_MEMORY_A8R8G8B8.: |
| 270 | fourcc = DRM_FORMAT_BGRA8888cxx . . $ `<external>/2156383389880240121/drm_fourcc.h:183:9`!; |
| 271 | premultiplied = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 272 | break; |
| 273 | case GDK_MEMORY_R8G8B8A8cxx . . $ GDK_MEMORY_R8G8B8A8.: |
| 274 | fourcc = DRM_FORMAT_ABGR8888cxx . . $ `<external>/2156383389880240121/drm_fourcc.h:181:9`!; |
| 275 | premultiplied = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 276 | break; |
| 277 | case GDK_MEMORY_A8B8G8R8cxx . . $ GDK_MEMORY_A8B8G8R8.: |
| 278 | fourcc = DRM_FORMAT_RGBA8888cxx . . $ `<external>/2156383389880240121/drm_fourcc.h:182:9`!; |
| 279 | premultiplied = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 280 | break; |
| 281 | case GDK_MEMORY_R16G16B16A16_FLOATcxx . . $ GDK_MEMORY_R16G16B16A16_FLOAT.: |
| 282 | fourcc = DRM_FORMAT_ABGR16161616Fcxx . . $ `<external>/2156383389880240121/drm_fourcc.h:215:9`!; |
| 283 | premultiplied = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 284 | break; |
| 285 | case GDK_MEMORY_R16G16B16A16_FLOAT_PREMULTIPLIEDcxx . . $ GDK_MEMORY_R16G16B16A16_FLOAT_PREMULTIPLIED.: |
| 286 | fourcc = DRM_FORMAT_ABGR16161616Fcxx . . $ `<external>/2156383389880240121/drm_fourcc.h:215:9`!; |
| 287 | premultiplied = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 288 | break; |
| 289 | #endif |
| 290 | default: |
| 291 | g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error, |
| 292 | G_IO_ERRORcxx . . $ `<external>/13894955190784973534/gioerror.h:42:9`!, G_IO_ERROR_FAILEDcxx . . $ G_IO_ERROR_FAILED., |
| 293 | "Unsupported memory format %u", gdk_texture_get_formatcxx . . $ gdk_texture_get_format(1cda2554811ccb0b). (texture)); |
| 294 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 295 | } |
| 296 | |
| 297 | width = gdk_texture_get_widthcxx . . $ gdk_texture_get_width(84a21f334421d5dd). (texture); |
| 298 | height = gdk_texture_get_heightcxx . . $ gdk_texture_get_height(84a21f334421d5dd). (texture); |
| 299 | stride = (width * 4 + (UDMABUF_STRIDE_ALIGNcxx . . $ `testsuite/gdk/udmabuf.h:5:9`! - 1)) & ~(UDMABUF_STRIDE_ALIGNcxx . . $ `testsuite/gdk/udmabuf.h:5:9`! - 1); |
| 300 | data = g_malloc_ncxx . . $ g_malloc_n(63a7bf2941bfcd7a).(stride, height); |
| 301 | |
| 302 | downloader = gdk_texture_downloader_newcxx . . $ gdk_texture_downloader_new(b7a26057b8bfafc1). (texture); |
| 303 | gdk_texture_downloader_set_formatcxx . . $ gdk_texture_downloader_set_format(f9655a66992b052e). (downloader, gdk_texture_get_formatcxx . . $ gdk_texture_get_format(1cda2554811ccb0b). (texture)); |
| 304 | gdk_texture_downloader_set_color_statecxx . . $ gdk_texture_downloader_set_color_state(274415501bb7799d). (downloader, gdk_texture_get_color_statecxx . . $ gdk_texture_get_color_state(f424d3cc1ea19ea3). (texture)); |
| 305 | gdk_texture_downloader_download_intocxx . . $ gdk_texture_downloader_download_into(15e84af11a05fa6a). (downloader, data, stride); |
| 306 | gdk_texture_downloader_freecxx . . $ gdk_texture_downloader_free(de357e450dee7ef3). (downloader); |
| 307 | |
| 308 | bytes = g_bytes_new_takecxx . . $ g_bytes_new_take(390e96c79791c315).(data, stride * height); |
| 309 | |
| 310 | texture2 = udmabuf_texture_newcxx . . $ udmabuf_texture_new(bd239635fa29721f). (gdk_texture_get_widthcxx . . $ gdk_texture_get_width(84a21f334421d5dd). (texture), |
| 311 | gdk_texture_get_heightcxx . . $ gdk_texture_get_height(84a21f334421d5dd). (texture), |
| 312 | fourcc, |
| 313 | gdk_texture_get_color_statecxx . . $ gdk_texture_get_color_state(f424d3cc1ea19ea3). (texture), |
| 314 | premultiplied, |
| 315 | bytes, stride, |
| 316 | error); |
| 317 | g_bytes_unrefcxx . . $ g_bytes_unref(8fa06155751f251e). (bytes); |
| 318 | |
| 319 | return texture2; |
| 320 | } |
| 321 |