Commit 96bf7ce4 authored by Markus Handell's avatar Markus Handell Committed by Commit Bot

io_surface: Conditionalize SRGB colorspace coercion with flag.

This change adds a default-on flag controlling the coercion of
REC709 to SRGB added in crrev/c/2550554.

Bug: 1151957, b:173124811
Change-Id: I39d91c2cd5fc047e8a67c649a862753fe8daa47b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2556962
Commit-Queue: Markus Handell <handellm@google.com>
Reviewed-by: default avatarHenrik Boström <hbos@chromium.org>
Reviewed-by: default avatarccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#830935}
parent 3c7ae5e9
......@@ -10,6 +10,7 @@
#include <stdint.h>
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/logging.h"
#include "base/mac/mac_util.h"
#include "base/mac/mach_logging.h"
......@@ -24,6 +25,9 @@ namespace gfx {
namespace {
const base::Feature kIOSurfaceUseNamedSRGBForREC709{
"IOSurfaceUseNamedSRGBForREC709", base::FEATURE_ENABLED_BY_DEFAULT};
void AddIntegerValue(CFMutableDictionaryRef dictionary,
const CFStringRef key,
int32_t value) {
......@@ -135,7 +139,8 @@ bool IOSurfaceSetColorSpace(IOSurfaceRef io_surface,
CFStringRef color_space_name = nullptr;
if (__builtin_available(macos 10.12, *)) {
if (color_space == ColorSpace::CreateSRGB() ||
color_space == ColorSpace::CreateREC709()) {
(base::FeatureList::IsEnabled(kIOSurfaceUseNamedSRGBForREC709) &&
color_space == ColorSpace::CreateREC709())) {
color_space_name = kCGColorSpaceSRGB;
} else if (color_space == ColorSpace::CreateDisplayP3D65()) {
color_space_name = kCGColorSpaceDisplayP3;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment