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

Side by Side 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: Update colors 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gfx/mac/io_surface.h" 5 #include "ui/gfx/mac/io_surface.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 // https://crbug.com/594343. 157 // https://crbug.com/594343.
158 if (!base::mac::IsOSMavericks()) { 158 if (!base::mac::IsOSMavericks()) {
159 // Zero-initialize the IOSurface. Calling IOSurfaceLock/IOSurfaceUnlock 159 // Zero-initialize the IOSurface. Calling IOSurfaceLock/IOSurfaceUnlock
160 // appears to be sufficient. https://crbug.com/584760#c17 160 // appears to be sufficient. https://crbug.com/584760#c17
161 IOReturn r = IOSurfaceLock(surface, 0, nullptr); 161 IOReturn r = IOSurfaceLock(surface, 0, nullptr);
162 DCHECK_EQ(kIOReturnSuccess, r); 162 DCHECK_EQ(kIOReturnSuccess, r);
163 r = IOSurfaceUnlock(surface, 0, nullptr); 163 r = IOSurfaceUnlock(surface, 0, nullptr);
164 DCHECK_EQ(kIOReturnSuccess, r); 164 DCHECK_EQ(kIOReturnSuccess, r);
165 } 165 }
166 166
167 // Displaying an IOSurface that does not have a color space using an
168 // AVSampleBufferDisplayLayer can result in a black screen. Specify the
169 // main display's color profile by default, which will result in no color
170 // correction being done for the main monitor (which is the behavior of not
171 // specifying a color space).
172 // https://crbug.com/608879
173 if (format == gfx::BufferFormat::YUV_420_BIPLANAR) {
174 base::ScopedCFTypeRef<CGColorSpaceRef> color_space(
175 CGDisplayCopyColorSpace(CGMainDisplayID()));
176 base::ScopedCFTypeRef<CFDataRef> color_space_icc(
177 CGColorSpaceCopyICCProfile(color_space));
erikchen 2016/05/04 18:14:45 CGColorSpaceCopyICCProfile might return NULL. I th
ccameron 2016/05/05 18:50:01 I tested passing NULL to IOSurfaceSetValue, and it
erikchen 2016/05/05 19:11:55 Ok, just add a comment about NULL a valid paramete
178 IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), color_space_icc);
179 }
180
167 return surface; 181 return surface;
168 } 182 }
169 183
170 } // namespace gfx 184 } // namespace gfx
OLDNEW
« 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