| Index: ui/gfx/mac/io_surface.cc
|
| diff --git a/ui/gfx/mac/io_surface.cc b/ui/gfx/mac/io_surface.cc
|
| index 52fe6014ea15d0a605e2cc7ddacfbdd2e135fd95..6c8d24b345ab4d0e61e06e12e0a1aa42a720c1b4 100644
|
| --- a/ui/gfx/mac/io_surface.cc
|
| +++ b/ui/gfx/mac/io_surface.cc
|
| @@ -164,6 +164,21 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size, gfx::BufferFormat format) {
|
| DCHECK_EQ(kIOReturnSuccess, r);
|
| }
|
|
|
| + // Displaying an IOSurface that does not have a color space using an
|
| + // AVSampleBufferDisplayLayer can result in a black screen. Specify the
|
| + // main display's color profile by default, which will result in no color
|
| + // correction being done for the main monitor (which is the behavior of not
|
| + // specifying a color space).
|
| + // https://crbug.com/608879
|
| + if (format == gfx::BufferFormat::YUV_420_BIPLANAR) {
|
| + base::ScopedCFTypeRef<CGColorSpaceRef> color_space(
|
| + CGDisplayCopyColorSpace(CGMainDisplayID()));
|
| + base::ScopedCFTypeRef<CFDataRef> color_space_icc(
|
| + CGColorSpaceCopyICCProfile(color_space));
|
| + // Note that nullptr is an acceptable input to IOSurfaceSetValue.
|
| + IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), color_space_icc);
|
| + }
|
| +
|
| return surface;
|
| }
|
|
|
|
|