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
|
// 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
|
// 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:
|
public:
|
||||||
virtual ~EglWaylandTexture();
|
virtual ~EglWaylandTexture();
|
||||||
virtual void findTarget();
|
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 OpenGLBackend *backend();
|
||||||
virtual bool update(const QRegion &damage);
|
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)
|
Q_UNUSED(depth)
|
||||||
if (pix == None)
|
if (pix == None)
|
||||||
|
|
|
@ -70,7 +70,7 @@ public:
|
||||||
virtual ~EglTexture();
|
virtual ~EglTexture();
|
||||||
virtual void onDamage();
|
virtual void onDamage();
|
||||||
virtual void findTarget();
|
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 OpenGLBackend *backend();
|
||||||
|
|
||||||
private:
|
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
|
#ifdef CHECK_GL_ERROR
|
||||||
checkGLError("TextureLoad1");
|
checkGLError("TextureLoad1");
|
||||||
|
|
|
@ -90,7 +90,7 @@ public:
|
||||||
virtual ~GlxTexture();
|
virtual ~GlxTexture();
|
||||||
virtual void onDamage();
|
virtual void onDamage();
|
||||||
virtual void findTarget();
|
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 OpenGLBackend *backend();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -775,11 +775,11 @@ void SceneOpenGL::Texture::discard()
|
||||||
d_ptr = d_func()->backend()->createBackendTexture(this);
|
d_ptr = d_func()->backend()->createBackendTexture(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SceneOpenGL::Texture::load(const Pixmap& pix, const QSize& size,
|
bool SceneOpenGL::Texture::load(xcb_pixmap_t pix, const QSize &size, int depth)
|
||||||
int depth)
|
|
||||||
{
|
{
|
||||||
if (pix == None)
|
if (pix == XCB_NONE)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return load(pix, size, depth,
|
return load(pix, size, depth,
|
||||||
QRegion(0, 0, size.width(), size.height()));
|
QRegion(0, 0, size.width(), size.height()));
|
||||||
}
|
}
|
||||||
|
@ -805,8 +805,8 @@ void SceneOpenGL::Texture::findTarget()
|
||||||
d->findTarget();
|
d->findTarget();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SceneOpenGL::Texture::load(const Pixmap& pix, const QSize& size,
|
bool SceneOpenGL::Texture::load(xcb_pixmap_t pix, const QSize &size,
|
||||||
int depth, QRegion region)
|
int depth, const QRegion ®ion)
|
||||||
{
|
{
|
||||||
Q_UNUSED(region)
|
Q_UNUSED(region)
|
||||||
// decrease the reference counter for the old texture
|
// decrease the reference counter for the old texture
|
||||||
|
|
|
@ -144,7 +144,7 @@ public:
|
||||||
virtual ~TexturePrivate();
|
virtual ~TexturePrivate();
|
||||||
|
|
||||||
virtual void findTarget() = 0;
|
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 OpenGLBackend *backend() = 0;
|
||||||
virtual bool update(const QRegion &damage);
|
virtual bool update(const QRegion &damage);
|
||||||
|
|
||||||
|
@ -173,9 +173,8 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void findTarget();
|
void findTarget();
|
||||||
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);
|
||||||
QRegion region);
|
virtual bool load(xcb_pixmap_t pix, const QSize &size, int depth);
|
||||||
virtual bool load(const Pixmap& pix, const QSize& size, int depth);
|
|
||||||
|
|
||||||
Texture(TexturePrivate& dd);
|
Texture(TexturePrivate& dd);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue