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 2086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2097 } | 2097 } |
2098 return NULL; | 2098 return NULL; |
2099 } | 2099 } |
2100 | 2100 |
2101 GLsizei TextureManager::ComputeMipMapCount(GLenum target, | 2101 GLsizei TextureManager::ComputeMipMapCount(GLenum target, |
2102 GLsizei width, | 2102 GLsizei width, |
2103 GLsizei height, | 2103 GLsizei height, |
2104 GLsizei depth) { | 2104 GLsizei depth) { |
2105 switch (target) { | 2105 switch (target) { |
2106 case GL_TEXTURE_EXTERNAL_OES: | 2106 case GL_TEXTURE_EXTERNAL_OES: |
| 2107 case GL_TEXTURE_RECTANGLE_ARB: |
2107 return 1; | 2108 return 1; |
2108 case GL_TEXTURE_3D: | 2109 case GL_TEXTURE_3D: |
2109 return 1 + | 2110 return 1 + |
2110 base::bits::Log2Floor(std::max(std::max(width, height), depth)); | 2111 base::bits::Log2Floor(std::max(std::max(width, height), depth)); |
2111 default: | 2112 default: |
2112 return 1 + | 2113 return 1 + |
2113 base::bits::Log2Floor(std::max(width, height)); | 2114 base::bits::Log2Floor(std::max(width, height)); |
2114 } | 2115 } |
2115 } | 2116 } |
2116 | 2117 |
(...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3382 uint32_t TextureManager::GetServiceIdGeneration() const { | 3383 uint32_t TextureManager::GetServiceIdGeneration() const { |
3383 return current_service_id_generation_; | 3384 return current_service_id_generation_; |
3384 } | 3385 } |
3385 | 3386 |
3386 void TextureManager::IncrementServiceIdGeneration() { | 3387 void TextureManager::IncrementServiceIdGeneration() { |
3387 current_service_id_generation_++; | 3388 current_service_id_generation_++; |
3388 } | 3389 } |
3389 | 3390 |
3390 } // namespace gles2 | 3391 } // namespace gles2 |
3391 } // namespace gpu | 3392 } // namespace gpu |
OLD | NEW |