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 "cc/output/gl_renderer.h" | 5 #include "cc/output/gl_renderer.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 117 |
118 void TestBasicShaders() { | 118 void TestBasicShaders() { |
119 EXPECT_PROGRAM_VALID(renderer()->GetTileCheckerboardProgram()); | 119 EXPECT_PROGRAM_VALID(renderer()->GetTileCheckerboardProgram()); |
120 EXPECT_PROGRAM_VALID(renderer()->GetDebugBorderProgram()); | 120 EXPECT_PROGRAM_VALID(renderer()->GetDebugBorderProgram()); |
121 EXPECT_PROGRAM_VALID(renderer()->GetSolidColorProgram()); | 121 EXPECT_PROGRAM_VALID(renderer()->GetSolidColorProgram()); |
122 EXPECT_PROGRAM_VALID(renderer()->GetSolidColorProgramAA()); | 122 EXPECT_PROGRAM_VALID(renderer()->GetSolidColorProgramAA()); |
123 } | 123 } |
124 | 124 |
125 void TestShadersWithPrecision(TexCoordPrecision precision) { | 125 void TestShadersWithPrecision(TexCoordPrecision precision) { |
126 EXPECT_PROGRAM_VALID(renderer()->GetTextureIOSurfaceProgram(precision)); | 126 EXPECT_PROGRAM_VALID(renderer()->GetTextureIOSurfaceProgram(precision)); |
127 EXPECT_PROGRAM_VALID(renderer()->GetVideoYUVProgram(precision)); | |
128 EXPECT_PROGRAM_VALID(renderer()->GetVideoYUVAProgram(precision)); | |
129 if (renderer()->Capabilities().using_egl_image) | 127 if (renderer()->Capabilities().using_egl_image) |
130 EXPECT_PROGRAM_VALID(renderer()->GetVideoStreamTextureProgram(precision)); | 128 EXPECT_PROGRAM_VALID(renderer()->GetVideoStreamTextureProgram(precision)); |
131 else | 129 else |
132 EXPECT_FALSE(renderer()->GetVideoStreamTextureProgram(precision)); | 130 EXPECT_FALSE(renderer()->GetVideoStreamTextureProgram(precision)); |
133 } | 131 } |
134 | 132 |
135 void TestShadersWithPrecisionAndBlend(TexCoordPrecision precision, | 133 void TestShadersWithPrecisionAndBlend(TexCoordPrecision precision, |
136 BlendMode blend_mode) { | 134 BlendMode blend_mode) { |
137 EXPECT_PROGRAM_VALID( | 135 EXPECT_PROGRAM_VALID( |
138 renderer()->GetRenderPassProgram(precision, blend_mode)); | 136 renderer()->GetRenderPassProgram(precision, blend_mode)); |
(...skipping 19 matching lines...) Expand all Loading... |
158 sampler)); | 156 sampler)); |
159 | 157 |
160 EXPECT_PROGRAM_VALID(renderer()->GetTileProgram(precision, sampler)); | 158 EXPECT_PROGRAM_VALID(renderer()->GetTileProgram(precision, sampler)); |
161 EXPECT_PROGRAM_VALID(renderer()->GetTileProgramOpaque(precision, sampler)); | 159 EXPECT_PROGRAM_VALID(renderer()->GetTileProgramOpaque(precision, sampler)); |
162 EXPECT_PROGRAM_VALID(renderer()->GetTileProgramAA(precision, sampler)); | 160 EXPECT_PROGRAM_VALID(renderer()->GetTileProgramAA(precision, sampler)); |
163 EXPECT_PROGRAM_VALID(renderer()->GetTileProgramSwizzle(precision, sampler)); | 161 EXPECT_PROGRAM_VALID(renderer()->GetTileProgramSwizzle(precision, sampler)); |
164 EXPECT_PROGRAM_VALID( | 162 EXPECT_PROGRAM_VALID( |
165 renderer()->GetTileProgramSwizzleOpaque(precision, sampler)); | 163 renderer()->GetTileProgramSwizzleOpaque(precision, sampler)); |
166 EXPECT_PROGRAM_VALID( | 164 EXPECT_PROGRAM_VALID( |
167 renderer()->GetTileProgramSwizzleAA(precision, sampler)); | 165 renderer()->GetTileProgramSwizzleAA(precision, sampler)); |
| 166 EXPECT_PROGRAM_VALID(renderer()->GetVideoYUVProgram(precision, sampler)); |
| 167 EXPECT_PROGRAM_VALID(renderer()->GetVideoYUVAProgram(precision, sampler)); |
168 } | 168 } |
169 | 169 |
170 void TestShadersWithMasks(TexCoordPrecision precision, | 170 void TestShadersWithMasks(TexCoordPrecision precision, |
171 SamplerType sampler, | 171 SamplerType sampler, |
172 BlendMode blend_mode, | 172 BlendMode blend_mode, |
173 bool mask_for_background) { | 173 bool mask_for_background) { |
174 if (!renderer()->Capabilities().using_egl_image && | 174 if (!renderer()->Capabilities().using_egl_image && |
175 sampler == SAMPLER_TYPE_EXTERNAL_OES) { | 175 sampler == SAMPLER_TYPE_EXTERNAL_OES) { |
176 // This will likely be hit in tests due to usage of osmesa. | 176 // This will likely be hit in tests due to usage of osmesa. |
177 return; | 177 return; |
(...skipping 2146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2324 EXPECT_CALL(overlay_scheduler, | 2324 EXPECT_CALL(overlay_scheduler, |
2325 Schedule(1, gfx::OVERLAY_TRANSFORM_NONE, _, viewport_rect, | 2325 Schedule(1, gfx::OVERLAY_TRANSFORM_NONE, _, viewport_rect, |
2326 BoundingRect(uv_top_left, uv_bottom_right))).Times(1); | 2326 BoundingRect(uv_top_left, uv_bottom_right))).Times(1); |
2327 | 2327 |
2328 renderer.DrawFrame(&render_passes_in_draw_order_, 1.f, viewport_rect, | 2328 renderer.DrawFrame(&render_passes_in_draw_order_, 1.f, viewport_rect, |
2329 viewport_rect, false); | 2329 viewport_rect, false); |
2330 } | 2330 } |
2331 | 2331 |
2332 } // namespace | 2332 } // namespace |
2333 } // namespace cc | 2333 } // namespace cc |
OLD | NEW |