diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-06-17 18:59:23 -0700 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-06-17 18:59:23 -0700 |
commit | e5fda342bac55a61969d2b6b1fde246dcd2c21a1 (patch) | |
tree | f31d17ec6020b2ffe7bf69800f20d16eaa2baa20 | |
parent | ec12f217b8d9022ef9f70d510dbede9881d30289 (diff) |
Wayland: createImage changes
We only support EGL, so don't bother with VG. Fixup the image creation
and draw some test data into it for debugging, and add debug code for
successful image creation.
-rw-r--r-- | src/gui/egl/qegl_wayland.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/gui/egl/qegl_wayland.cpp b/src/gui/egl/qegl_wayland.cpp index 03385d3271..367ec9d376 100644 --- a/src/gui/egl/qegl_wayland.cpp +++ b/src/gui/egl/qegl_wayland.cpp @@ -73,14 +73,8 @@ bool QEglContext::makeCurrent(EGLImageKHR img) // Force the right API to be bound before making the context current. // The EGL implementation should be able to figure this out from ctx, // but some systems require the API to be explicitly set anyway. -#ifdef EGL_OPENGL_ES_API if (apiType == QEgl::OpenGL) eglBindAPI(EGL_OPENGL_ES_API); -#endif -#ifdef EGL_OPENVG_API - if (apiType == QEgl::OpenVG) - eglBindAPI(EGL_OPENVG_API); -#endif bool ok = eglMakeCurrent(QEgl::display(), NULL, NULL, ctx); if (!ok) @@ -92,9 +86,15 @@ bool QEglContext::makeCurrent(EGLImageKHR img) glGenRenderbuffers(1, &wl_color_rbo); glBindRenderbuffer(GL_RENDERBUFFER, wl_color_rbo); + QEgl::glEGLImageTargetRenderbufferStorage(GL_RENDERBUFFER, currentImage); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, wl_color_rbo); - QEgl::glEGLImageTargetRenderbufferStorage(GL_RENDERBUFFER, currentImage); + + glViewport(0, 0, 100, 100); + glClearColor(1.0f, 0.0f, 0.0f, 0.0f); + glClear(GL_COLOR_BUFFER_BIT); + glFinish(); return ok; } @@ -197,6 +197,8 @@ EGLImageKHR QEgl::createImage(QPaintDevice *device, EGLConfig cfg, if (!img) { qWarning("failed to create EGL image: %d\n", eglGetError()); return NULL; + } else { + qWarning("created EGL image %dx%d\n", attribs[1], attribs[3]); } return img; } |