Add API for selecting supported wl_shm formats
We would always reported all formats we could convert from as supported on the wl_shm protocol. This would sometimes cause clients to pick formats that required internal conversion when creating OpenGL textures from the images. To avoid this, we default to only supporting the RGB32 and ARGB32_Premultiplied formats (which are required and advertised automatically) and if the user wants to add additional formats, we now have a additionalShmFormats property for this. [ChangeLog][QtWaylandCompositor] The compositor will now by default only advertise support for the required wl_shm formats. Additional formats can be added to the list by setting the additionalShmFormats property on the compositor. Fixes: QTBUG-77531 Change-Id: Ibd5d5be2a37968353c00308abbfff7ca6f8d310d Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This commit is contained in:
parent
74d7982b94
commit
8631b43a2d
@ -71,7 +71,6 @@ public:
|
||||
default: return QImage::Format_Invalid;
|
||||
}
|
||||
}
|
||||
static inline QList<wl_shm_format> supportedWaylandFormats();
|
||||
|
||||
private:
|
||||
//IMPLEMENTATION (which has to be inline in the header because of the include trick)
|
||||
@ -127,19 +126,6 @@ wl_shm_format QWaylandSharedMemoryFormatHelper::fromQImageFormat(QImage::Format
|
||||
return array.data[format];
|
||||
}
|
||||
|
||||
QList<wl_shm_format> QWaylandSharedMemoryFormatHelper::supportedWaylandFormats()
|
||||
{
|
||||
QList<wl_shm_format> retFormats;
|
||||
Array array = getData();
|
||||
for (size_t i = 0; i < array.size; i++) {
|
||||
if (int(array.data[i]) != INT_MIN
|
||||
&& !retFormats.contains(array.data[i])) {
|
||||
retFormats.append(array.data[i]);
|
||||
}
|
||||
}
|
||||
return retFormats;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif //QWAYLANDSHAREDMEMORYFORMATHELPER_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user