Workaround freeze on Mac Chrome when checking read pixel config support.
Chromium may ask us to read back from locked IOSurfaces. Calling the command buffer's glGetIntegerv() with GL_IMPLEMENTATION_COLOR_READ_FORMAT/_TYPE causes the command buffer to make a call to check the framebuffer status which can hang the driver. So in Mac Chromium we always use a temporary surface to test for glReadPixels format/type support. BUG=chromium:662802 Change-Id: I034e24faf3d780b6243f95af66d03dd68e12633c Reviewed-on: https://skia-review.googlesource.com/6113 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
This commit is contained in:
parent
82c263f6e4
commit
625cd9e0c9
@ -2309,6 +2309,16 @@ static bool read_pixels_pays_for_y_flip(GrSurfaceOrigin origin, const GrGLCaps&
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool GrGLGpu::readPixelsSupported(GrRenderTarget* target, GrPixelConfig readConfig) {
|
bool GrGLGpu::readPixelsSupported(GrRenderTarget* target, GrPixelConfig readConfig) {
|
||||||
|
#ifdef SK_BUILD_FOR_MAC
|
||||||
|
// Chromium may ask us to read back from locked IOSurfaces. Calling the command buffer's
|
||||||
|
// glGetIntegerv() with GL_IMPLEMENTATION_COLOR_READ_FORMAT/_TYPE causes the command buffer
|
||||||
|
// to make a call to check the framebuffer status which can hang the driver. So in Mac Chromium
|
||||||
|
// we always use a temporary surface to test for read pixels support.
|
||||||
|
// https://www.crbug.com/662802
|
||||||
|
if (this->glContext().driver() == kChromium_GrGLDriver) {
|
||||||
|
return this->readPixelsSupported(target->config(), readConfig);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
auto bindRenderTarget = [this, target]() -> bool {
|
auto bindRenderTarget = [this, target]() -> bool {
|
||||||
this->flushRenderTarget(static_cast<GrGLRenderTarget*>(target), &SkIRect::EmptyIRect());
|
this->flushRenderTarget(static_cast<GrGLRenderTarget*>(target), &SkIRect::EmptyIRect());
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user