| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/containers/small_map.h" | 8 #include "base/containers/small_map.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 #define SHADER(Src) #Src | 27 #define SHADER(Src) #Src |
| 28 | 28 |
| 29 // clang-format off | 29 // clang-format off |
| 30 const char kVertexShader[] = | 30 const char kVertexShader[] = |
| 31 SHADER( | 31 SHADER( |
| 32 attribute vec2 a_position; | 32 attribute vec2 a_position; |
| 33 varying vec2 v_texCoord; | 33 varying vec2 v_texCoord; |
| 34 void main() { | 34 void main() { |
| 35 gl_Position = vec4(a_position.x, a_position.y, 0.0, 1.0); | 35 gl_Position = vec4(a_position.x, a_position.y, 0.0, 1.0); |
| 36 v_texCoord = vec2((a_position.x + 1) * 0.5, (a_position.y + 1) * 0.5); | 36 v_texCoord = vec2((a_position.x + 1.0) * 0.5, (a_position.y + 1.0) * 0.5); |
| 37 } | 37 } |
| 38 ); | 38 ); |
| 39 const char kFragmentShader[] = | 39 const char kFragmentShader[] = |
| 40 SHADER( | 40 SHADER( |
| 41 uniform sampler2D a_texture; | 41 uniform sampler2D a_texture; |
| 42 varying vec2 v_texCoord; | 42 varying vec2 v_texCoord; |
| 43 void main() { | 43 void main() { |
| 44 gl_FragColor = texture2D(a_texture, v_texCoord.xy); | 44 gl_FragColor = texture2D(a_texture, v_texCoord.xy); |
| 45 } | 45 } |
| 46 ); | 46 ); |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 } | 272 } |
| 273 | 273 |
| 274 for (const auto& entry : aggregates) { | 274 for (const auto& entry : aggregates) { |
| 275 const auto m = entry.second.Divide(kUploadPerfTestRuns); | 275 const auto m = entry.second.Divide(kUploadPerfTestRuns); |
| 276 m.PrintResult(); | 276 m.PrintResult(); |
| 277 } | 277 } |
| 278 } | 278 } |
| 279 | 279 |
| 280 } // namespace | 280 } // namespace |
| 281 } // namespace gpu | 281 } // namespace gpu |
| OLD | NEW |