本文整理汇总了C++中Extensions3D::canUseCopyTextureCHROMIUM方法的典型用法代码示例。如果您正苦于以下问题:C++ Extensions3D::canUseCopyTextureCHROMIUM方法的具体用法?C++ Extensions3D::canUseCopyTextureCHROMIUM怎么用?C++ Extensions3D::canUseCopyTextureCHROMIUM使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Extensions3D
的用法示例。
在下文中一共展示了Extensions3D::canUseCopyTextureCHROMIUM方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: copyToPlatformTexture
bool ImageBuffer::copyToPlatformTexture(GraphicsContext3D& context, Platform3DObject texture, GC3Denum internalFormat, GC3Denum destType, GC3Dint level, bool premultiplyAlpha, bool flipY)
{
if (!m_layerBridge || !platformLayer() || !isValid())
return false;
Platform3DObject sourceTexture = m_layerBridge->backBufferTexture();
if (!context.makeContextCurrent())
return false;
Extensions3D* extensions = context.extensions();
if (!extensions->supports("GL_CHROMIUM_copy_texture") || !extensions->supports("GL_CHROMIUM_flipy")
|| !extensions->canUseCopyTextureCHROMIUM(internalFormat, destType, level))
return false;
// The canvas is stored in a premultiplied format, so unpremultiply if necessary.
context.pixelStorei(Extensions3D::UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM, !premultiplyAlpha);
// The canvas is stored in an inverted position, so the flip semantics are reversed.
context.pixelStorei(Extensions3D::UNPACK_FLIP_Y_CHROMIUM, !flipY);
extensions->copyTextureCHROMIUM(GraphicsContext3D::TEXTURE_2D, sourceTexture, texture, level, internalFormat, destType);
context.pixelStorei(Extensions3D::UNPACK_FLIP_Y_CHROMIUM, false);
context.pixelStorei(Extensions3D::UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM, false);
context.flush();
return true;
}
示例2: copyVideoTextureToPlatformTexture
bool WebMediaPlayerClientImpl::copyVideoTextureToPlatformTexture(WebCore::GraphicsContext3D* context, Platform3DObject texture, GC3Dint level, GC3Denum type, GC3Denum internalFormat, bool premultiplyAlpha, bool flipY)
{
if (!context || !m_webMediaPlayer)
return false;
Extensions3D* extensions = context->extensions();
if (!extensions || !extensions->supports("GL_CHROMIUM_copy_texture") || !extensions->supports("GL_CHROMIUM_flipy")
|| !extensions->canUseCopyTextureCHROMIUM(internalFormat, type, level) || !context->makeContextCurrent())
return false;
WebGraphicsContext3D* webGraphicsContext3D = context->webContext();
return m_webMediaPlayer->copyVideoTextureToPlatformTexture(webGraphicsContext3D, texture, level, internalFormat, type, premultiplyAlpha, flipY);
}