本文整理汇总了C++中GrGLContextInfo::vendor方法的典型用法代码示例。如果您正苦于以下问题:C++ GrGLContextInfo::vendor方法的具体用法?C++ GrGLContextInfo::vendor怎么用?C++ GrGLContextInfo::vendor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GrGLContextInfo
的用法示例。
在下文中一共展示了GrGLContextInfo::vendor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
bool GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
this->reset();
if (!ctxInfo.isInitialized()) {
return false;
}
GrGLStandard standard = ctxInfo.standard();
GrGLVersion version = ctxInfo.version();
/**************************************************************************
* Caps specific to GrGLCaps
**************************************************************************/
if (kGLES_GrGLStandard == standard) {
GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_VECTORS,
&fMaxFragmentUniformVectors);
} else {
SkASSERT(kGL_GrGLStandard == standard);
GrGLint max;
GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &max);
fMaxFragmentUniformVectors = max / 4;
if (version >= GR_GL_VER(3, 2)) {
GrGLint profileMask;
GR_GL_GetIntegerv(gli, GR_GL_CONTEXT_PROFILE_MASK, &profileMask);
fIsCoreProfile = SkToBool(profileMask & GR_GL_CONTEXT_CORE_PROFILE_BIT);
}
if (!fIsCoreProfile) {
GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_COORDS, &fMaxFixedFunctionTextureCoords);
// Sanity check
SkASSERT(fMaxFixedFunctionTextureCoords > 0 && fMaxFixedFunctionTextureCoords < 128);
}
}
GR_GL_GetIntegerv(gli, GR_GL_MAX_VERTEX_ATTRIBS, &fMaxVertexAttributes);
GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_IMAGE_UNITS, &fMaxFragmentTextureUnits);
if (kGL_GrGLStandard == standard) {
fRGBA8RenderbufferSupport = true;
} else {
fRGBA8RenderbufferSupport = version >= GR_GL_VER(3,0) ||
ctxInfo.hasExtension("GL_OES_rgb8_rgba8") ||
ctxInfo.hasExtension("GL_ARM_rgba8");
}
if (kGL_GrGLStandard == standard) {
fTextureSwizzleSupport = version >= GR_GL_VER(3,3) ||
ctxInfo.hasExtension("GL_ARB_texture_swizzle");
} else {
fTextureSwizzleSupport = version >= GR_GL_VER(3,0);
}
if (kGL_GrGLStandard == standard) {
fUnpackRowLengthSupport = true;
fUnpackFlipYSupport = false;
fPackRowLengthSupport = true;
fPackFlipYSupport = false;
} else {
fUnpackRowLengthSupport = version >= GR_GL_VER(3,0) ||
ctxInfo.hasExtension("GL_EXT_unpack_subimage");
fUnpackFlipYSupport = ctxInfo.hasExtension("GL_CHROMIUM_flipy");
fPackRowLengthSupport = version >= GR_GL_VER(3,0) ||
ctxInfo.hasExtension("GL_NV_pack_subimage");
fPackFlipYSupport =
ctxInfo.hasExtension("GL_ANGLE_pack_reverse_row_order");
}
fTextureUsageSupport = (kGLES_GrGLStandard == standard) &&
ctxInfo.hasExtension("GL_ANGLE_texture_usage");
if (kGL_GrGLStandard == standard) {
// The EXT version can apply to either GL or GLES.
fTexStorageSupport = version >= GR_GL_VER(4,2) ||
ctxInfo.hasExtension("GL_ARB_texture_storage") ||
ctxInfo.hasExtension("GL_EXT_texture_storage");
} else {
// Qualcomm Adreno drivers appear to have issues with texture storage.
fTexStorageSupport = (version >= GR_GL_VER(3,0) &&
kQualcomm_GrGLVendor != ctxInfo.vendor()) ||
ctxInfo.hasExtension("GL_EXT_texture_storage");
}
// ARB_texture_rg is part of OpenGL 3.0, but mesa doesn't support it if
// it doesn't have ARB_texture_rg extension.
if (kGL_GrGLStandard == standard) {
if (ctxInfo.isMesa()) {
fTextureRedSupport = ctxInfo.hasExtension("GL_ARB_texture_rg");
} else {
fTextureRedSupport = version >= GR_GL_VER(3,0) ||
ctxInfo.hasExtension("GL_ARB_texture_rg");
}
} else {
fTextureRedSupport = version >= GR_GL_VER(3,0) ||
ctxInfo.hasExtension("GL_EXT_texture_rg");
}
fImagingSupport = kGL_GrGLStandard == standard &&
ctxInfo.hasExtension("GL_ARB_imaging");
// ES 2 only guarantees RGBA/uchar + one other format/type combo for
// ReadPixels. The other format has to checked at run-time since it
//.........这里部分代码省略.........
示例2: init
void GrGLCaps::init(const GrGLContextInfo& ctxInfo) {
this->reset();
if (!ctxInfo.isInitialized()) {
return;
}
const GrGLInterface* gli = ctxInfo.interface();
GrGLBinding binding = ctxInfo.binding();
GrGLVersion version = ctxInfo.version();
if (kES2_GrGLBinding == binding) {
GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_VECTORS,
&fMaxFragmentUniformVectors);
} else {
GrAssert(kDesktop_GrGLBinding == binding);
GrGLint max;
GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &max);
fMaxFragmentUniformVectors = max / 4;
}
GR_GL_GetIntegerv(gli, GR_GL_MAX_VERTEX_ATTRIBS, &fMaxVertexAttributes);
if (kDesktop_GrGLBinding == binding) {
fRGBA8RenderbufferSupport = true;
} else {
fRGBA8RenderbufferSupport = ctxInfo.hasExtension("GL_OES_rgb8_rgba8") ||
ctxInfo.hasExtension("GL_ARM_rgba8");
}
if (kDesktop_GrGLBinding == binding) {
fBGRAFormatSupport = version >= GR_GL_VER(1,2) ||
ctxInfo.hasExtension("GL_EXT_bgra");
} else {
if (ctxInfo.hasExtension("GL_APPLE_texture_format_BGRA8888")) {
fBGRAFormatSupport = true;
} else if (ctxInfo.hasExtension("GL_EXT_texture_format_BGRA8888")) {
fBGRAFormatSupport = true;
fBGRAIsInternalFormat = true;
}
GrAssert(fBGRAFormatSupport ||
kSkia8888_GrPixelConfig != kBGRA_8888_GrPixelConfig);
}
if (kDesktop_GrGLBinding == binding) {
fTextureSwizzleSupport = version >= GR_GL_VER(3,3) ||
ctxInfo.hasExtension("GL_ARB_texture_swizzle");
} else {
fTextureSwizzleSupport = false;
}
if (kDesktop_GrGLBinding == binding) {
fUnpackRowLengthSupport = true;
fUnpackFlipYSupport = false;
fPackRowLengthSupport = true;
fPackFlipYSupport = false;
} else {
fUnpackRowLengthSupport =ctxInfo.hasExtension("GL_EXT_unpack_subimage");
fUnpackFlipYSupport = ctxInfo.hasExtension("GL_CHROMIUM_flipy");
// no extension for pack row length
fPackRowLengthSupport = false;
fPackFlipYSupport =
ctxInfo.hasExtension("GL_ANGLE_pack_reverse_row_order");
}
fTextureUsageSupport = (kES2_GrGLBinding == binding) &&
ctxInfo.hasExtension("GL_ANGLE_texture_usage");
// Tex storage is in desktop 4.2 and can be an extension to desktop or ES.
fTexStorageSupport = (kDesktop_GrGLBinding == binding &&
version >= GR_GL_VER(4,2)) ||
ctxInfo.hasExtension("GL_ARB_texture_storage") ||
ctxInfo.hasExtension("GL_EXT_texture_storage");
// ARB_texture_rg is part of OpenGL 3.0
if (kDesktop_GrGLBinding == binding) {
fTextureRedSupport = version >= GR_GL_VER(3,0) ||
ctxInfo.hasExtension("GL_ARB_texture_rg");
} else {
fTextureRedSupport = ctxInfo.hasExtension("GL_EXT_texture_rg");
}
fImagingSupport = kDesktop_GrGLBinding == binding &&
ctxInfo.hasExtension("GL_ARB_imaging");
// ES 2 only guarantees RGBA/uchar + one other format/type combo for
// ReadPixels. The other format has to checked at run-time since it
// can change based on which render target is bound
fTwoFormatLimit = kES2_GrGLBinding == binding;
// Known issue on at least some Intel platforms:
// http://code.google.com/p/skia/issues/detail?id=946
if (kIntel_GrGLVendor != ctxInfo.vendor()) {
fFragCoordsConventionSupport = ctxInfo.glslGeneration() >= k150_GrGLSLGeneration ||
ctxInfo.hasExtension("GL_ARB_fragment_coord_conventions");
}
this->initFSAASupport(ctxInfo);
this->initStencilFormats(ctxInfo);
}
示例3: init
bool GrGLSLCaps::init(const GrGLContextInfo& ctxInfo,
const GrGLInterface* gli,
const GrGLCaps& glCaps) {
this->reset();
if (!ctxInfo.isInitialized()) {
return false;
}
GrGLStandard standard = ctxInfo.standard();
GrGLVersion version = ctxInfo.version();
/**************************************************************************
* Caps specific to GrGLSLCaps
**************************************************************************/
if (kGLES_GrGLStandard == standard) {
if (ctxInfo.hasExtension("GL_EXT_shader_framebuffer_fetch")) {
fFBFetchNeedsCustomOutput = (version >= GR_GL_VER(3, 0));
fFBFetchSupport = true;
fFBFetchColorName = "gl_LastFragData[0]";
fFBFetchExtensionString = "GL_EXT_shader_framebuffer_fetch";
}
else if (ctxInfo.hasExtension("GL_NV_shader_framebuffer_fetch")) {
// Actually, we haven't seen an ES3.0 device with this extension yet, so we don't know
fFBFetchNeedsCustomOutput = false;
fFBFetchSupport = true;
fFBFetchColorName = "gl_LastFragData[0]";
fFBFetchExtensionString = "GL_NV_shader_framebuffer_fetch";
}
else if (ctxInfo.hasExtension("GL_ARM_shader_framebuffer_fetch")) {
// The arm extension also requires an additional flag which we will set onResetContext
fFBFetchNeedsCustomOutput = false;
fFBFetchSupport = true;
fFBFetchColorName = "gl_LastFragColorARM";
fFBFetchExtensionString = "GL_ARM_shader_framebuffer_fetch";
}
}
// Adreno GPUs have a tendency to drop tiles when there is a divide-by-zero in a shader
fDropsTileOnZeroDivide = kQualcomm_GrGLVendor == ctxInfo.vendor();
/**************************************************************************
* GrShaderCaps fields
**************************************************************************/
fPathRenderingSupport = ctxInfo.hasExtension("GL_NV_path_rendering");
if (fPathRenderingSupport) {
if (kGL_GrGLStandard == standard) {
// We only support v1.3+ of GL_NV_path_rendering which allows us to
// set individual fragment inputs with ProgramPathFragmentInputGen. The API
// additions are detected by checking the existence of the function.
fPathRenderingSupport = ctxInfo.hasExtension("GL_EXT_direct_state_access") &&
((ctxInfo.version() >= GR_GL_VER(4, 3) ||
ctxInfo.hasExtension("GL_ARB_program_interface_query")) &&
gli->fFunctions.fProgramPathFragmentInputGen);
}
else {
fPathRenderingSupport = ctxInfo.version() >= GR_GL_VER(3, 1);
}
}
// For now these two are equivalent but we could have dst read in shader via some other method
fDstReadInShaderSupport = fFBFetchSupport;
// Enable supported shader-related caps
if (kGL_GrGLStandard == standard) {
fDualSourceBlendingSupport = ctxInfo.version() >= GR_GL_VER(3, 3) ||
ctxInfo.hasExtension("GL_ARB_blend_func_extended");
fShaderDerivativeSupport = true;
// we don't support GL_ARB_geometry_shader4, just GL 3.2+ GS
fGeometryShaderSupport = ctxInfo.version() >= GR_GL_VER(3, 2) &&
ctxInfo.glslGeneration() >= k150_GrGLSLGeneration;
}
else {
fShaderDerivativeSupport = ctxInfo.version() >= GR_GL_VER(3, 0) ||
ctxInfo.hasExtension("GL_OES_standard_derivatives");
}
if (glCaps.advancedBlendEquationSupport()) {
bool coherent = glCaps.advancedCoherentBlendEquationSupport();
if (ctxInfo.hasExtension(coherent ? "GL_NV_blend_equation_advanced_coherent"
: "GL_NV_blend_equation_advanced")) {
fAdvBlendEqInteraction = kAutomatic_AdvBlendEqInteraction;
} else {
fAdvBlendEqInteraction = kGeneralEnable_AdvBlendEqInteraction;
// TODO: Use the following on any platform where "blend_support_all_equations" is slow.
//fAdvBlendEqInteraction = kSpecificEnables_AdvBlendEqInteraction;
}
}
this->initShaderPrecisionTable(ctxInfo, gli);
return true;
}
示例4: init
void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
this->reset();
if (!ctxInfo.isInitialized()) {
return;
}
GrGLBinding binding = ctxInfo.binding();
GrGLVersion version = ctxInfo.version();
/**************************************************************************
* Caps specific to GrGLCaps
**************************************************************************/
if (kES2_GrGLBinding == binding) {
GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_VECTORS,
&fMaxFragmentUniformVectors);
} else {
GrAssert(kDesktop_GrGLBinding == binding);
GrGLint max;
GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &max);
fMaxFragmentUniformVectors = max / 4;
}
GR_GL_GetIntegerv(gli, GR_GL_MAX_VERTEX_ATTRIBS, &fMaxVertexAttributes);
if (kDesktop_GrGLBinding == binding) {
fRGBA8RenderbufferSupport = true;
} else {
fRGBA8RenderbufferSupport = ctxInfo.hasExtension("GL_OES_rgb8_rgba8") ||
ctxInfo.hasExtension("GL_ARM_rgba8");
}
if (kDesktop_GrGLBinding == binding) {
fBGRAFormatSupport = version >= GR_GL_VER(1,2) ||
ctxInfo.hasExtension("GL_EXT_bgra");
} else {
if (ctxInfo.hasExtension("GL_APPLE_texture_format_BGRA8888")) {
fBGRAFormatSupport = true;
} else if (ctxInfo.hasExtension("GL_EXT_texture_format_BGRA8888")) {
fBGRAFormatSupport = true;
fBGRAIsInternalFormat = true;
}
GrAssert(fBGRAFormatSupport ||
kSkia8888_GrPixelConfig != kBGRA_8888_GrPixelConfig);
}
if (kDesktop_GrGLBinding == binding) {
fTextureSwizzleSupport = version >= GR_GL_VER(3,3) ||
ctxInfo.hasExtension("GL_ARB_texture_swizzle");
} else {
fTextureSwizzleSupport = false;
}
if (kDesktop_GrGLBinding == binding) {
fUnpackRowLengthSupport = true;
fUnpackFlipYSupport = false;
fPackRowLengthSupport = true;
fPackFlipYSupport = false;
} else {
fUnpackRowLengthSupport =ctxInfo.hasExtension("GL_EXT_unpack_subimage");
fUnpackFlipYSupport = ctxInfo.hasExtension("GL_CHROMIUM_flipy");
// no extension for pack row length
fPackRowLengthSupport = false;
fPackFlipYSupport =
ctxInfo.hasExtension("GL_ANGLE_pack_reverse_row_order");
}
fTextureUsageSupport = (kES2_GrGLBinding == binding) &&
ctxInfo.hasExtension("GL_ANGLE_texture_usage");
// Tex storage is in desktop 4.2 and can be an extension to desktop or ES.
fTexStorageSupport = (kDesktop_GrGLBinding == binding &&
version >= GR_GL_VER(4,2)) ||
ctxInfo.hasExtension("GL_ARB_texture_storage") ||
ctxInfo.hasExtension("GL_EXT_texture_storage");
// ARB_texture_rg is part of OpenGL 3.0
if (kDesktop_GrGLBinding == binding) {
fTextureRedSupport = version >= GR_GL_VER(3,0) ||
ctxInfo.hasExtension("GL_ARB_texture_rg");
} else {
fTextureRedSupport = ctxInfo.hasExtension("GL_EXT_texture_rg");
}
fImagingSupport = kDesktop_GrGLBinding == binding &&
ctxInfo.hasExtension("GL_ARB_imaging");
// ES 2 only guarantees RGBA/uchar + one other format/type combo for
// ReadPixels. The other format has to checked at run-time since it
// can change based on which render target is bound
fTwoFormatLimit = kES2_GrGLBinding == binding;
// Known issue on at least some Intel platforms:
// http://code.google.com/p/skia/issues/detail?id=946
if (kIntel_GrGLVendor != ctxInfo.vendor()) {
fFragCoordsConventionSupport = ctxInfo.glslGeneration() >= k150_GrGLSLGeneration ||
ctxInfo.hasExtension("GL_ARB_fragment_coord_conventions");
}
// SGX and Mali GPUs that are based on a tiled-deferred architecture that have trouble with
//.........这里部分代码省略.........