Commit 433d312d authored by David Stevens's avatar David Stevens Committed by Commit Bot

Skip setting colorspace for YUV images

YUV textures from OES_EGL_image_external are sampled as RGB.
Technically, the driver is supposed to preserve the colorspace, so we
could still pass the primaries and transfer function. However, we don't
actually pass the colorspace to the driver, and it's unclear what
drivers would actually do if we did. So in effect, the colorspace is
undefined.

Bug: 1102317
Change-Id: I7f8b430e330fc25e3c2414ae66d1d22708e67f2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2331769
Commit-Queue: David Stevens <stevensd@chromium.org>
Reviewed-by: default avatarDaniele Castagna <dcastagna@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796675}
parent 4d8dd5b7
......@@ -978,7 +978,15 @@ void Surface::UpdateResource(FrameSinkResourceManager* resource_manager) {
state_.only_visible_on_secure_output, &current_resource_)) {
current_resource_has_alpha_ =
FormatHasAlpha(current_buffer_.buffer()->GetFormat());
current_resource_.color_space = state_.color_space;
// Planar buffers are sampled as RGB. Technically, the driver is supposed
// to preserve the colorspace, so we could still pass the primaries and
// transfer function. However, we don't actually pass the colorspace
// to the driver, and it's unclear what drivers would actually do if we
// did. So in effect, the colorspace is undefined.
if (NumberOfPlanesForLinearBufferFormat(
current_buffer_.buffer()->GetFormat()) > 1) {
current_resource_.color_space = state_.color_space;
}
} else {
current_resource_.id = 0;
// Use the buffer's size, so the AppendContentsToFrame() will append
......
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