Comments
Patch
@@ -329,6 +329,8 @@ QRegion SceneOpenGL::Texture::optimizeBindDamage(const QRegion& reg, int limit)
bool SceneOpenGL::Texture::load(const Pixmap& pix, const QSize& size,
int depth)
{
+ if (pix == None)
+ return false;
return load(pix, size, depth,
QRegion(0, 0, size.width(), size.height()));
}
@@ -232,6 +232,10 @@ bool SceneOpenGL::Texture::load(const Pixmap& pix, const QSize& size,
Q_UNUSED(size)
Q_UNUSED(depth)
Q_UNUSED(region)
+
+ if (pix == None)
+ return false;
+
if (mTexture == None) {
createTexture();
bind();
@@ -245,6 +249,12 @@ bool SceneOpenGL::Texture::load(const Pixmap& pix, const QSize& size,
};
EGLImageKHR image = eglCreateImageKHR(dpy, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR,
(EGLClientBuffer)pix, attribs);
+
+ if (EGL_NO_IMAGE_KHR == image) {
+ kDebug(1212) << "failed to create egl image";
+ unbind();
+ return false;
+ }
glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, (GLeglImageOES)image);
eglDestroyImageKHR(dpy, image);
unbind();