| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 tex_coord_rect.width() * uv_tex_size.width(), | 269 tex_coord_rect.width() * uv_tex_size.width(), |
| 270 tex_coord_rect.height() * uv_tex_size.height()); | 270 tex_coord_rect.height() * uv_tex_size.height()); |
| 271 | 271 |
| 272 YUVVideoDrawQuad* yuv_quad = | 272 YUVVideoDrawQuad* yuv_quad = |
| 273 render_pass->CreateAndAppendDrawQuad<YUVVideoDrawQuad>(); | 273 render_pass->CreateAndAppendDrawQuad<YUVVideoDrawQuad>(); |
| 274 uint32_t bits_per_channel = 8; | 274 uint32_t bits_per_channel = 8; |
| 275 if (video_frame->format() == media::PIXEL_FORMAT_YUV420P10 || | 275 if (video_frame->format() == media::PIXEL_FORMAT_YUV420P10 || |
| 276 video_frame->format() == media::PIXEL_FORMAT_YUV422P10 || | 276 video_frame->format() == media::PIXEL_FORMAT_YUV422P10 || |
| 277 video_frame->format() == media::PIXEL_FORMAT_YUV444P10) { | 277 video_frame->format() == media::PIXEL_FORMAT_YUV444P10) { |
| 278 bits_per_channel = 10; | 278 bits_per_channel = 10; |
| 279 if (resource_provider->YuvResourceFormat(bits_per_channel) != RG_88) |
| 280 bits_per_channel = 8; |
| 279 } | 281 } |
| 280 | 282 |
| 281 yuv_quad->SetNew(shared_state, rect, opaque_rect, visible_rect, | 283 yuv_quad->SetNew(shared_state, rect, opaque_rect, visible_rect, |
| 282 ya_tex_coord_rect, uv_tex_coord_rect, ya_tex_size, | 284 ya_tex_coord_rect, uv_tex_coord_rect, ya_tex_size, |
| 283 uv_tex_size, y_resource, u_resource, v_resource, a_resource, | 285 uv_tex_size, y_resource, u_resource, v_resource, a_resource, |
| 284 color_space, video_color_space, 0.0f, 1.0f, | 286 color_space, video_color_space, 0.0f, 1.0f, |
| 285 bits_per_channel); | 287 bits_per_channel); |
| 286 } | 288 } |
| 287 | 289 |
| 288 // Upshift video frame to 10 bit. | 290 // Upshift video frame to 10 bit. |
| (...skipping 2884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3173 | 3175 |
| 3174 EXPECT_TRUE(this->RunPixelTest( | 3176 EXPECT_TRUE(this->RunPixelTest( |
| 3175 &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")), | 3177 &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")), |
| 3176 FuzzyPixelOffByOneComparator(true))); | 3178 FuzzyPixelOffByOneComparator(true))); |
| 3177 } | 3179 } |
| 3178 | 3180 |
| 3179 #endif // !defined(OS_ANDROID) | 3181 #endif // !defined(OS_ANDROID) |
| 3180 | 3182 |
| 3181 } // namespace | 3183 } // namespace |
| 3182 } // namespace cc | 3184 } // namespace cc |
| OLD | NEW |