Merge branch 'wip/otte/for-main' into 'main'
node-editor: Make this app non-unique See merge request GNOME/gtk!7372
This commit is contained in:
@@ -299,7 +299,7 @@ node_editor_application_new (void)
|
||||
|
||||
app = g_object_new (NODE_EDITOR_APPLICATION_TYPE,
|
||||
"application-id", "org.gtk.gtk4.NodeEditor",
|
||||
"flags", G_APPLICATION_HANDLES_OPEN,
|
||||
"flags", G_APPLICATION_HANDLES_OPEN | G_APPLICATION_NON_UNIQUE,
|
||||
NULL);
|
||||
|
||||
g_application_add_main_option (G_APPLICATION (app), "version", 0, 0,G_OPTION_ARG_NONE, "Show program version", NULL);
|
||||
|
||||
@@ -202,6 +202,9 @@ gsk_vulkan_device_check_format (GskVulkanDevice *device,
|
||||
#define CHECK_FLAGS (GSK_GPU_IMAGE_NO_BLIT | GSK_GPU_IMAGE_FILTERABLE | GSK_GPU_IMAGE_RENDERABLE)
|
||||
GskGpuImageFlags flags;
|
||||
|
||||
if (vk_format == VK_FORMAT_UNDEFINED)
|
||||
return FALSE;
|
||||
|
||||
if (vk_usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT &&
|
||||
!gsk_component_mapping_is_framebuffer_compatible (vk_components))
|
||||
return FALSE;
|
||||
@@ -261,15 +264,13 @@ gsk_vulkan_image_new (GskVulkanDevice *device,
|
||||
|
||||
/* First, try the actual format */
|
||||
vk_format = gdk_memory_format_vk_format (format, &vk_components);
|
||||
if (vk_format == VK_FORMAT_UNDEFINED ||
|
||||
!gsk_vulkan_device_check_format (device, vk_format, &vk_components, required_flags,
|
||||
if (!gsk_vulkan_device_check_format (device, vk_format, &vk_components, required_flags,
|
||||
tiling, usage, width, height,
|
||||
&tiling, &flags))
|
||||
{
|
||||
/* Second, try the potential RGBA format */
|
||||
vk_format = gdk_memory_format_vk_rgba_format (format, NULL, &vk_components);
|
||||
if (vk_format == VK_FORMAT_UNDEFINED ||
|
||||
!gsk_vulkan_device_check_format (device, vk_format, &vk_components, required_flags,
|
||||
if (!gsk_vulkan_device_check_format (device, vk_format, &vk_components, required_flags,
|
||||
tiling, usage, width, height,
|
||||
&tiling, &flags))
|
||||
{
|
||||
@@ -281,8 +282,7 @@ gsk_vulkan_image_new (GskVulkanDevice *device,
|
||||
for (i = 0; fallbacks[i] != -1; i++)
|
||||
{
|
||||
vk_format = gdk_memory_format_vk_format (fallbacks[i], &vk_components);
|
||||
if (vk_format != VK_FORMAT_UNDEFINED &&
|
||||
gsk_vulkan_device_check_format (device, vk_format, &vk_components, required_flags,
|
||||
if (gsk_vulkan_device_check_format (device, vk_format, &vk_components, required_flags,
|
||||
tiling, usage, width, height,
|
||||
&tiling, &flags))
|
||||
{
|
||||
|
||||
@@ -835,7 +835,22 @@ compare_textures (GdkTexture *texture1,
|
||||
{
|
||||
for (x = 0; x < width; x++)
|
||||
{
|
||||
g_assert_true (gdk_memory_format_pixel_equal (format, accurate_compare, data1 + bpp * x, data2 + bpp * x));
|
||||
if (!gdk_memory_format_pixel_equal (format, accurate_compare, data1 + bpp * x, data2 + bpp * x))
|
||||
{
|
||||
gsize i;
|
||||
GString *msg = g_string_new (NULL);
|
||||
|
||||
g_string_append_printf (msg, "(%u %u): ", x, y);
|
||||
for (i = 0; i < bpp; i++)
|
||||
g_string_append_printf (msg, "%02X", data1[bpp * x + i]);
|
||||
g_string_append (msg, " != ");
|
||||
for (i = 0; i < bpp; i++)
|
||||
g_string_append_printf (msg, "%02X", data2[bpp * x + i]);
|
||||
|
||||
g_test_message ("%s", msg->str);
|
||||
g_string_free (msg, TRUE);
|
||||
g_test_fail ();
|
||||
}
|
||||
}
|
||||
data1 += stride1;
|
||||
data2 += stride2;
|
||||
|
||||
Reference in New Issue
Block a user