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

Unified Diff: cc/output/gl_renderer.cc

Issue 2773103002: cc: Unify all sources of color space for YUVVideoDrawQuad (Closed)
Patch Set: Created 3 years, 9 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 | « cc/layers/video_layer_impl.cc ('k') | cc/output/gl_renderer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/gl_renderer.cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index 809bbdd130ed1b838241fe0de5511f3029772587..cd432465de5d69ff7139a2cae54011700b5c175a 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -2055,26 +2055,15 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
? UV_TEXTURE_MODE_UV
: UV_TEXTURE_MODE_U_V;
- // TODO(ccameron): There are currently three sources of the color space: the
- // resource, quad->color_space, and quad->video_color_space. Remove two of
- // them.
- gfx::ColorSpace src_color_space = quad->video_color_space;
+ ResourceProvider::ScopedSamplerGL y_plane_lock(
+ resource_provider_, quad->y_plane_resource_id(), GL_TEXTURE1, GL_LINEAR);
+
+ gfx::ColorSpace src_color_space = y_plane_lock.color_space();
gfx::ColorSpace dst_color_space =
current_frame()->current_render_pass->color_space;
if (!base::FeatureList::IsEnabled(media::kVideoColorManagement)) {
if (!settings_->enable_color_correct_rendering)
dst_color_space = gfx::ColorSpace();
- switch (quad->color_space) {
- case YUVVideoDrawQuad::REC_601:
- src_color_space = gfx::ColorSpace::CreateREC601();
- break;
- case YUVVideoDrawQuad::REC_709:
- src_color_space = gfx::ColorSpace::CreateREC709();
- break;
- case YUVVideoDrawQuad::JPEG:
- src_color_space = gfx::ColorSpace::CreateJpeg();
- break;
- }
}
// Invalid or unspecified color spaces should be treated as REC709.
if (!src_color_space.IsValid())
@@ -2083,10 +2072,6 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
// The source color space should never be RGB.
DCHECK_NE(src_color_space, src_color_space.GetAsFullRangeRGB());
- ResourceProvider::ScopedSamplerGL y_plane_lock(
- resource_provider_, quad->y_plane_resource_id(), GL_TEXTURE1, GL_LINEAR);
- if (base::FeatureList::IsEnabled(media::kVideoColorManagement))
- DCHECK_EQ(src_color_space, y_plane_lock.color_space());
ResourceProvider::ScopedSamplerGL u_plane_lock(
resource_provider_, quad->u_plane_resource_id(), GL_TEXTURE2, GL_LINEAR);
DCHECK_EQ(y_plane_lock.target(), u_plane_lock.target());
« no previous file with comments | « cc/layers/video_layer_impl.cc ('k') | cc/output/gl_renderer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698