| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 SHADER( | 61 SHADER( |
| 62 uniform sampler2D a_texture; | 62 uniform sampler2D a_texture; |
| 63 varying vec2 v_texCoord; | 63 varying vec2 v_texCoord; |
| 64 void main() { | 64 void main() { |
| 65 gl_FragColor = texture2D(a_texture, v_texCoord); | 65 gl_FragColor = texture2D(a_texture, v_texCoord); |
| 66 } | 66 } |
| 67 ); | 67 ); |
| 68 // clang-format on | 68 // clang-format on |
| 69 | 69 |
| 70 void CheckNoGlError(const std::string& msg) { | 70 void CheckNoGlError(const std::string& msg) { |
| 71 CHECK_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError()) << " " << msg; | 71 LOG_IF(FATAL, static_cast<GLenum>(GL_NO_ERROR) != glGetError()) << msg; |
| 72 } | 72 } |
| 73 | 73 |
| 74 // Utility function to compile a shader from a string. | 74 // Utility function to compile a shader from a string. |
| 75 GLuint LoadShader(const GLenum type, const char* const src) { | 75 GLuint LoadShader(const GLenum type, const char* const src) { |
| 76 GLuint shader = 0; | 76 GLuint shader = 0; |
| 77 shader = glCreateShader(type); | 77 shader = glCreateShader(type); |
| 78 CHECK_NE(0u, shader); | 78 CHECK_NE(0u, shader); |
| 79 glShaderSource(shader, 1, &src, NULL); | 79 glShaderSource(shader, 1, &src, NULL); |
| 80 glCompileShader(shader); | 80 glCompileShader(shader); |
| 81 | 81 |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 gpu_timing_client_->CheckAndResetTimerErrors(); | 551 gpu_timing_client_->CheckAndResetTimerErrors(); |
| 552 if (!gpu_timer_errors) { | 552 if (!gpu_timer_errors) { |
| 553 upload_and_draw_timers.GetAsMeasurement("upload_and_draw") | 553 upload_and_draw_timers.GetAsMeasurement("upload_and_draw") |
| 554 .PrintResult("renaming"); | 554 .PrintResult("renaming"); |
| 555 finish_timers.GetAsMeasurement("finish").PrintResult("renaming"); | 555 finish_timers.GetAsMeasurement("finish").PrintResult("renaming"); |
| 556 } | 556 } |
| 557 } | 557 } |
| 558 | 558 |
| 559 } // namespace | 559 } // namespace |
| 560 } // namespace gpu | 560 } // namespace gpu |
| OLD | NEW |