| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
| 6 #include "cc/output/gl_renderer.h" | 6 #include "cc/output/gl_renderer.h" |
| 7 #include "cc/quads/draw_quad.h" | 7 #include "cc/quads/draw_quad.h" |
| 8 #include "cc/quads/picture_draw_quad.h" | 8 #include "cc/quads/picture_draw_quad.h" |
| 9 #include "cc/quads/texture_draw_quad.h" | 9 #include "cc/quads/texture_draw_quad.h" |
| 10 #include "cc/resources/video_resource_updater.h" | 10 #include "cc/resources/video_resource_updater.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 video_frame->coded_size()); | 253 video_frame->coded_size()); |
| 254 DCHECK(uv_tex_size == media::VideoFrame::PlaneSize( | 254 DCHECK(uv_tex_size == media::VideoFrame::PlaneSize( |
| 255 video_frame->format(), media::VideoFrame::kVPlane, | 255 video_frame->format(), media::VideoFrame::kVPlane, |
| 256 video_frame->coded_size())); | 256 video_frame->coded_size())); |
| 257 if (with_alpha) { | 257 if (with_alpha) { |
| 258 DCHECK(ya_tex_size == media::VideoFrame::PlaneSize( | 258 DCHECK(ya_tex_size == media::VideoFrame::PlaneSize( |
| 259 video_frame->format(), media::VideoFrame::kAPlane, | 259 video_frame->format(), media::VideoFrame::kAPlane, |
| 260 video_frame->coded_size())); | 260 video_frame->coded_size())); |
| 261 } | 261 } |
| 262 | 262 |
| 263 gfx::RectF ya_tex_coord_rect(tex_coord_rect.x() * ya_tex_size.width(), |
| 264 tex_coord_rect.y() * ya_tex_size.height(), |
| 265 tex_coord_rect.width() * ya_tex_size.width(), |
| 266 tex_coord_rect.height() * ya_tex_size.height()); |
| 267 gfx::RectF uv_tex_coord_rect(tex_coord_rect.x() * uv_tex_size.width(), |
| 268 tex_coord_rect.y() * uv_tex_size.height(), |
| 269 tex_coord_rect.width() * uv_tex_size.width(), |
| 270 tex_coord_rect.height() * uv_tex_size.height()); |
| 271 |
| 263 YUVVideoDrawQuad* yuv_quad = | 272 YUVVideoDrawQuad* yuv_quad = |
| 264 render_pass->CreateAndAppendDrawQuad<YUVVideoDrawQuad>(); | 273 render_pass->CreateAndAppendDrawQuad<YUVVideoDrawQuad>(); |
| 265 yuv_quad->SetNew(shared_state, rect, opaque_rect, visible_rect, | 274 yuv_quad->SetNew(shared_state, rect, opaque_rect, visible_rect, |
| 266 tex_coord_rect, ya_tex_size, uv_tex_size, y_resource, | 275 ya_tex_coord_rect, uv_tex_coord_rect, ya_tex_size, |
| 267 u_resource, v_resource, a_resource, color_space); | 276 uv_tex_size, y_resource, u_resource, v_resource, a_resource, |
| 277 color_space); |
| 268 } | 278 } |
| 269 | 279 |
| 270 void CreateTestYUVVideoDrawQuad_Striped( | 280 void CreateTestYUVVideoDrawQuad_Striped( |
| 271 const SharedQuadState* shared_state, | 281 const SharedQuadState* shared_state, |
| 272 media::VideoFrame::Format format, | 282 media::VideoFrame::Format format, |
| 273 bool is_transparent, | 283 bool is_transparent, |
| 274 const gfx::RectF& tex_coord_rect, | 284 const gfx::RectF& tex_coord_rect, |
| 275 RenderPass* render_pass, | 285 RenderPass* render_pass, |
| 276 VideoResourceUpdater* video_resource_updater, | 286 VideoResourceUpdater* video_resource_updater, |
| 277 const gfx::Rect& rect, | 287 const gfx::Rect& rect, |
| (...skipping 2664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2942 ? FILE_PATH_LITERAL("four_blue_green_checkers.png") | 2952 ? FILE_PATH_LITERAL("four_blue_green_checkers.png") |
| 2943 : FILE_PATH_LITERAL("checkers_big.png"); | 2953 : FILE_PATH_LITERAL("checkers_big.png"); |
| 2944 EXPECT_TRUE(this->RunPixelTest(&pass_list, base::FilePath(path), | 2954 EXPECT_TRUE(this->RunPixelTest(&pass_list, base::FilePath(path), |
| 2945 ExactPixelComparator(true))); | 2955 ExactPixelComparator(true))); |
| 2946 } | 2956 } |
| 2947 | 2957 |
| 2948 #endif // !defined(OS_ANDROID) | 2958 #endif // !defined(OS_ANDROID) |
| 2949 | 2959 |
| 2950 } // namespace | 2960 } // namespace |
| 2951 } // namespace cc | 2961 } // namespace cc |
| OLD | NEW |