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

Unified Diff: cc/output/renderer_pixeltest.cc

Issue 92703003: Support videos with JPEG color range in GPU YUV convert path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@yuv_v2
Patch Set: Whoops, forgot one. Created 7 years 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/output/gl_renderer.cc ('k') | cc/quads/draw_quad_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/renderer_pixeltest.cc
diff --git a/cc/output/renderer_pixeltest.cc b/cc/output/renderer_pixeltest.cc
index 2bf5152d2139073110e480ba164ec9f9483062e1..73ac7893f2dc96ba8e3cfe1dd84a9d58ab9f7f9f 100644
--- a/cc/output/renderer_pixeltest.cc
+++ b/cc/output/renderer_pixeltest.cc
@@ -405,7 +405,10 @@ TEST_F(GLRendererPixelTest, NonPremultipliedTextureWithBackground) {
class VideoGLRendererPixelTest : public GLRendererPixelTest {
protected:
scoped_ptr<YUVVideoDrawQuad> CreateTestYUVVideoDrawQuad(
- SharedQuadState* shared_state, bool with_alpha, bool is_transparent) {
+ SharedQuadState* shared_state,
+ bool with_alpha,
+ bool is_transparent,
+ bool has_jpeg_color_range) {
gfx::Rect rect(this->device_viewport_size_);
gfx::Rect opaque_rect(0, 0, 0, 0);
@@ -466,8 +469,15 @@ class VideoGLRendererPixelTest : public GLRendererPixelTest {
}
scoped_ptr<YUVVideoDrawQuad> yuv_quad = cc::YUVVideoDrawQuad::Create();
- yuv_quad->SetNew(shared_state, rect, opaque_rect, gfx::Size(),
- y_resource, u_resource, v_resource, a_resource);
+ yuv_quad->SetNew(shared_state,
+ rect,
+ opaque_rect,
+ gfx::Size(),
+ y_resource,
+ u_resource,
+ v_resource,
+ a_resource,
+ has_jpeg_color_range);
return yuv_quad.Pass();
}
};
@@ -482,7 +492,31 @@ TEST_F(VideoGLRendererPixelTest, SimpleYUVRect) {
CreateTestSharedQuadState(gfx::Transform(), rect);
scoped_ptr<YUVVideoDrawQuad> yuv_quad =
- CreateTestYUVVideoDrawQuad(shared_state.get(), false, false);
+ CreateTestYUVVideoDrawQuad(shared_state.get(), false, false, false);
+
+ pass->quad_list.push_back(yuv_quad.PassAs<DrawQuad>());
+
+ RenderPassList pass_list;
+ pass_list.push_back(pass.Pass());
+
+ EXPECT_TRUE(this->RunPixelTest(
+ &pass_list,
+ PixelTest::NoOffscreenContext,
+ base::FilePath(FILE_PATH_LITERAL("green.png")),
+ ExactPixelComparator(true)));
+}
+
+TEST_F(VideoGLRendererPixelTest, SimpleYUVJRect) {
+ gfx::Rect rect(this->device_viewport_size_);
+
+ RenderPass::Id id(1, 1);
+ scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect);
+
+ scoped_ptr<SharedQuadState> shared_state =
+ CreateTestSharedQuadState(gfx::Transform(), rect);
+
+ scoped_ptr<YUVVideoDrawQuad> yuv_quad =
+ CreateTestYUVVideoDrawQuad(shared_state.get(), false, false, true);
pass->quad_list.push_back(yuv_quad.PassAs<DrawQuad>());
@@ -506,7 +540,7 @@ TEST_F(VideoGLRendererPixelTest, SimpleYUVARect) {
CreateTestSharedQuadState(gfx::Transform(), rect);
scoped_ptr<YUVVideoDrawQuad> yuv_quad =
- CreateTestYUVVideoDrawQuad(shared_state.get(), true, false);
+ CreateTestYUVVideoDrawQuad(shared_state.get(), true, false, false);
pass->quad_list.push_back(yuv_quad.PassAs<DrawQuad>());
@@ -535,7 +569,7 @@ TEST_F(VideoGLRendererPixelTest, FullyTransparentYUVARect) {
CreateTestSharedQuadState(gfx::Transform(), rect);
scoped_ptr<YUVVideoDrawQuad> yuv_quad =
- CreateTestYUVVideoDrawQuad(shared_state.get(), true, true);
+ CreateTestYUVVideoDrawQuad(shared_state.get(), true, true, false);
pass->quad_list.push_back(yuv_quad.PassAs<DrawQuad>());
« no previous file with comments | « cc/output/gl_renderer.cc ('k') | cc/quads/draw_quad_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698