| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 } | 116 } |
| 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()->GetTextureProgram(precision)); | |
| 127 EXPECT_PROGRAM_VALID( | |
| 128 renderer()->GetNonPremultipliedTextureProgram(precision)); | |
| 129 EXPECT_PROGRAM_VALID(renderer()->GetTextureBackgroundProgram(precision)); | |
| 130 EXPECT_PROGRAM_VALID( | |
| 131 renderer()->GetNonPremultipliedTextureBackgroundProgram(precision)); | |
| 132 EXPECT_PROGRAM_VALID(renderer()->GetTextureIOSurfaceProgram(precision)); | 126 EXPECT_PROGRAM_VALID(renderer()->GetTextureIOSurfaceProgram(precision)); |
| 133 EXPECT_PROGRAM_VALID(renderer()->GetVideoYUVProgram(precision)); | 127 EXPECT_PROGRAM_VALID(renderer()->GetVideoYUVProgram(precision)); |
| 134 EXPECT_PROGRAM_VALID(renderer()->GetVideoYUVAProgram(precision)); | 128 EXPECT_PROGRAM_VALID(renderer()->GetVideoYUVAProgram(precision)); |
| 135 if (renderer()->Capabilities().using_egl_image) | 129 if (renderer()->Capabilities().using_egl_image) |
| 136 EXPECT_PROGRAM_VALID(renderer()->GetVideoStreamTextureProgram(precision)); | 130 EXPECT_PROGRAM_VALID(renderer()->GetVideoStreamTextureProgram(precision)); |
| 137 else | 131 else |
| 138 EXPECT_FALSE(renderer()->GetVideoStreamTextureProgram(precision)); | 132 EXPECT_FALSE(renderer()->GetVideoStreamTextureProgram(precision)); |
| 139 } | 133 } |
| 140 | 134 |
| 141 void TestShadersWithPrecisionAndBlend(TexCoordPrecision precision, | 135 void TestShadersWithPrecisionAndBlend(TexCoordPrecision precision, |
| 142 BlendMode blend_mode) { | 136 BlendMode blend_mode) { |
| 143 EXPECT_PROGRAM_VALID( | 137 EXPECT_PROGRAM_VALID( |
| 144 renderer()->GetRenderPassProgram(precision, blend_mode)); | 138 renderer()->GetRenderPassProgram(precision, blend_mode)); |
| 145 EXPECT_PROGRAM_VALID( | 139 EXPECT_PROGRAM_VALID( |
| 146 renderer()->GetRenderPassProgramAA(precision, blend_mode)); | 140 renderer()->GetRenderPassProgramAA(precision, blend_mode)); |
| 147 } | 141 } |
| 148 | 142 |
| 149 void TestShadersWithPrecisionAndSampler(TexCoordPrecision precision, | 143 void TestShadersWithPrecisionAndSampler(TexCoordPrecision precision, |
| 150 SamplerType sampler) { | 144 SamplerType sampler) { |
| 151 if (!renderer()->Capabilities().using_egl_image && | 145 if (!renderer()->Capabilities().using_egl_image && |
| 152 sampler == SAMPLER_TYPE_EXTERNAL_OES) { | 146 sampler == SAMPLER_TYPE_EXTERNAL_OES) { |
| 153 // This will likely be hit in tests due to usage of osmesa. | 147 // This will likely be hit in tests due to usage of osmesa. |
| 154 return; | 148 return; |
| 155 } | 149 } |
| 156 | 150 |
| 151 EXPECT_PROGRAM_VALID(renderer()->GetTextureProgram(precision, sampler)); |
| 152 EXPECT_PROGRAM_VALID( |
| 153 renderer()->GetNonPremultipliedTextureProgram(precision, sampler)); |
| 154 EXPECT_PROGRAM_VALID( |
| 155 renderer()->GetTextureBackgroundProgram(precision, sampler)); |
| 156 EXPECT_PROGRAM_VALID( |
| 157 renderer()->GetNonPremultipliedTextureBackgroundProgram(precision, |
| 158 sampler)); |
| 159 |
| 157 EXPECT_PROGRAM_VALID(renderer()->GetTileProgram(precision, sampler)); | 160 EXPECT_PROGRAM_VALID(renderer()->GetTileProgram(precision, sampler)); |
| 158 EXPECT_PROGRAM_VALID(renderer()->GetTileProgramOpaque(precision, sampler)); | 161 EXPECT_PROGRAM_VALID(renderer()->GetTileProgramOpaque(precision, sampler)); |
| 159 EXPECT_PROGRAM_VALID(renderer()->GetTileProgramAA(precision, sampler)); | 162 EXPECT_PROGRAM_VALID(renderer()->GetTileProgramAA(precision, sampler)); |
| 160 EXPECT_PROGRAM_VALID(renderer()->GetTileProgramSwizzle(precision, sampler)); | 163 EXPECT_PROGRAM_VALID(renderer()->GetTileProgramSwizzle(precision, sampler)); |
| 161 EXPECT_PROGRAM_VALID( | 164 EXPECT_PROGRAM_VALID( |
| 162 renderer()->GetTileProgramSwizzleOpaque(precision, sampler)); | 165 renderer()->GetTileProgramSwizzleOpaque(precision, sampler)); |
| 163 EXPECT_PROGRAM_VALID( | 166 EXPECT_PROGRAM_VALID( |
| 164 renderer()->GetTileProgramSwizzleAA(precision, sampler)); | 167 renderer()->GetTileProgramSwizzleAA(precision, sampler)); |
| 165 } | 168 } |
| 166 | 169 |
| (...skipping 2154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2321 EXPECT_CALL(overlay_scheduler, | 2324 EXPECT_CALL(overlay_scheduler, |
| 2322 Schedule(1, gfx::OVERLAY_TRANSFORM_NONE, _, viewport_rect, | 2325 Schedule(1, gfx::OVERLAY_TRANSFORM_NONE, _, viewport_rect, |
| 2323 BoundingRect(uv_top_left, uv_bottom_right))).Times(1); | 2326 BoundingRect(uv_top_left, uv_bottom_right))).Times(1); |
| 2324 | 2327 |
| 2325 renderer.DrawFrame(&render_passes_in_draw_order_, 1.f, viewport_rect, | 2328 renderer.DrawFrame(&render_passes_in_draw_order_, 1.f, viewport_rect, |
| 2326 viewport_rect, false); | 2329 viewport_rect, false); |
| 2327 } | 2330 } |
| 2328 | 2331 |
| 2329 } // namespace | 2332 } // namespace |
| 2330 } // namespace cc | 2333 } // namespace cc |
| OLD | NEW |