Don't pass pixmap handles as const references
But do pass the region in SceneOpenGL::Texture::load() as a const reference. This patch also replaces the Xlib types with their xcb equivalents.icc-effect-5.14.5
parent
baf37deacd
commit
1c7938e43e
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue