| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 ASSERT_FALSE(renderer()->IsContextLost()); | 126 ASSERT_FALSE(renderer()->IsContextLost()); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void TestBasicShaders() { | 129 void TestBasicShaders() { |
| 130 EXPECT_PROGRAM_VALID(renderer()->GetDebugBorderProgram()); | 130 EXPECT_PROGRAM_VALID(renderer()->GetDebugBorderProgram()); |
| 131 EXPECT_PROGRAM_VALID(renderer()->GetSolidColorProgram()); | 131 EXPECT_PROGRAM_VALID(renderer()->GetSolidColorProgram()); |
| 132 EXPECT_PROGRAM_VALID(renderer()->GetSolidColorProgramAA()); | 132 EXPECT_PROGRAM_VALID(renderer()->GetSolidColorProgramAA()); |
| 133 } | 133 } |
| 134 | 134 |
| 135 void TestShadersWithPrecision(TexCoordPrecision precision) { | 135 void TestShadersWithPrecision(TexCoordPrecision precision) { |
| 136 EXPECT_PROGRAM_VALID(renderer()->GetTextureIOSurfaceProgram(precision)); | |
| 137 // This program uses external textures and sampler, so it won't compile | 136 // This program uses external textures and sampler, so it won't compile |
| 138 // everywhere. | 137 // everywhere. |
| 139 if (renderer()->Capabilities().using_egl_image) | 138 if (renderer()->Capabilities().using_egl_image) |
| 140 EXPECT_PROGRAM_VALID(renderer()->GetVideoStreamTextureProgram(precision)); | 139 EXPECT_PROGRAM_VALID(renderer()->GetVideoStreamTextureProgram(precision)); |
| 141 } | 140 } |
| 142 | 141 |
| 143 void TestShadersWithPrecisionAndBlend(TexCoordPrecision precision, | 142 void TestShadersWithPrecisionAndBlend(TexCoordPrecision precision, |
| 144 BlendMode blend_mode) { | 143 BlendMode blend_mode) { |
| 145 EXPECT_PROGRAM_VALID( | 144 EXPECT_PROGRAM_VALID( |
| 146 renderer()->GetRenderPassProgram(precision, blend_mode)); | 145 renderer()->GetRenderPassProgram(precision, blend_mode)); |
| (...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 EXPECT_CALL(*context, drawElements(_, _, _, _)); | 939 EXPECT_CALL(*context, drawElements(_, _, _, _)); |
| 941 | 940 |
| 942 // transformed_tile_quad uses GL_LINEAR. | 941 // transformed_tile_quad uses GL_LINEAR. |
| 943 EXPECT_CALL(*context, drawElements(_, _, _, _)); | 942 EXPECT_CALL(*context, drawElements(_, _, _, _)); |
| 944 | 943 |
| 945 // scaled_tile_quad also uses GL_LINEAR. | 944 // scaled_tile_quad also uses GL_LINEAR. |
| 946 EXPECT_CALL(*context, drawElements(_, _, _, _)); | 945 EXPECT_CALL(*context, drawElements(_, _, _, _)); |
| 947 | 946 |
| 948 // The remaining quads also use GL_LINEAR because nearest neighbor | 947 // The remaining quads also use GL_LINEAR because nearest neighbor |
| 949 // filtering is currently only used with tile quads. | 948 // filtering is currently only used with tile quads. |
| 950 EXPECT_CALL(*context, drawElements(_, _, _, _)).Times(6); | 949 EXPECT_CALL(*context, drawElements(_, _, _, _)).Times(5); |
| 951 } | 950 } |
| 952 | 951 |
| 953 gfx::Rect viewport_rect(100, 100); | 952 gfx::Rect viewport_rect(100, 100); |
| 954 renderer.DrawFrame(&render_passes_in_draw_order_, | 953 renderer.DrawFrame(&render_passes_in_draw_order_, |
| 955 1.f, | 954 1.f, |
| 956 viewport_rect, | 955 viewport_rect, |
| 957 viewport_rect, | 956 viewport_rect, |
| 958 false); | 957 false); |
| 959 Mock::VerifyAndClearExpectations(context); | 958 Mock::VerifyAndClearExpectations(context); |
| 960 } | 959 } |
| (...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2149 EXPECT_CALL(overlay_scheduler, | 2148 EXPECT_CALL(overlay_scheduler, |
| 2150 Schedule(1, gfx::OVERLAY_TRANSFORM_NONE, _, viewport_rect, | 2149 Schedule(1, gfx::OVERLAY_TRANSFORM_NONE, _, viewport_rect, |
| 2151 BoundingRect(uv_top_left, uv_bottom_right))).Times(1); | 2150 BoundingRect(uv_top_left, uv_bottom_right))).Times(1); |
| 2152 | 2151 |
| 2153 renderer.DrawFrame(&render_passes_in_draw_order_, 1.f, viewport_rect, | 2152 renderer.DrawFrame(&render_passes_in_draw_order_, 1.f, viewport_rect, |
| 2154 viewport_rect, false); | 2153 viewport_rect, false); |
| 2155 } | 2154 } |
| 2156 | 2155 |
| 2157 } // namespace | 2156 } // namespace |
| 2158 } // namespace cc | 2157 } // namespace cc |
| OLD | NEW |