本文整理汇总了C++中GrGLGpu::invalidateBoundRenderTarget方法的典型用法代码示例。如果您正苦于以下问题:C++ GrGLGpu::invalidateBoundRenderTarget方法的具体用法?C++ GrGLGpu::invalidateBoundRenderTarget怎么用?C++ GrGLGpu::invalidateBoundRenderTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GrGLGpu
的用法示例。
在下文中一共展示了GrGLGpu::invalidateBoundRenderTarget方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: completeStencilAttachment
bool GrGLRenderTarget::completeStencilAttachment() {
GrGLGpu* gpu = this->getGLGpu();
const GrGLInterface* interface = gpu->glInterface();
GrStencilAttachment* stencil = this->renderTargetPriv().getStencilAttachment();
if (nullptr == stencil) {
GR_GL_CALL(interface, FramebufferRenderbuffer(GR_GL_FRAMEBUFFER,
GR_GL_STENCIL_ATTACHMENT,
GR_GL_RENDERBUFFER, 0));
GR_GL_CALL(interface, FramebufferRenderbuffer(GR_GL_FRAMEBUFFER,
GR_GL_DEPTH_ATTACHMENT,
GR_GL_RENDERBUFFER, 0));
#ifdef SK_DEBUG
if (kChromium_GrGLDriver != gpu->glContext().driver()) {
// This check can cause problems in Chromium if the context has been asynchronously
// abandoned (see skbug.com/5200)
GrGLenum status;
GR_GL_CALL_RET(interface, status, CheckFramebufferStatus(GR_GL_FRAMEBUFFER));
SkASSERT(GR_GL_FRAMEBUFFER_COMPLETE == status);
}
#endif
return true;
} else {
const GrGLStencilAttachment* glStencil = static_cast<const GrGLStencilAttachment*>(stencil);
GrGLuint rb = glStencil->renderbufferID();
gpu->invalidateBoundRenderTarget();
gpu->stats()->incRenderTargetBinds();
GR_GL_CALL(interface, BindFramebuffer(GR_GL_FRAMEBUFFER, this->renderFBOID()));
GR_GL_CALL(interface, FramebufferRenderbuffer(GR_GL_FRAMEBUFFER,
GR_GL_STENCIL_ATTACHMENT,
GR_GL_RENDERBUFFER, rb));
if (glStencil->format().fPacked) {
GR_GL_CALL(interface, FramebufferRenderbuffer(GR_GL_FRAMEBUFFER,
GR_GL_DEPTH_ATTACHMENT,
GR_GL_RENDERBUFFER, rb));
} else {
GR_GL_CALL(interface, FramebufferRenderbuffer(GR_GL_FRAMEBUFFER,
GR_GL_DEPTH_ATTACHMENT,
GR_GL_RENDERBUFFER, 0));
}
#ifdef SK_DEBUG
if (kChromium_GrGLDriver != gpu->glContext().driver()) {
// This check can cause problems in Chromium if the context has been asynchronously
// abandoned (see skbug.com/5200)
GrGLenum status;
GR_GL_CALL_RET(interface, status, CheckFramebufferStatus(GR_GL_FRAMEBUFFER));
SkASSERT(GR_GL_FRAMEBUFFER_COMPLETE == status);
}
#endif
return true;
}
}