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 <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1429 } | 1429 } |
1430 } | 1430 } |
1431 } | 1431 } |
1432 | 1432 |
1433 *black_texture = ids[0]; | 1433 *black_texture = ids[0]; |
1434 return default_texture; | 1434 return default_texture; |
1435 } | 1435 } |
1436 | 1436 |
1437 bool TextureManager::ValidForTarget( | 1437 bool TextureManager::ValidForTarget( |
1438 GLenum target, GLint level, GLsizei width, GLsizei height, GLsizei depth) { | 1438 GLenum target, GLint level, GLsizei width, GLsizei height, GLsizei depth) { |
1439 if (level > 0 && !feature_info_->IsES3Capable()) | |
Zhenyao Mo
2015/07/21 21:25:05
This is the wrong place for this validation. We o
| |
1440 return false; | |
1439 GLsizei max_size = MaxSizeForTarget(target) >> level; | 1441 GLsizei max_size = MaxSizeForTarget(target) >> level; |
1440 return level >= 0 && | 1442 return level >= 0 && |
1441 width >= 0 && | 1443 width >= 0 && |
1442 height >= 0 && | 1444 height >= 0 && |
1443 depth >= 0 && | 1445 depth >= 0 && |
1444 level < MaxLevelsForTarget(target) && | 1446 level < MaxLevelsForTarget(target) && |
1445 width <= max_size && | 1447 width <= max_size && |
1446 height <= max_size && | 1448 height <= max_size && |
1447 depth <= max_size && | 1449 depth <= max_size && |
1448 (level == 0 || feature_info_->feature_flags().npot_ok || | 1450 (level == 0 || feature_info_->feature_flags().npot_ok || |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2022 } | 2024 } |
2023 | 2025 |
2024 ScopedTextureUploadTimer::~ScopedTextureUploadTimer() { | 2026 ScopedTextureUploadTimer::~ScopedTextureUploadTimer() { |
2025 texture_state_->texture_upload_count++; | 2027 texture_state_->texture_upload_count++; |
2026 texture_state_->total_texture_upload_time += | 2028 texture_state_->total_texture_upload_time += |
2027 base::TimeTicks::Now() - begin_time_; | 2029 base::TimeTicks::Now() - begin_time_; |
2028 } | 2030 } |
2029 | 2031 |
2030 } // namespace gles2 | 2032 } // namespace gles2 |
2031 } // namespace gpu | 2033 } // namespace gpu |
OLD | NEW |