本文整理匯總了C++中GL_CALL函數的典型用法代碼示例。如果您正苦於以下問題:C++ GL_CALL函數的具體用法?C++ GL_CALL怎麽用?C++ GL_CALL使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GL_CALL函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: GL_CALL
void GrGLVertexBuffer::onRelease() {
// make sure we've not been abandoned
if (fBufferID) {
GPUGL->notifyVertexBufferDelete(this);
GL_CALL(DeleteBuffers(1, &fBufferID));
fBufferID = 0;
}
}
示例2: GL_CALL
void GrGLRenderTarget::onRelease() {
if (GrBackendObjectOwnership::kBorrowed != fRTFBOOwnership) {
if (fTexFBOID) {
GL_CALL(DeleteFramebuffers(1, &fTexFBOID));
}
if (fRTFBOID && fRTFBOID != fTexFBOID) {
GL_CALL(DeleteFramebuffers(1, &fRTFBOID));
}
if (fMSColorRenderbufferID) {
GL_CALL(DeleteRenderbuffers(1, &fMSColorRenderbufferID));
}
}
fRTFBOID = 0;
fTexFBOID = 0;
fMSColorRenderbufferID = 0;
INHERITED::onRelease();
}
示例3: GL_CALL
/*
Deletes the GL texture
*/
void Texture::deleteGLTex()
{
if (texName)
{
GL_CALL(glDeleteTextures(1, &texName));//Invalid operation?
texName = 0;
}
}
示例4: GL_CALL
void GrGLPathRendering::resetContext() {
fHWProjectionMatrixState.invalidate();
// we don't use the model view matrix.
GrGLenum matrixMode =
fGpu->glStandard() == kGLES_GrGLStandard ? GR_GL_PATH_MODELVIEW : GR_GL_MODELVIEW;
GL_CALL(MatrixLoadIdentity(matrixMode));
if (!caps().fragmentInputGenSupport) {
for (int i = 0; i < fGpu->glCaps().maxFixedFunctionTextureCoords(); ++i) {
GL_CALL(PathTexGen(GR_GL_TEXTURE0 + i, GR_GL_NONE, 0, NULL));
fHWPathTexGenSettings[i].fMode = GR_GL_NONE;
fHWPathTexGenSettings[i].fNumComponents = 0;
}
fHWActivePathTexGenSets = 0;
}
fHWPathStencilSettings.invalidate();
}
示例5: GL_CALL
void GrGLRenderTarget::onRelease() {
if (kBorrowed_LifeCycle != fRTLifecycle) {
if (fTexFBOID) {
GL_CALL(DeleteFramebuffers(1, &fTexFBOID));
}
if (fRTFBOID && fRTFBOID != fTexFBOID) {
GL_CALL(DeleteFramebuffers(1, &fRTFBOID));
}
if (fMSColorRenderbufferID) {
GL_CALL(DeleteRenderbuffers(1, &fMSColorRenderbufferID));
}
}
fRTFBOID = 0;
fTexFBOID = 0;
fMSColorRenderbufferID = 0;
INHERITED::onRelease();
}
示例6: GL_CALL
void GrGLPath::onRelease() {
if (0 != fPathID && !this->isWrapped()) {
GL_CALL(DeletePaths(fPathID, 1));
fPathID = 0;
}
INHERITED::onRelease();
}
開發者ID:IllusionRom-deprecated,項目名稱:android_platform_external_chromium_org_third_party_skia_src,代碼行數:8,代碼來源:GrGLPath.cpp
示例7: GL_CALL
void GrGLVertexArray::onRelease() {
if (0 != fID) {
GL_CALL(DeleteVertexArrays(1, &fID));
GPUGL->notifyVertexArrayDelete(fID);
fID = 0;
}
INHERITED::onRelease();
}
示例8: switch
void GrGpuGLShaders::flushColor(GrColor color) {
const ProgramDesc& desc = fCurrentProgram.getDesc();
const GrDrawState& drawState = this->getDrawState();
if (this->getGeomSrc().fVertexLayout & kColor_VertexLayoutBit) {
// color will be specified per-vertex as an attribute
// invalidate the const vertex attrib color
fHWDrawState.setColor(GrColor_ILLEGAL);
} else {
switch (desc.fColorInput) {
case ProgramDesc::kAttribute_ColorInput:
if (fHWDrawState.getColor() != color) {
// OpenGL ES only supports the float varities of glVertexAttrib
float c[] = GR_COLOR_TO_VEC4(color);
GL_CALL(VertexAttrib4fv(GrGLProgram::ColorAttributeIdx(),
c));
fHWDrawState.setColor(color);
}
break;
case ProgramDesc::kUniform_ColorInput:
if (fProgramData->fColor != color) {
// OpenGL ES only supports the float varities of glVertexAttrib
float c[] = GR_COLOR_TO_VEC4(color);
GrAssert(GrGLProgram::kUnusedUniform !=
fProgramData->fUniLocations.fColorUni);
GL_CALL(Uniform4fv(fProgramData->fUniLocations.fColorUni,
1, c));
fProgramData->fColor = color;
}
break;
case ProgramDesc::kSolidWhite_ColorInput:
case ProgramDesc::kTransBlack_ColorInput:
break;
default:
GrCrash("Unknown color type.");
}
}
if (fProgramData->fUniLocations.fColorFilterUni
!= GrGLProgram::kUnusedUniform
&& fProgramData->fColorFilterColor
!= drawState.getColorFilterColor()) {
float c[] = GR_COLOR_TO_VEC4(drawState.getColorFilterColor());
GL_CALL(Uniform4fv(fProgramData->fUniLocations.fColorFilterUni, 1, c));
fProgramData->fColorFilterColor = drawState.getColorFilterColor();
}
}
示例9: set_program
static void
set_program(struct ctx *context, enum program_type type)
{
assert(context && type >= 0 && type < PROGRAM_LAST);
context->program = &context->programs[type];
GL_CALL(glUseProgram(context->program->obj));
}
示例10: GL_CALL
GrGLProgram::~GrGLProgram() {
if (fProgramID) {
GL_CALL(DeleteProgram(fProgramID));
}
for (int i = 0; i < fFragmentProcessors.count(); ++i) {
delete fFragmentProcessors[i];
}
}
示例11: SkASSERT
bool GrGLShaderBuilder::finish() {
SkASSERT(0 == fOutput.fProgramID);
GL_CALL_RET(fOutput.fProgramID, CreateProgram());
if (!fOutput.fProgramID) {
return false;
}
SkTDArray<GrGLuint> shadersToDelete;
if (!this->compileAndAttachShaders(fOutput.fProgramID, &shadersToDelete)) {
GL_CALL(DeleteProgram(fOutput.fProgramID));
return false;
}
this->bindProgramLocations(fOutput.fProgramID);
if (fUniformManager->isUsingBindUniform()) {
fUniformManager->getUniformLocations(fOutput.fProgramID, fUniforms);
}
GL_CALL(LinkProgram(fOutput.fProgramID));
// Calling GetProgramiv is expensive in Chromium. Assume success in release builds.
bool checkLinked = !fGpu->ctxInfo().isChromium();
#ifdef SK_DEBUG
checkLinked = true;
#endif
if (checkLinked) {
GrGLint linked = GR_GL_INIT_ZERO;
GL_CALL(GetProgramiv(fOutput.fProgramID, GR_GL_LINK_STATUS, &linked));
if (!linked) {
GrGLint infoLen = GR_GL_INIT_ZERO;
GL_CALL(GetProgramiv(fOutput.fProgramID, GR_GL_INFO_LOG_LENGTH, &infoLen));
SkAutoMalloc log(sizeof(char)*(infoLen+1)); // outside if for debugger
if (infoLen > 0) {
// retrieve length even though we don't need it to workaround
// bug in chrome cmd buffer param validation.
GrGLsizei length = GR_GL_INIT_ZERO;
GL_CALL(GetProgramInfoLog(fOutput.fProgramID,
infoLen+1,
&length,
(char*)log.get()));
GrPrintf((char*)log.get());
}
SkDEBUGFAIL("Error linking program");
GL_CALL(DeleteProgram(fOutput.fProgramID));
fOutput.fProgramID = 0;
return false;
}
}
if (!fUniformManager->isUsingBindUniform()) {
fUniformManager->getUniformLocations(fOutput.fProgramID, fUniforms);
}
for (int i = 0; i < shadersToDelete.count(); ++i) {
GL_CALL(DeleteShader(shadersToDelete[i]));
}
return true;
}
示例12: switch
void Mesh::UnSetAttributes(const Attribute *attributes) {
for (;;) {
switch (*attributes++) {
case kPosition3f:
GL_CALL(glDisableVertexAttribArray(kAttributePosition));
break;
case kNormal3f:
GL_CALL(glDisableVertexAttribArray(kAttributeNormal));
break;
case kTangent4f:
GL_CALL(glDisableVertexAttribArray(kAttributeTangent));
break;
case kTexCoord2f:
GL_CALL(glDisableVertexAttribArray(kAttributeTexCoord));
break;
case kColor4ub:
GL_CALL(glDisableVertexAttribArray(kAttributeColor));
break;
case kBoneIndices4ub:
GL_CALL(glDisableVertexAttribArray(kAttributeBoneIndices));
break;
case kBoneWeights4ub:
GL_CALL(glDisableVertexAttribArray(kAttributeBoneWeights));
break;
case kEND:
return;
}
}
}
示例13: GL_CALL
void GrGLUniformHandler::bindUniformLocations(GrGLuint programID, const GrGLCaps& caps) {
if (caps.bindUniformLocationSupport()) {
int count = fUniforms.count();
for (int i = 0; i < count; ++i) {
GL_CALL(BindUniformLocation(programID, i, fUniforms[i].fVariable.c_str()));
fUniforms[i].fLocation = i;
}
}
}
示例14: GrAssert
void GrGLIndexBuffer::unlock() {
GrAssert(fBufferID);
GrAssert(isLocked());
GrAssert(this->getGpu()->getCaps().fBufferLockSupport);
this->bind();
GL_CALL(UnmapBuffer(GR_GL_ELEMENT_ARRAY_BUFFER));
fLockPtr = NULL;
}
示例15: GL_CALL
void GrGLTexture::onRelease() {
if (fInfo.fID) {
if (GrBackendObjectOwnership::kBorrowed != fTextureIDOwnership) {
GL_CALL(DeleteTextures(1, &fInfo.fID));
}
fInfo.fID = 0;
}
INHERITED::onRelease();
}