Don't assert if glCheckFramebufferStatus fails

This can fail if the context has been reset or abandoned. Instead return
false so the caller print a warning message and skip rendering.

Bug: chromium:1235232
Bug: skia:12258
Bug: skia:5200
Change-Id: If78a914a25d09d48477e04317a34473632f76207
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435816
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This commit is contained in:
Chris Dalton 2021-08-02 12:19:12 -06:00 committed by SkCQ
parent 9eca2ca0c6
commit 289750a231

View File

@ -170,11 +170,12 @@ bool GrGLRenderTarget::completeStencilAttachment(GrAttachment* stencil, bool use
#ifdef SK_DEBUG
if (!gpu->glCaps().skipErrorChecks()) {
// 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);
if (status != GR_GL_FRAMEBUFFER_COMPLETE) {
// This can fail if the context has been asynchronously abandoned (see skbug.com/5200).
return false;
}
}
#endif