Commit 76e9be34 authored by Hubbe Hubinette's avatar Hubbe Hubinette Committed by Commit Bot

Forward video color space to skia in paint path

Not sure exactly what is affected by this, stumbled on it
while working on fixing full-range video.

Change-Id: I589e1b811ef5f10160111620b63f06492068f341
Reviewed-on: https://chromium-review.googlesource.com/c/1188968
Commit-Queue: Fredrik Hubinette <hubbe@chromium.org>
Reviewed-by: default avatarccameron <ccameron@chromium.org>
Reviewed-by: default avatarMike Klein <mtklein@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604011}
parent afee794e
...@@ -207,6 +207,7 @@ sk_sp<SkImage> NewSkImageFromVideoFrameNative(VideoFrame* video_frame, ...@@ -207,6 +207,7 @@ sk_sp<SkImage> NewSkImageFromVideoFrameNative(VideoFrame* video_frame,
gpu::gles2::GLES2Interface* gl = context_3d.gl; gpu::gles2::GLES2Interface* gl = context_3d.gl;
unsigned source_texture = 0; unsigned source_texture = 0;
gfx::ColorSpace color_space_for_skia;
if (mailbox_holder.texture_target != GL_TEXTURE_2D) { if (mailbox_holder.texture_target != GL_TEXTURE_2D) {
// TODO(dcastagna): At the moment Skia doesn't support targets different // TODO(dcastagna): At the moment Skia doesn't support targets different
// than GL_TEXTURE_2D. Avoid this copy once // than GL_TEXTURE_2D. Avoid this copy once
...@@ -221,6 +222,7 @@ sk_sp<SkImage> NewSkImageFromVideoFrameNative(VideoFrame* video_frame, ...@@ -221,6 +222,7 @@ sk_sp<SkImage> NewSkImageFromVideoFrameNative(VideoFrame* video_frame,
gl->WaitSyncTokenCHROMIUM(mailbox_holder.sync_token.GetConstData()); gl->WaitSyncTokenCHROMIUM(mailbox_holder.sync_token.GetConstData());
source_texture = source_texture =
gl->CreateAndConsumeTextureCHROMIUM(mailbox_holder.mailbox.name); gl->CreateAndConsumeTextureCHROMIUM(mailbox_holder.mailbox.name);
color_space_for_skia = video_frame->ColorSpace();
} }
GrGLTextureInfo source_texture_info; GrGLTextureInfo source_texture_info;
source_texture_info.fID = source_texture; source_texture_info.fID = source_texture;
...@@ -235,7 +237,8 @@ sk_sp<SkImage> NewSkImageFromVideoFrameNative(VideoFrame* video_frame, ...@@ -235,7 +237,8 @@ sk_sp<SkImage> NewSkImageFromVideoFrameNative(VideoFrame* video_frame,
GrMipMapped::kNo, source_texture_info); GrMipMapped::kNo, source_texture_info);
return SkImage::MakeFromAdoptedTexture( return SkImage::MakeFromAdoptedTexture(
context_3d.gr_context, source_backend_texture, kTopLeft_GrSurfaceOrigin, context_3d.gr_context, source_backend_texture, kTopLeft_GrSurfaceOrigin,
kRGBA_8888_SkColorType); kRGBA_8888_SkColorType, kPremul_SkAlphaType,
color_space_for_skia.ToSkColorSpace());
} }
void VideoFrameCopyTextureOrSubTexture(gpu::gles2::GLES2Interface* gl, void VideoFrameCopyTextureOrSubTexture(gpu::gles2::GLES2Interface* gl,
......
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