本文整理汇总了C++中sk_sp::hasExtension方法的典型用法代码示例。如果您正苦于以下问题:C++ sk_sp::hasExtension方法的具体用法?C++ sk_sp::hasExtension怎么用?C++ sk_sp::hasExtension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sk_sp
的用法示例。
在下文中一共展示了sk_sp::hasExtension方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetString
std::unique_ptr<GrGLContext> GrGLContext::Make(sk_sp<const GrGLInterface> interface,
const GrContextOptions& options) {
if (!interface->validate()) {
return nullptr;
}
const GrGLubyte* verUByte;
GR_GL_CALL_RET(interface.get(), verUByte, GetString(GR_GL_VERSION));
const char* ver = reinterpret_cast<const char*>(verUByte);
const GrGLubyte* rendererUByte;
GR_GL_CALL_RET(interface.get(), rendererUByte, GetString(GR_GL_RENDERER));
const char* renderer = reinterpret_cast<const char*>(rendererUByte);
ConstructorArgs args;
args.fGLVersion = GrGLGetVersionFromString(ver);
if (GR_GL_INVALID_VER == args.fGLVersion) {
return nullptr;
}
if (!GrGLGetGLSLGeneration(interface.get(), &args.fGLSLGeneration)) {
return nullptr;
}
args.fVendor = GrGLGetVendor(interface.get());
args.fRenderer = GrGLGetRendererFromStrings(renderer, interface->fExtensions);
GrGLGetANGLEInfoFromString(renderer, &args.fANGLEBackend, &args.fANGLEVendor,
&args.fANGLERenderer);
/*
* Qualcomm drivers for the 3xx series have a horrendous bug with some drivers. Though they
* claim to support GLES 3.00, some perfectly valid GLSL300 shaders will only compile with
* #version 100, and will fail to compile with #version 300 es. In the long term, we
* need to lock this down to a specific driver version.
* ?????/2015 - This bug is still present in Lollipop pre-mr1
* 06/18/2015 - This bug does not affect the nexus 6 (which has an Adreno 4xx).
*/
if (kAdreno3xx_GrGLRenderer == args.fRenderer) {
args.fGLSLGeneration = k110_GrGLSLGeneration;
}
// Many ES3 drivers only advertise the ES2 image_external extension, but support the _essl3
// extension, and require that it be enabled to work with ESSL3. Other devices require the ES2
// extension to be enabled, even when using ESSL3. Some devices appear to only support the ES2
// extension. As an extreme (optional) solution, we can fallback to using ES2 shading language
// if we want to prioritize external texture support. skbug.com/7713
if (GR_IS_GR_GL_ES(interface->fStandard) &&
options.fPreferExternalImagesOverES3 &&
!options.fDisableDriverCorrectnessWorkarounds &&
interface->hasExtension("GL_OES_EGL_image_external") &&
args.fGLSLGeneration >= k330_GrGLSLGeneration &&
!interface->hasExtension("GL_OES_EGL_image_external_essl3") &&
!interface->hasExtension("OES_EGL_image_external_essl3")) {
args.fGLSLGeneration = k110_GrGLSLGeneration;
}
GrGLGetDriverInfo(interface->fStandard, args.fVendor, renderer, ver,
&args.fDriver, &args.fDriverVersion);
args.fContextOptions = &options;
args.fInterface = std::move(interface);
return std::unique_ptr<GrGLContext>(new GrGLContext(std::move(args)));
}