Commit 62d0299a authored by Martin Flöser's avatar Martin Flöser

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.
parent 4f445a75
......@@ -530,25 +530,7 @@ bool GLTexture::load( const QPixmap& pixmap, GLenum target )
{
if( pixmap.isNull())
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 );
#endif
}
bool GLTexture::load( const QString& fileName )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment