| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/GLES2/gles2_command_buffer.h" | 10 #include "gpu/GLES2/gles2_command_buffer.h" |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 default: | 273 default: |
| 274 NOTREACHED(); | 274 NOTREACHED(); |
| 275 break; | 275 break; |
| 276 } | 276 } |
| 277 Update(feature_info); | 277 Update(feature_info); |
| 278 } | 278 } |
| 279 | 279 |
| 280 void TextureManager::TextureInfo::Update(const FeatureInfo* feature_info) { | 280 void TextureManager::TextureInfo::Update(const FeatureInfo* feature_info) { |
| 281 // Update npot status. | 281 // Update npot status. |
| 282 npot_ = false; | 282 npot_ = false; |
| 283 |
| 284 if (level_infos_.empty()) { |
| 285 texture_complete_ = false; |
| 286 cube_complete_ = false; |
| 287 return; |
| 288 } |
| 289 |
| 283 for (size_t ii = 0; ii < level_infos_.size(); ++ii) { | 290 for (size_t ii = 0; ii < level_infos_.size(); ++ii) { |
| 284 const TextureInfo::LevelInfo& info = level_infos_[ii][0]; | 291 const TextureInfo::LevelInfo& info = level_infos_[ii][0]; |
| 285 if (GLES2Util::IsNPOT(info.width) || | 292 if (GLES2Util::IsNPOT(info.width) || |
| 286 GLES2Util::IsNPOT(info.height) || | 293 GLES2Util::IsNPOT(info.height) || |
| 287 GLES2Util::IsNPOT(info.depth)) { | 294 GLES2Util::IsNPOT(info.depth)) { |
| 288 npot_ = true; | 295 npot_ = true; |
| 289 break; | 296 break; |
| 290 } | 297 } |
| 291 } | 298 } |
| 292 | 299 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 return true; | 531 return true; |
| 525 } | 532 } |
| 526 } | 533 } |
| 527 return false; | 534 return false; |
| 528 } | 535 } |
| 529 | 536 |
| 530 } // namespace gles2 | 537 } // namespace gles2 |
| 531 } // namespace gpu | 538 } // namespace gpu |
| 532 | 539 |
| 533 | 540 |
| OLD | NEW |