| 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/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 glFramebufferTexture2DEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, | 116 glFramebufferTexture2DEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, |
| 117 GL_TEXTURE_2D, color_texture_, 0); | 117 GL_TEXTURE_2D, color_texture_, 0); |
| 118 DCHECK_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_COMPLETE), | 118 DCHECK_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_COMPLETE), |
| 119 glCheckFramebufferStatusEXT(GL_FRAMEBUFFER)); | 119 glCheckFramebufferStatusEXT(GL_FRAMEBUFFER)); |
| 120 | 120 |
| 121 glViewport(0, 0, size_.width(), size_.height()); | 121 glViewport(0, 0, size_.width(), size_.height()); |
| 122 | 122 |
| 123 if (gpu_timing_.Initialize(gl_context_.get())) { | 123 if (gpu_timing_.Initialize(gl_context_.get())) { |
| 124 LOG(INFO) << "Gpu timing initialized with timer type: " | 124 LOG(INFO) << "Gpu timing initialized with timer type: " |
| 125 << gpu_timing_.GetTimerTypeName(); | 125 << gpu_timing_.GetTimerTypeName(); |
| 126 gpu_timing_.CheckAndResetTimerErrors(); | |
| 127 gpu_timing_.InvalidateTimerOffset(); | 126 gpu_timing_.InvalidateTimerOffset(); |
| 128 } else { | 127 } else { |
| 129 LOG(WARNING) << "Can't initialize gpu timing"; | 128 LOG(WARNING) << "Can't initialize gpu timing"; |
| 130 } | 129 } |
| 131 // Prepare a simple program and a vertex buffer that will be | 130 // Prepare a simple program and a vertex buffer that will be |
| 132 // used to draw a quad on the offscreen surface. | 131 // used to draw a quad on the offscreen surface. |
| 133 vertex_shader_ = LoadShader(GL_VERTEX_SHADER, kVertexShader); | 132 vertex_shader_ = LoadShader(GL_VERTEX_SHADER, kVertexShader); |
| 134 fragment_shader_ = LoadShader(GL_FRAGMENT_SHADER, kFragmentShader); | 133 fragment_shader_ = LoadShader(GL_FRAGMENT_SHADER, kFragmentShader); |
| 135 program_object_ = glCreateProgram(); | 134 program_object_ = glCreateProgram(); |
| 136 CHECK_NE(0u, program_object_); | 135 CHECK_NE(0u, program_object_); |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 } | 269 } |
| 271 | 270 |
| 272 for (const auto& entry : aggregates) { | 271 for (const auto& entry : aggregates) { |
| 273 const auto m = entry.second.Divide(kUploadPerfTestRuns); | 272 const auto m = entry.second.Divide(kUploadPerfTestRuns); |
| 274 m.PrintResult(); | 273 m.PrintResult(); |
| 275 } | 274 } |
| 276 } | 275 } |
| 277 | 276 |
| 278 } // namespace | 277 } // namespace |
| 279 } // namespace gpu | 278 } // namespace gpu |
| OLD | NEW |