Need to copy QPixmap to QImage in GLES.
The Image extension seems to need the pixmap around and that's something we cannot guarantee in the generic case.
This commit is contained in:
parent
c5c318a342
commit
61615ea7ff
1 changed files with 0 additions and 18 deletions
|
@ -530,25 +530,7 @@ bool GLTexture::load( const QPixmap& pixmap, GLenum target )
|
||||||
{
|
{
|
||||||
if( pixmap.isNull())
|
if( pixmap.isNull())
|
||||||
return false;
|
return false;
|
||||||
#ifdef KWIN_HAVE_OPENGLES
|
|
||||||
if( isNull() )
|
|
||||||
glGenTextures( 1, &mTexture );
|
|
||||||
mTarget = target;
|
|
||||||
bind();
|
|
||||||
const EGLint attribs[] = {
|
|
||||||
EGL_IMAGE_PRESERVED_KHR, EGL_TRUE,
|
|
||||||
EGL_NONE
|
|
||||||
};
|
|
||||||
EGLDisplay dpy = eglGetCurrentDisplay();
|
|
||||||
EGLImageKHR image = eglCreateImageKHR(dpy, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR,
|
|
||||||
(EGLClientBuffer)pixmap.handle(), attribs);
|
|
||||||
glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, (GLeglImageOES)image);
|
|
||||||
eglDestroyImageKHR(dpy, image);
|
|
||||||
unbind();
|
|
||||||
return true;
|
|
||||||
#else
|
|
||||||
return load( pixmap.toImage(), target );
|
return load( pixmap.toImage(), target );
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GLTexture::load( const QString& fileName )
|
bool GLTexture::load( const QString& fileName )
|
||||||
|
|
Loading…
Reference in a new issue