mirror of
https://git.outfoxxed.me/quickshell/quickshell.git
synced 2026-02-23 03:33:57 +11:00
wayland/screencopy: log more information during buffer creation
This commit is contained in:
parent
c2ed5bf559
commit
ca79715cce
5 changed files with 67 additions and 42 deletions
|
|
@ -25,7 +25,6 @@
|
|||
#include <qquickwindow.h>
|
||||
#include <qscopedpointer.h>
|
||||
#include <qsgtexture_platform.h>
|
||||
#include <qtclasshelpermacros.h>
|
||||
#include <qwayland-linux-dmabuf-v1.h>
|
||||
#include <qwaylandclientextension.h>
|
||||
#include <sys/mman.h>
|
||||
|
|
@ -48,42 +47,7 @@ Q_LOGGING_CATEGORY(logDmabuf, "quickshell.wayland.buffer.dmabuf", QtWarningMsg);
|
|||
|
||||
LinuxDmabufManager* MANAGER = nullptr; // NOLINT
|
||||
|
||||
class FourCCStr {
|
||||
public:
|
||||
explicit FourCCStr(uint32_t code)
|
||||
: chars(
|
||||
{static_cast<char>(code >> 0 & 0xff),
|
||||
static_cast<char>(code >> 8 & 0xff),
|
||||
static_cast<char>(code >> 16 & 0xff),
|
||||
static_cast<char>(code >> 24 & 0xff),
|
||||
'\0'}
|
||||
) {
|
||||
for (auto i = 3; i != 0; i--) {
|
||||
if (chars[i] == ' ') chars[i] = '\0';
|
||||
else break;
|
||||
}
|
||||
}
|
||||
|
||||
[[nodiscard]] const char* cStr() const { return this->chars.data(); }
|
||||
|
||||
private:
|
||||
std::array<char, 5> chars {};
|
||||
};
|
||||
|
||||
class FourCCModStr {
|
||||
public:
|
||||
explicit FourCCModStr(uint64_t code): drmStr(drmGetFormatModifierName(code)) {}
|
||||
~FourCCModStr() {
|
||||
if (this->drmStr) drmFree(this->drmStr);
|
||||
}
|
||||
|
||||
Q_DISABLE_COPY_MOVE(FourCCModStr);
|
||||
|
||||
[[nodiscard]] const char* cStr() const { return this->drmStr; }
|
||||
|
||||
private:
|
||||
char* drmStr;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
QDebug& operator<<(QDebug& debug, const FourCCStr& fourcc) {
|
||||
debug << fourcc.cStr();
|
||||
|
|
@ -95,8 +59,6 @@ QDebug& operator<<(QDebug& debug, const FourCCModStr& fourcc) {
|
|||
return debug;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
QDebug& operator<<(QDebug& debug, const WlDmaBuffer* buffer) {
|
||||
auto saver = QDebugStateSaver(debug);
|
||||
debug.nospace();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue