| 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 "gpu/command_buffer/tests/gl_test_utils.h" |    5 #include "gpu/command_buffer/tests/gl_test_utils.h" | 
|    6  |    6  | 
|    7 #include <GLES2/gl2extchromium.h> |    7 #include <GLES2/gl2extchromium.h> | 
|    8 #include <stdint.h> |    8 #include <stdint.h> | 
|    9 #include <stdio.h> |    9 #include <stdio.h> | 
|   10  |   10  | 
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   64                              static_cast<double>(size.height()), |   64                              static_cast<double>(size.height()), | 
|   65                              kFragmentShader) |   65                              kFragmentShader) | 
|   66               .c_str()); |   66               .c_str()); | 
|   67     default: |   67     default: | 
|   68       NOTREACHED(); |   68       NOTREACHED(); | 
|   69       return 0; |   69       return 0; | 
|   70   } |   70   } | 
|   71 } |   71 } | 
|   72  |   72  | 
|   73 bool GLTestHelper::HasExtension(const char* extension) { |   73 bool GLTestHelper::HasExtension(const char* extension) { | 
|   74   std::string extensions( |   74   // Pad with an extra space to ensure that |extension| is not a substring of | 
|   75       reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS))); |   75   // another extension. | 
|   76   return extensions.find(extension) != std::string::npos; |   76   std::string extensions = | 
 |   77       std::string(reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS))) + | 
 |   78       " "; | 
 |   79   std::string extension_padded = std::string(extension) + " "; | 
 |   80   return extensions.find(extension_padded) != std::string::npos; | 
|   77 } |   81 } | 
|   78  |   82  | 
|   79 bool GLTestHelper::CheckGLError(const char* msg, int line) { |   83 bool GLTestHelper::CheckGLError(const char* msg, int line) { | 
|   80    bool success = true; |   84    bool success = true; | 
|   81    GLenum error = GL_NO_ERROR; |   85    GLenum error = GL_NO_ERROR; | 
|   82    while ((error = glGetError()) != GL_NO_ERROR) { |   86    while ((error = glGetError()) != GL_NO_ERROR) { | 
|   83      success = false; |   87      success = false; | 
|   84      EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), error) |   88      EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), error) | 
|   85          << "GL ERROR in " << msg << " at line " << line << " : " << error; |   89          << "GL ERROR in " << msg << " at line " << line << " : " << error; | 
|   86    } |   90    } | 
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  352   ASSERT_NE(vertex_buffer, 0u); |  356   ASSERT_NE(vertex_buffer, 0u); | 
|  353   glUniform1i(sampler_location, 0); |  357   glUniform1i(sampler_location, 0); | 
|  354  |  358  | 
|  355   glDrawArrays(GL_TRIANGLES, 0, 6); |  359   glDrawArrays(GL_TRIANGLES, 0, 6); | 
|  356  |  360  | 
|  357   glDeleteShader(vertex_shader); |  361   glDeleteShader(vertex_shader); | 
|  358   glDeleteShader(fragment_shader); |  362   glDeleteShader(fragment_shader); | 
|  359   glDeleteProgram(program); |  363   glDeleteProgram(program); | 
|  360   glDeleteBuffers(1, &vertex_buffer); |  364   glDeleteBuffers(1, &vertex_buffer); | 
|  361 } |  365 } | 
| OLD | NEW |