本文整理汇总了C++中GLContext::GetPreferredEGLImageTextureTarget方法的典型用法代码示例。如果您正苦于以下问题:C++ GLContext::GetPreferredEGLImageTextureTarget方法的具体用法?C++ GLContext::GetPreferredEGLImageTextureTarget怎么用?C++ GLContext::GetPreferredEGLImageTextureTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GLContext
的用法示例。
在下文中一共展示了GLContext::GetPreferredEGLImageTextureTarget方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EGLImageTextureSource
bool
EGLImageTextureHost::Lock()
{
GLContext* gl = this->gl();
if (!gl || !gl->MakeCurrent()) {
return false;
}
EGLint status = LOCAL_EGL_CONDITION_SATISFIED;
if (mSync) {
MOZ_ASSERT(sEGLLibrary.IsExtensionSupported(GLLibraryEGL::KHR_fence_sync));
status = sEGLLibrary.fClientWaitSync(EGL_DISPLAY(), mSync, 0, LOCAL_EGL_FOREVER);
}
if (status != LOCAL_EGL_CONDITION_SATISFIED) {
MOZ_ASSERT(status != 0,
"ClientWaitSync generated an error. Has mSync already been destroyed?");
return false;
}
if (!mTextureSource) {
gfx::SurfaceFormat format = mHasAlpha ? gfx::SurfaceFormat::R8G8B8A8
: gfx::SurfaceFormat::R8G8B8X8;
GLenum target = gl->GetPreferredEGLImageTextureTarget();
GLenum wrapMode = LOCAL_GL_CLAMP_TO_EDGE;
mTextureSource = new EGLImageTextureSource(mProvider,
mImage,
format,
target,
wrapMode,
mSize);
}
return true;
}