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 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1112 | 1112 |
1113 bool highbit = GetParam(); | 1113 bool highbit = GetParam(); |
1114 CreateTestYUVVideoDrawQuad_Striped( | 1114 CreateTestYUVVideoDrawQuad_Striped( |
1115 shared_state, media::PIXEL_FORMAT_YV12, false, highbit, | 1115 shared_state, media::PIXEL_FORMAT_YV12, false, highbit, |
1116 gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), pass.get(), | 1116 gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), pass.get(), |
1117 video_resource_updater_.get(), rect, rect, resource_provider_.get()); | 1117 video_resource_updater_.get(), rect, rect, resource_provider_.get()); |
1118 | 1118 |
1119 RenderPassList pass_list; | 1119 RenderPassList pass_list; |
1120 pass_list.push_back(std::move(pass)); | 1120 pass_list.push_back(std::move(pass)); |
1121 | 1121 |
1122 EXPECT_TRUE( | 1122 base::FilePath file_path = |
1123 this->RunPixelTest(&pass_list, | 1123 base::FilePath(FILE_PATH_LITERAL("yuv_stripes.png")); |
1124 base::FilePath(FILE_PATH_LITERAL("yuv_stripes.png")), | 1124 if (highbit) |
1125 FuzzyPixelOffByOneComparator(true))); | 1125 file_path = base::FilePath(FILE_PATH_LITERAL("yuv_stripes_highbit.png")); |
| 1126 EXPECT_TRUE(this->RunPixelTest(&pass_list, file_path, |
| 1127 FuzzyPixelOffByOneComparator(true))); |
1126 } | 1128 } |
1127 | 1129 |
1128 TEST_P(VideoGLRendererPixelHiLoTest, ClippedYUVRect) { | 1130 TEST_P(VideoGLRendererPixelHiLoTest, ClippedYUVRect) { |
1129 gfx::Rect viewport(this->device_viewport_size_); | 1131 gfx::Rect viewport(this->device_viewport_size_); |
1130 gfx::Rect draw_rect(this->device_viewport_size_.width() * 1.5, | 1132 gfx::Rect draw_rect(this->device_viewport_size_.width() * 1.5, |
1131 this->device_viewport_size_.height() * 1.5); | 1133 this->device_viewport_size_.height() * 1.5); |
1132 | 1134 |
1133 RenderPassId id(1, 1); | 1135 RenderPassId id(1, 1); |
1134 std::unique_ptr<RenderPass> pass = CreateTestRootRenderPass(id, viewport); | 1136 std::unique_ptr<RenderPass> pass = CreateTestRootRenderPass(id, viewport); |
1135 | 1137 |
1136 SharedQuadState* shared_state = | 1138 SharedQuadState* shared_state = |
1137 CreateTestSharedQuadState(gfx::Transform(), viewport, pass.get()); | 1139 CreateTestSharedQuadState(gfx::Transform(), viewport, pass.get()); |
1138 | 1140 |
1139 bool highbit = GetParam(); | 1141 bool highbit = GetParam(); |
1140 CreateTestYUVVideoDrawQuad_Striped( | 1142 CreateTestYUVVideoDrawQuad_Striped( |
1141 shared_state, media::PIXEL_FORMAT_YV12, false, highbit, | 1143 shared_state, media::PIXEL_FORMAT_YV12, false, highbit, |
1142 gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), pass.get(), | 1144 gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), pass.get(), |
1143 video_resource_updater_.get(), draw_rect, viewport, | 1145 video_resource_updater_.get(), draw_rect, viewport, |
1144 resource_provider_.get()); | 1146 resource_provider_.get()); |
1145 RenderPassList pass_list; | 1147 RenderPassList pass_list; |
1146 pass_list.push_back(std::move(pass)); | 1148 pass_list.push_back(std::move(pass)); |
1147 | 1149 |
1148 EXPECT_TRUE(this->RunPixelTest( | 1150 base::FilePath file_path = |
1149 &pass_list, base::FilePath(FILE_PATH_LITERAL("yuv_stripes_clipped.png")), | 1151 base::FilePath(FILE_PATH_LITERAL("yuv_stripes_clipped.png")); |
1150 FuzzyPixelOffByOneComparator(true))); | 1152 if (highbit) { |
| 1153 file_path = |
| 1154 base::FilePath(FILE_PATH_LITERAL("yuv_stripes_clipped_highbit.png")); |
| 1155 } |
| 1156 EXPECT_TRUE(this->RunPixelTest(&pass_list, file_path, |
| 1157 FuzzyPixelOffByOneComparator(true))); |
1151 } | 1158 } |
1152 | 1159 |
1153 TEST_F(VideoGLRendererPixelHiLoTest, OffsetYUVRect) { | 1160 TEST_F(VideoGLRendererPixelHiLoTest, OffsetYUVRect) { |
1154 gfx::Rect rect(this->device_viewport_size_); | 1161 gfx::Rect rect(this->device_viewport_size_); |
1155 | 1162 |
1156 RenderPassId id(1, 1); | 1163 RenderPassId id(1, 1); |
1157 std::unique_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); | 1164 std::unique_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); |
1158 | 1165 |
1159 SharedQuadState* shared_state = | 1166 SharedQuadState* shared_state = |
1160 CreateTestSharedQuadState(gfx::Transform(), rect, pass.get()); | 1167 CreateTestSharedQuadState(gfx::Transform(), rect, pass.get()); |
(...skipping 1986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3147 | 3154 |
3148 EXPECT_TRUE(this->RunPixelTest( | 3155 EXPECT_TRUE(this->RunPixelTest( |
3149 &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")), | 3156 &pass_list, base::FilePath(FILE_PATH_LITERAL("spiral.png")), |
3150 FuzzyPixelOffByOneComparator(true))); | 3157 FuzzyPixelOffByOneComparator(true))); |
3151 } | 3158 } |
3152 | 3159 |
3153 #endif // !defined(OS_ANDROID) | 3160 #endif // !defined(OS_ANDROID) |
3154 | 3161 |
3155 } // namespace | 3162 } // namespace |
3156 } // namespace cc | 3163 } // namespace cc |
OLD | NEW |