gpu: GL_CHROMIUM_color_space_metadata extension.

Rename SetColorSpaceForScanout to SetColorSpaceMetadata. This was used
for DirectCompositon overlays but not documented, so document it.
Implement it for IO surfaces. This will be used to set the color space
for textures backed by service side anonymous GpuMemoryBuffers.

R=piman,reveman,ccameron
BUG=768108

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I7248bb582513f604aa67a0c20190bf5f9e458062
Reviewed-on: https://chromium-review.googlesource.com/714647
Commit-Queue: Sunny Sachanandani <[email protected]>
Reviewed-by: Chris Watkins <[email protected]>
Reviewed-by: Antoine Labour <[email protected]>
Reviewed-by: Dan Sanders <[email protected]>
Reviewed-by: David Reveman <[email protected]>
Reviewed-by: ccameron <[email protected]>
Cr-Commit-Position: refs/heads/master@{#511690}
diff --git a/ui/gfx/mac/io_surface.h b/ui/gfx/mac/io_surface.h
index 1fb01a0..da8826a 100644
--- a/ui/gfx/mac/io_surface.h
+++ b/ui/gfx/mac/io_surface.h
@@ -10,6 +10,7 @@
 
 #include "base/mac/scoped_cftyperef.h"
 #include "ui/gfx/buffer_types.h"
+#include "ui/gfx/color_space.h"
 #include "ui/gfx/generic_shared_memory_id.h"
 #include "ui/gfx/geometry/size.h"
 #include "ui/gfx/gfx_export.h"
@@ -56,6 +57,11 @@
 using ScopedInUseIOSurface =
     base::ScopedTypeRef<IOSurfaceRef, internal::ScopedInUseIOSurfaceTraits>;
 
+// Set color space for given IOSurface. Color space must have an associated ICC
+// color profile otherwise this function does nothing.
+GFX_EXPORT void IOSurfaceSetColorSpace(IOSurfaceRef io_surface,
+                                       const gfx::ColorSpace& color_space);
+
 }  // namespace gfx
 
 #endif  // UI_GFX_MAC_IO_SURFACE_H_