| 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/service/texture_manager.h" | 5 #include "gpu/command_buffer/service/texture_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 2083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2094 } | 2094 } |
| 2095 return NULL; | 2095 return NULL; |
| 2096 } | 2096 } |
| 2097 | 2097 |
| 2098 GLsizei TextureManager::ComputeMipMapCount(GLenum target, | 2098 GLsizei TextureManager::ComputeMipMapCount(GLenum target, |
| 2099 GLsizei width, | 2099 GLsizei width, |
| 2100 GLsizei height, | 2100 GLsizei height, |
| 2101 GLsizei depth) { | 2101 GLsizei depth) { |
| 2102 switch (target) { | 2102 switch (target) { |
| 2103 case GL_TEXTURE_EXTERNAL_OES: | 2103 case GL_TEXTURE_EXTERNAL_OES: |
| 2104 case GL_TEXTURE_RECTANGLE_ARB: |
| 2104 return 1; | 2105 return 1; |
| 2105 case GL_TEXTURE_3D: | 2106 case GL_TEXTURE_3D: |
| 2106 return 1 + | 2107 return 1 + |
| 2107 base::bits::Log2Floor(std::max(std::max(width, height), depth)); | 2108 base::bits::Log2Floor(std::max(std::max(width, height), depth)); |
| 2108 default: | 2109 default: |
| 2109 return 1 + | 2110 return 1 + |
| 2110 base::bits::Log2Floor(std::max(width, height)); | 2111 base::bits::Log2Floor(std::max(width, height)); |
| 2111 } | 2112 } |
| 2112 } | 2113 } |
| 2113 | 2114 |
| (...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3379 uint32_t TextureManager::GetServiceIdGeneration() const { | 3380 uint32_t TextureManager::GetServiceIdGeneration() const { |
| 3380 return current_service_id_generation_; | 3381 return current_service_id_generation_; |
| 3381 } | 3382 } |
| 3382 | 3383 |
| 3383 void TextureManager::IncrementServiceIdGeneration() { | 3384 void TextureManager::IncrementServiceIdGeneration() { |
| 3384 current_service_id_generation_++; | 3385 current_service_id_generation_++; |
| 3385 } | 3386 } |
| 3386 | 3387 |
| 3387 } // namespace gles2 | 3388 } // namespace gles2 |
| 3388 } // namespace gpu | 3389 } // namespace gpu |
| OLD | NEW |