Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(521)

Unified Diff: ui/gfx/mac/io_surface.cc

Issue 1948723002: Mac software video: Use AVSampleBufferDisplayLayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IRF Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/accelerated_widget_mac/ca_renderer_layer_tree.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « ui/accelerated_widget_mac/ca_renderer_layer_tree.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698