diff --git a/egl_wayland_backend.cpp b/egl_wayland_backend.cpp index ce2d4f634e..a58e4a8c4e 100644 --- a/egl_wayland_backend.cpp +++ b/egl_wayland_backend.cpp @@ -387,7 +387,7 @@ void EglWaylandTexture::findTarget() } } -bool EglWaylandTexture::loadTexture(const Pixmap &pix, const QSize &size, int depth) +bool EglWaylandTexture::loadTexture(xcb_pixmap_t pix, const QSize &size, int depth) { // HACK: egl wayland platform doesn't support texture from X11 pixmap through the KHR_image_pixmap // extension. To circumvent this problem we copy the pixmap content into a SHM image and from there diff --git a/egl_wayland_backend.h b/egl_wayland_backend.h index c07d950ca1..fded887e88 100644 --- a/egl_wayland_backend.h +++ b/egl_wayland_backend.h @@ -103,7 +103,7 @@ class EglWaylandTexture : public SceneOpenGL::TexturePrivate public: virtual ~EglWaylandTexture(); virtual void findTarget(); - virtual bool loadTexture(const Pixmap& pix, const QSize& size, int depth); + virtual bool loadTexture(xcb_pixmap_t pix, const QSize &size, int depth); virtual OpenGLBackend *backend(); virtual bool update(const QRegion &damage); diff --git a/eglonxbackend.cpp b/eglonxbackend.cpp index 179f5aed8d..06d40ddd51 100644 --- a/eglonxbackend.cpp +++ b/eglonxbackend.cpp @@ -466,7 +466,7 @@ void EglTexture::findTarget() } } -bool EglTexture::loadTexture(const Pixmap &pix, const QSize &size, int depth) +bool EglTexture::loadTexture(xcb_pixmap_t pix, const QSize &size, int depth) { Q_UNUSED(depth) if (pix == None) diff --git a/eglonxbackend.h b/eglonxbackend.h index 6c85b1691f..aee2abf82c 100644 --- a/eglonxbackend.h +++ b/eglonxbackend.h @@ -70,7 +70,7 @@ public: virtual ~EglTexture(); virtual void onDamage(); virtual void findTarget(); - virtual bool loadTexture(const Pixmap& pix, const QSize& size, int depth); + virtual bool loadTexture(xcb_pixmap_t pix, const QSize &size, int depth); virtual OpenGLBackend *backend(); private: diff --git a/glxbackend.cpp b/glxbackend.cpp index 7bf3113c63..9fde3e8a75 100644 --- a/glxbackend.cpp +++ b/glxbackend.cpp @@ -675,7 +675,7 @@ void GlxTexture::findTarget() } } -bool GlxTexture::loadTexture(const Pixmap& pix, const QSize& size, int depth) +bool GlxTexture::loadTexture(xcb_pixmap_t pix, const QSize &size, int depth) { #ifdef CHECK_GL_ERROR checkGLError("TextureLoad1"); diff --git a/glxbackend.h b/glxbackend.h index a2821dcfce..0e8c8096d9 100644 --- a/glxbackend.h +++ b/glxbackend.h @@ -90,7 +90,7 @@ public: virtual ~GlxTexture(); virtual void onDamage(); virtual void findTarget(); - virtual bool loadTexture(const Pixmap& pix, const QSize& size, int depth); + virtual bool loadTexture(xcb_pixmap_t pix, const QSize &size, int depth); virtual OpenGLBackend *backend(); private: diff --git a/scene_opengl.cpp b/scene_opengl.cpp index 052d71fe8f..39afb1a0c8 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -775,11 +775,11 @@ void SceneOpenGL::Texture::discard() d_ptr = d_func()->backend()->createBackendTexture(this); } -bool SceneOpenGL::Texture::load(const Pixmap& pix, const QSize& size, - int depth) +bool SceneOpenGL::Texture::load(xcb_pixmap_t pix, const QSize &size, int depth) { - if (pix == None) + if (pix == XCB_NONE) return false; + return load(pix, size, depth, QRegion(0, 0, size.width(), size.height())); } @@ -805,8 +805,8 @@ void SceneOpenGL::Texture::findTarget() d->findTarget(); } -bool SceneOpenGL::Texture::load(const Pixmap& pix, const QSize& size, - int depth, QRegion region) +bool SceneOpenGL::Texture::load(xcb_pixmap_t pix, const QSize &size, + int depth, const QRegion ®ion) { Q_UNUSED(region) // decrease the reference counter for the old texture diff --git a/scene_opengl.h b/scene_opengl.h index 17365e20d8..b902ad02c9 100644 --- a/scene_opengl.h +++ b/scene_opengl.h @@ -144,7 +144,7 @@ public: virtual ~TexturePrivate(); virtual void findTarget() = 0; - virtual bool loadTexture(const Pixmap& pix, const QSize& size, int depth) = 0; + virtual bool loadTexture(xcb_pixmap_t pix, const QSize &size, int depth) = 0; virtual OpenGLBackend *backend() = 0; virtual bool update(const QRegion &damage); @@ -173,9 +173,8 @@ public: protected: void findTarget(); - virtual bool load(const Pixmap& pix, const QSize& size, int depth, - QRegion region); - virtual bool load(const Pixmap& pix, const QSize& size, int depth); + virtual bool load(xcb_pixmap_t pix, const QSize &size, int depth, const QRegion ®ion); + virtual bool load(xcb_pixmap_t pix, const QSize &size, int depth); Texture(TexturePrivate& dd);