mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-08 17:50:10 +00:00
gpu: Compare fourccs, not GdkMemoryFormat
For dmabufs, the format is not an exact description of the data, it only gives the closest memory format for a given fourcc. This of course means that multiple different fourccs may report the same format. So when deciding if we need to copy the image to get the right data to download, we need to check if the fourcc is correct, not if the format is. Related: #7046
This commit is contained in:
parent
754c9cb323
commit
ae741a06c0
@ -17,6 +17,7 @@
|
||||
#include "gskrendererprivate.h"
|
||||
|
||||
#include "gdk/gdkdmabufdownloaderprivate.h"
|
||||
#include "gdk/gdkdmabuftextureprivate.h"
|
||||
#include "gdk/gdkdrawcontextprivate.h"
|
||||
#include "gdk/gdktexturedownloaderprivate.h"
|
||||
|
||||
@ -806,6 +807,7 @@ gsk_gpu_frame_download_texture (GskGpuFrame *self,
|
||||
gsize stride)
|
||||
{
|
||||
GskGpuFramePrivate *priv = gsk_gpu_frame_get_instance_private (self);
|
||||
const GdkDmabuf *dmabuf;
|
||||
GdkColorState *image_cs;
|
||||
GskGpuImage *image;
|
||||
|
||||
@ -826,10 +828,11 @@ gsk_gpu_frame_download_texture (GskGpuFrame *self,
|
||||
}
|
||||
|
||||
image_cs = gdk_texture_get_color_state (texture);
|
||||
dmabuf = gdk_dmabuf_texture_get_dmabuf (GDK_DMABUF_TEXTURE (texture));
|
||||
|
||||
gsk_gpu_frame_cleanup (self);
|
||||
|
||||
if (gsk_gpu_image_get_format (image) != format ||
|
||||
if (gdk_memory_format_get_dmabuf_fourcc (gsk_gpu_image_get_format (image)) != dmabuf->fourcc ||
|
||||
image_cs != color_state)
|
||||
{
|
||||
GskGpuImage *converted;
|
||||
|
Loading…
Reference in New Issue
Block a user