| 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 glDeleteProgram(program_object_); | 186 glDeleteProgram(program_object_); |
| 187 glDeleteShader(vertex_shader_); | 187 glDeleteShader(vertex_shader_); |
| 188 glDeleteShader(fragment_shader_); | 188 glDeleteShader(fragment_shader_); |
| 189 glDeleteBuffersARB(1, &vertex_buffer_); | 189 glDeleteBuffersARB(1, &vertex_buffer_); |
| 190 | 190 |
| 191 glBindFramebufferEXT(GL_FRAMEBUFFER, 0); | 191 glBindFramebufferEXT(GL_FRAMEBUFFER, 0); |
| 192 glDeleteFramebuffersEXT(1, &framebuffer_object_); | 192 glDeleteFramebuffersEXT(1, &framebuffer_object_); |
| 193 glDeleteTextures(1, &color_texture_); | 193 glDeleteTextures(1, &color_texture_); |
| 194 CheckNoGlError(); | 194 CheckNoGlError(); |
| 195 | 195 |
| 196 gpu_timing_client_ = nullptr; |
| 196 gl_context_ = nullptr; | 197 gl_context_ = nullptr; |
| 197 surface_ = nullptr; | 198 surface_ = nullptr; |
| 198 } | 199 } |
| 199 | 200 |
| 200 protected: | 201 protected: |
| 201 // Upload and draw on the offscren surface. | 202 // Upload and draw on the offscren surface. |
| 202 // Return a list of pair. Each pair describe a gl operation and the wall | 203 // Return a list of pair. Each pair describe a gl operation and the wall |
| 203 // time elapsed in milliseconds. | 204 // time elapsed in milliseconds. |
| 204 std::vector<Measurement> UploadAndDraw(const gfx::Size& size, | 205 std::vector<Measurement> UploadAndDraw(const gfx::Size& size, |
| 205 const std::vector<uint8>& pixels, | 206 const std::vector<uint8>& pixels, |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 | 325 |
| 325 DCHECK_NE(0u, framebuffer_object_); | 326 DCHECK_NE(0u, framebuffer_object_); |
| 326 glBindFramebufferEXT(GL_FRAMEBUFFER, framebuffer_object_); | 327 glBindFramebufferEXT(GL_FRAMEBUFFER, framebuffer_object_); |
| 327 | 328 |
| 328 RunUploadAndDrawMultipleTimes(size); | 329 RunUploadAndDrawMultipleTimes(size); |
| 329 } | 330 } |
| 330 } | 331 } |
| 331 | 332 |
| 332 } // namespace | 333 } // namespace |
| 333 } // namespace gpu | 334 } // namespace gpu |
| OLD | NEW |