summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@digia.com>2014-09-23 16:47:17 +0200
committerYoann Lopes <yoann.lopes@digia.com>2014-09-24 14:10:08 +0200
commit78dccc998f51fad51caa6dc220fbfdf14ed5c113 (patch)
tree43ec7c4e49c4f5bfc9cf9aad867bbb80043b195c /src
parentf788f8e5c65a3d07a64d1507cc21714292dc6efd (diff)
WMF: fix video rendering with ANGLE.
The format of the offscreen surface used for video rendering should be compatible with the EGL config. Change-Id: Ic016245ce80c2483771e620c3eed345262d03c44 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/wmf/evrd3dpresentengine.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/wmf/evrd3dpresentengine.cpp b/src/plugins/wmf/evrd3dpresentengine.cpp
index bc27a7e0c..2aa9d0d64 100644
--- a/src/plugins/wmf/evrd3dpresentengine.cpp
+++ b/src/plugins/wmf/evrd3dpresentengine.cpp
@@ -419,18 +419,19 @@ void D3DPresentEngine::createOffscreenTexture()
QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface();
m_eglDisplay = static_cast<EGLDisplay*>(
nativeInterface->nativeResourceForContext("eglDisplay", currentContext));
- m_eglConfig = static_cast<EGLDisplay*>(
+ m_eglConfig = static_cast<EGLConfig*>(
nativeInterface->nativeResourceForContext("eglConfig", currentContext));
currentContext->functions()->glGenTextures(1, &m_glTexture);
int w = m_surfaceFormat.frameWidth();
int h = m_surfaceFormat.frameHeight();
+ bool hasAlpha = currentContext->format().hasAlpha();
EGLint attribs[] = {
EGL_WIDTH, w,
EGL_HEIGHT, h,
- EGL_TEXTURE_FORMAT, EGL_TEXTURE_RGB,
+ EGL_TEXTURE_FORMAT, hasAlpha ? EGL_TEXTURE_RGBA : EGL_TEXTURE_RGB,
EGL_TEXTURE_TARGET, EGL_TEXTURE_2D,
EGL_NONE
};
@@ -449,7 +450,7 @@ void D3DPresentEngine::createOffscreenTexture()
m_device->CreateTexture(w, h, 1,
D3DUSAGE_RENDERTARGET,
- D3DFMT_X8R8G8B8,
+ hasAlpha ? D3DFMT_A8R8G8B8 : D3DFMT_X8R8G8B8,
D3DPOOL_DEFAULT,
&m_texture,
&share_handle);