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

Unified Diff: gpu/ipc/client/gpu_memory_buffer_impl_io_surface.cc

Issue 2691213007: color: Don't use QCMS for transforms unless necessary (Closed)
Patch Set: Incorporate review feedback Created 3 years, 10 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 | « content/browser/web_contents/web_contents_view_aura.cc ('k') | ui/gfx/color_space.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « content/browser/web_contents/web_contents_view_aura.cc ('k') | ui/gfx/color_space.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698