summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl
diff options
context:
space:
mode:
authorElvis Lee <kwangwoong.lee@lge.com>2021-01-28 17:16:04 +0900
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-03-09 11:58:12 +0100
commit7a68aa6fc753bcf07a4024aa08807823630b444b (patch)
tree682418112b734e621c3296c4b59933e34b7d81b1 /src/gui/opengl
parent2f9a3352b25417845375c47382f6e5fe931c157a (diff)
Support EGL protected content extension
A protected context is required to allow the GPU to operate on protected resources, including protected surfaces and protected EGLImages. For example, GPU can post-process on protected content like DRM protected content so that complex, nonlinear video effects or mapping onto textures can be used. The surface format option may be relevant for DirectX and Vulkan in the future: https://microsoft.github.io/DirectX-Specs/d3d/ProtectedResources.html https://www.khronos.org/registry/vulkan/specs/1.1-khr-extensions/html/chap12.html#memory-protected-memory Change-Id: I2d155f0e68b830276690b4833b22a2bc452cdcad Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/gui/opengl')
-rw-r--r--src/gui/opengl/platform/egl/qeglplatformcontext.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/opengl/platform/egl/qeglplatformcontext.cpp b/src/gui/opengl/platform/egl/qeglplatformcontext.cpp
index 47e0b890d8..5727b94aa2 100644
--- a/src/gui/opengl/platform/egl/qeglplatformcontext.cpp
+++ b/src/gui/opengl/platform/egl/qeglplatformcontext.cpp
@@ -155,6 +155,17 @@ QEGLPlatformContext::QEGLPlatformContext(const QSurfaceFormat &format, QPlatform
}
}
+#ifdef EGL_EXT_protected_content
+ if (format.testOption(QSurfaceFormat::ProtectedContent)) {
+ if (q_hasEglExtension(m_eglDisplay, "EGL_EXT_protected_content")) {
+ contextAttrs.append(EGL_PROTECTED_CONTENT_EXT);
+ contextAttrs.append(EGL_TRUE);
+ } else {
+ m_format.setOption(QSurfaceFormat::ProtectedContent, false);
+ }
+ }
+#endif
+
// Special Options for OpenVG surfaces
if (m_format.renderableType() == QSurfaceFormat::OpenVG) {
contextAttrs.append(EGL_ALPHA_MASK_SIZE);