Index: gpu/ipc/client/gpu_memory_buffer_impl_io_surface.cc |
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_io_surface.cc b/gpu/ipc/client/gpu_memory_buffer_impl_io_surface.cc |
index e594ded6e81f2a9a53be95300ecd03eeeb48507b..37bd2ea6cf31c2994e2894970e6e0f88190a8957 100644 |
--- a/gpu/ipc/client/gpu_memory_buffer_impl_io_surface.cc |
+++ b/gpu/ipc/client/gpu_memory_buffer_impl_io_surface.cc |
@@ -116,15 +116,20 @@ void GpuMemoryBufferImplIOSurface::SetColorSpaceForScanout( |
if (color_space == color_space_) |
return; |
color_space_ = color_space; |
- std::vector<char> icc_profile = |
- gfx::ICCProfile::FromColorSpace(color_space).GetData(); |
- if (icc_profile.size()) { |
- base::ScopedCFTypeRef<CFDataRef> cf_data_icc_profile(CFDataCreate( |
- nullptr, reinterpret_cast<const UInt8*>(icc_profile.data()), |
- icc_profile.size())); |
- IOSurfaceSetValue(io_surface_, CFSTR("IOSurfaceColorSpace"), |
- cf_data_icc_profile); |
+ |
+ // Retrieve the ICC profile data. |
+ gfx::ICCProfile icc_profile; |
+ if (!color_space_.GetICCProfile(&icc_profile)) { |
+ DLOG(ERROR) << "Failed to set color space for scanout: no ICC profile."; |
+ return; |
} |
+ |
+ // Package it as a CFDataRef and send it to the IOSurface. |
+ base::ScopedCFTypeRef<CFDataRef> cf_data_icc_profile(CFDataCreate( |
+ nullptr, reinterpret_cast<const UInt8*>(icc_profile.GetData().data()), |
+ icc_profile.GetData().size())); |
+ IOSurfaceSetValue(io_surface_, CFSTR("IOSurfaceColorSpace"), |
+ cf_data_icc_profile); |
} |
gfx::GpuMemoryBufferHandle GpuMemoryBufferImplIOSurface::GetHandle() const { |