Add Metal support for gl::ProgressReporter

As in OpenGL OOP-Raster, it is possible for the GPU watchdog to be
starved (non non-OOP-Raster, it can slide in between any two GL calls,
but this isn't an option for OOP-Raster because we call GL directly,
not through the out-of-process command buffer).

To counter this, gl::init::CreateGrGLInterface conditionally wraps
some GL calls that can be longer (things that allocate GPU memory or
compile shaders) in a gl::ScopedProgressReporter.

We are seeing lots of hangs in Metal for similar-seeming reasons (most
but not all of them in shader compilation). Add a wrapper over the
Metal protocol to report progress for the potentially-longer calls.

Bug: 964476
Change-Id: Ibcc40d8054f4d70ce74e5d5d62d5a4cdb57ab766
Reviewed-by: Avi Drissman <>
Reviewed-by: Eric Karl <>
Commit-Queue: ccameron <>
Cr-Commit-Position: refs/heads/master@{#661518}
7 files changed