| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 GLRendererPixelTest::SetUp(); | 110 GLRendererPixelTest::SetUp(); |
| 111 ASSERT_FALSE(renderer()->IsContextLost()); | 111 ASSERT_FALSE(renderer()->IsContextLost()); |
| 112 } | 112 } |
| 113 | 113 |
| 114 void TearDown() override { | 114 void TearDown() override { |
| 115 GLRendererPixelTest::TearDown(); | 115 GLRendererPixelTest::TearDown(); |
| 116 ASSERT_FALSE(renderer()->IsContextLost()); | 116 ASSERT_FALSE(renderer()->IsContextLost()); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void TestBasicShaders() { | 119 void TestBasicShaders() { |
| 120 EXPECT_PROGRAM_VALID(renderer()->GetTileCheckerboardProgram()); | |
| 121 EXPECT_PROGRAM_VALID(renderer()->GetDebugBorderProgram()); | 120 EXPECT_PROGRAM_VALID(renderer()->GetDebugBorderProgram()); |
| 122 EXPECT_PROGRAM_VALID(renderer()->GetSolidColorProgram()); | 121 EXPECT_PROGRAM_VALID(renderer()->GetSolidColorProgram()); |
| 123 EXPECT_PROGRAM_VALID(renderer()->GetSolidColorProgramAA()); | 122 EXPECT_PROGRAM_VALID(renderer()->GetSolidColorProgramAA()); |
| 124 } | 123 } |
| 125 | 124 |
| 126 void TestShadersWithPrecision(TexCoordPrecision precision) { | 125 void TestShadersWithPrecision(TexCoordPrecision precision) { |
| 127 EXPECT_PROGRAM_VALID(renderer()->GetTextureIOSurfaceProgram(precision)); | 126 EXPECT_PROGRAM_VALID(renderer()->GetTextureIOSurfaceProgram(precision)); |
| 128 if (renderer()->Capabilities().using_egl_image) | 127 if (renderer()->Capabilities().using_egl_image) |
| 129 EXPECT_PROGRAM_VALID(renderer()->GetVideoStreamTextureProgram(precision)); | 128 EXPECT_PROGRAM_VALID(renderer()->GetVideoStreamTextureProgram(precision)); |
| 130 else | 129 else |
| (...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1008 EXPECT_CALL(*context, drawElements(_, _, _, _)); | 1007 EXPECT_CALL(*context, drawElements(_, _, _, _)); |
| 1009 | 1008 |
| 1010 // transformed_tile_quad uses GL_LINEAR. | 1009 // transformed_tile_quad uses GL_LINEAR. |
| 1011 EXPECT_CALL(*context, drawElements(_, _, _, _)); | 1010 EXPECT_CALL(*context, drawElements(_, _, _, _)); |
| 1012 | 1011 |
| 1013 // scaled_tile_quad also uses GL_LINEAR. | 1012 // scaled_tile_quad also uses GL_LINEAR. |
| 1014 EXPECT_CALL(*context, drawElements(_, _, _, _)); | 1013 EXPECT_CALL(*context, drawElements(_, _, _, _)); |
| 1015 | 1014 |
| 1016 // The remaining quads also use GL_LINEAR because nearest neighbor | 1015 // The remaining quads also use GL_LINEAR because nearest neighbor |
| 1017 // filtering is currently only used with tile quads. | 1016 // filtering is currently only used with tile quads. |
| 1018 EXPECT_CALL(*context, drawElements(_, _, _, _)).Times(7); | 1017 EXPECT_CALL(*context, drawElements(_, _, _, _)).Times(6); |
| 1019 } | 1018 } |
| 1020 | 1019 |
| 1021 gfx::Rect viewport_rect(100, 100); | 1020 gfx::Rect viewport_rect(100, 100); |
| 1022 renderer.DrawFrame(&render_passes_in_draw_order_, | 1021 renderer.DrawFrame(&render_passes_in_draw_order_, |
| 1023 1.f, | 1022 1.f, |
| 1024 viewport_rect, | 1023 viewport_rect, |
| 1025 viewport_rect, | 1024 viewport_rect, |
| 1026 false); | 1025 false); |
| 1027 Mock::VerifyAndClearExpectations(context); | 1026 Mock::VerifyAndClearExpectations(context); |
| 1028 } | 1027 } |
| (...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2237 EXPECT_CALL(overlay_scheduler, | 2236 EXPECT_CALL(overlay_scheduler, |
| 2238 Schedule(1, gfx::OVERLAY_TRANSFORM_NONE, _, viewport_rect, | 2237 Schedule(1, gfx::OVERLAY_TRANSFORM_NONE, _, viewport_rect, |
| 2239 BoundingRect(uv_top_left, uv_bottom_right))).Times(1); | 2238 BoundingRect(uv_top_left, uv_bottom_right))).Times(1); |
| 2240 | 2239 |
| 2241 renderer.DrawFrame(&render_passes_in_draw_order_, 1.f, viewport_rect, | 2240 renderer.DrawFrame(&render_passes_in_draw_order_, 1.f, viewport_rect, |
| 2242 viewport_rect, false); | 2241 viewport_rect, false); |
| 2243 } | 2242 } |
| 2244 | 2243 |
| 2245 } // namespace | 2244 } // namespace |
| 2246 } // namespace cc | 2245 } // namespace cc |
| OLD | NEW |