| 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 #include "base/bits.h" | 6 #include "base/bits.h" |
| 7 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 7 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 8 #include "gpu/command_buffer/service/feature_info.h" | 8 #include "gpu/command_buffer/service/feature_info.h" |
| 9 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 9 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 10 #include "gpu/command_buffer/service/mailbox_manager.h" | 10 #include "gpu/command_buffer/service/mailbox_manager.h" |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 ++num_uncleared_mips_; | 614 ++num_uncleared_mips_; |
| 615 } | 615 } |
| 616 return info.cleared; | 616 return info.cleared; |
| 617 } | 617 } |
| 618 | 618 |
| 619 TextureManager::TextureManager( | 619 TextureManager::TextureManager( |
| 620 MemoryTracker* memory_tracker, | 620 MemoryTracker* memory_tracker, |
| 621 FeatureInfo* feature_info, | 621 FeatureInfo* feature_info, |
| 622 GLint max_texture_size, | 622 GLint max_texture_size, |
| 623 GLint max_cube_map_texture_size) | 623 GLint max_cube_map_texture_size) |
| 624 : texture_memory_tracker_(new MemoryTypeTracker( | 624 : texture_memory_tracker_(new MemoryTypeTracker(memory_tracker)), |
| 625 memory_tracker, | |
| 626 "TextureManager", | |
| 627 "TextureMemory")), | |
| 628 feature_info_(feature_info), | 625 feature_info_(feature_info), |
| 629 max_texture_size_(max_texture_size), | 626 max_texture_size_(max_texture_size), |
| 630 max_cube_map_texture_size_(max_cube_map_texture_size), | 627 max_cube_map_texture_size_(max_cube_map_texture_size), |
| 631 max_levels_(ComputeMipMapCount(max_texture_size, | 628 max_levels_(ComputeMipMapCount(max_texture_size, |
| 632 max_texture_size, | 629 max_texture_size, |
| 633 max_texture_size)), | 630 max_texture_size)), |
| 634 max_cube_map_levels_(ComputeMipMapCount(max_cube_map_texture_size, | 631 max_cube_map_levels_(ComputeMipMapCount(max_cube_map_texture_size, |
| 635 max_cube_map_texture_size, | 632 max_cube_map_texture_size, |
| 636 max_cube_map_texture_size)), | 633 max_cube_map_texture_size)), |
| 637 num_unrenderable_textures_(0), | 634 num_unrenderable_textures_(0), |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1070 return false; | 1067 return false; |
| 1071 } | 1068 } |
| 1072 | 1069 |
| 1073 GLsizei TextureManager::ComputeMipMapCount( | 1070 GLsizei TextureManager::ComputeMipMapCount( |
| 1074 GLsizei width, GLsizei height, GLsizei depth) { | 1071 GLsizei width, GLsizei height, GLsizei depth) { |
| 1075 return 1 + base::bits::Log2Floor(std::max(std::max(width, height), depth)); | 1072 return 1 + base::bits::Log2Floor(std::max(std::max(width, height), depth)); |
| 1076 } | 1073 } |
| 1077 | 1074 |
| 1078 } // namespace gles2 | 1075 } // namespace gles2 |
| 1079 } // namespace gpu | 1076 } // namespace gpu |
| OLD | NEW |