OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <GLES2/gl2.h> | 5 #include <GLES2/gl2.h> |
6 #include <GLES2/gl2ext.h> | 6 #include <GLES2/gl2ext.h> |
7 | 7 |
8 #include "gpu/command_buffer/tests/gl_manager.h" | 8 #include "gpu/command_buffer/tests/gl_manager.h" |
9 #include "gpu/command_buffer/tests/gl_test_utils.h" | 9 #include "gpu/command_buffer/tests/gl_test_utils.h" |
10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 namespace { | 54 namespace { |
55 | 55 |
56 struct FormatType { | 56 struct FormatType { |
57 GLenum format; | 57 GLenum format; |
58 GLenum type; | 58 GLenum type; |
59 }; | 59 }; |
60 | 60 |
61 } // anonymous namespace | 61 } // anonymous namespace |
62 | 62 |
63 // Temporarily marked disabled due to failure on gpu bots. | 63 TEST_F(DepthTextureTest, RenderTo) { |
64 // https://code.google.com/p/chromium/issues/detail?id=135229 | |
65 TEST_F(DepthTextureTest, DISABLED_RenderTo) { | |
66 if (!GLTestHelper::HasExtension("GL_CHROMIUM_depth_texture")) { | 64 if (!GLTestHelper::HasExtension("GL_CHROMIUM_depth_texture")) { |
67 return; | 65 return; |
68 } | 66 } |
69 | 67 |
70 bool have_depth_stencil = GLTestHelper::HasExtension( | 68 bool have_depth_stencil = GLTestHelper::HasExtension( |
71 "GL_OES_packed_depth_stencil"); | 69 "GL_OES_packed_depth_stencil"); |
72 | 70 |
73 static const char* v_shader_str = SHADER( | 71 static const char* v_shader_str = SHADER( |
74 attribute vec4 v_position; | 72 attribute vec4 v_position; |
75 void main() | 73 void main() |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 180 |
183 EXPECT_EQ(actual[0], actual[1]); | 181 EXPECT_EQ(actual[0], actual[1]); |
184 EXPECT_EQ(actual[1], actual[2]); | 182 EXPECT_EQ(actual[1], actual[2]); |
185 | 183 |
186 if (xx > 0) { | 184 if (xx > 0) { |
187 EXPECT_GT(actual[0], left[0]); | 185 EXPECT_GT(actual[0], left[0]); |
188 } | 186 } |
189 if (yy > 0) { | 187 if (yy > 0) { |
190 EXPECT_GT(actual[0], down[0]); | 188 EXPECT_GT(actual[0], down[0]); |
191 } | 189 } |
| 190 |
| 191 EXPECT_TRUE(actual[3] == actual[0] || actual[3] == 0xFF); |
192 } | 192 } |
193 } | 193 } |
194 | 194 |
195 // Check that bottom left corner is vastly different thatn top right. | 195 // Check that bottom left corner is vastly different thatn top right. |
196 EXPECT_GT( | 196 EXPECT_GT( |
197 actual_pixels[(kResolution * kResolution - 1) * 4] - actual_pixels[0], | 197 actual_pixels[(kResolution * kResolution - 1) * 4] - actual_pixels[0], |
198 0xC0); | 198 0xC0); |
199 GLTestHelper::CheckGLError("no errors", __LINE__); | 199 GLTestHelper::CheckGLError("no errors", __LINE__); |
200 } | 200 } |
201 } | 201 } |
202 | 202 |
203 } // namespace gpu | 203 } // namespace gpu |
204 | 204 |
205 | 205 |
206 | 206 |
OLD | NEW |