本文整理汇总了C++中GrGLGpu::gpuStats方法的典型用法代码示例。如果您正苦于以下问题:C++ GrGLGpu::gpuStats方法的具体用法?C++ GrGLGpu::gpuStats怎么用?C++ GrGLGpu::gpuStats使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GrGLGpu
的用法示例。
在下文中一共展示了GrGLGpu::gpuStats方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: compileAndAttachShaders
bool GrGLFragmentShaderBuilder::compileAndAttachShaders(GrGLuint programId,
SkTDArray<GrGLuint>* shaderIds) const {
GrGLGpu* gpu = fProgramBuilder->gpu();
SkString fragShaderSrc(GrGetGLSLVersionDecl(gpu->ctxInfo()));
fragShaderSrc.append(fExtensions);
append_default_precision_qualifier(kDefault_GrSLPrecision,
gpu->glStandard(),
&fragShaderSrc);
fProgramBuilder->appendUniformDecls(GrGLProgramBuilder::kFragment_Visibility, &fragShaderSrc);
this->appendDecls(fInputs, &fragShaderSrc);
// We shouldn't have declared outputs on 1.10
SkASSERT(k110_GrGLSLGeneration != gpu->glslGeneration() || fOutputs.empty());
this->appendDecls(fOutputs, &fragShaderSrc);
fragShaderSrc.append(fFunctions);
fragShaderSrc.append("void main() {\n");
fragShaderSrc.append(fCode);
fragShaderSrc.append("}\n");
GrGLuint fragShaderId = GrGLCompileAndAttachShader(gpu->glContext(), programId,
GR_GL_FRAGMENT_SHADER, fragShaderSrc,
gpu->gpuStats());
if (!fragShaderId) {
return false;
}
*shaderIds->append() = fragShaderId;
return true;
}
示例2: compileAndAttachShaders
bool GrGLVertexBuilder::compileAndAttachShaders(GrGLuint programId,
SkTDArray<GrGLuint>* shaderIds) const {
GrGLGpu* gpu = fProgramBuilder->gpu();
const GrGLContext& glCtx = gpu->glContext();
const GrGLContextInfo& ctxInfo = gpu->ctxInfo();
SkString vertShaderSrc(GrGetGLSLVersionDecl(ctxInfo));
fProgramBuilder->appendUniformDecls(GrGLProgramBuilder::kVertex_Visibility, &vertShaderSrc);
this->appendDecls(fInputs, &vertShaderSrc);
this->appendDecls(fOutputs, &vertShaderSrc);
vertShaderSrc.append("void main() {");
vertShaderSrc.append(fCode);
vertShaderSrc.append("}\n");
GrGLuint vertShaderId = GrGLCompileAndAttachShader(glCtx, programId,
GR_GL_VERTEX_SHADER, vertShaderSrc,
gpu->gpuStats());
if (!vertShaderId) {
return false;
}
*shaderIds->append() = vertShaderId;
return true;
}