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 <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bits.h" | 10 #include "base/bits.h" |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 info.width = width; | 619 info.width = width; |
620 info.height = height; | 620 info.height = height; |
621 info.depth = depth; | 621 info.depth = depth; |
622 info.border = border; | 622 info.border = border; |
623 info.format = format; | 623 info.format = format; |
624 info.type = type; | 624 info.type = type; |
625 info.image = 0; | 625 info.image = 0; |
626 | 626 |
627 estimated_size_ -= info.estimated_size; | 627 estimated_size_ -= info.estimated_size; |
628 GLES2Util::ComputeImageDataSizes( | 628 GLES2Util::ComputeImageDataSizes( |
629 width, height, format, type, 4, &info.estimated_size, NULL, NULL); | 629 width, height, 1, format, type, 4, &info.estimated_size, NULL, NULL); |
630 estimated_size_ += info.estimated_size; | 630 estimated_size_ += info.estimated_size; |
631 | 631 |
632 UpdateMipCleared(&info, cleared); | 632 UpdateMipCleared(&info, cleared); |
633 max_level_set_ = std::max(max_level_set_, level); | 633 max_level_set_ = std::max(max_level_set_, level); |
634 Update(feature_info); | 634 Update(feature_info); |
635 UpdateCleared(); | 635 UpdateCleared(); |
636 UpdateCanRenderCondition(); | 636 UpdateCanRenderCondition(); |
637 UpdateHasImages(); | 637 UpdateHasImages(); |
638 if (IsAttachedToFramebuffer()) { | 638 if (IsAttachedToFramebuffer()) { |
639 // TODO(gman): If textures tracked which framebuffers they were attached to | 639 // TODO(gman): If textures tracked which framebuffers they were attached to |
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1722 } | 1722 } |
1723 | 1723 |
1724 ScopedTextureUploadTimer::~ScopedTextureUploadTimer() { | 1724 ScopedTextureUploadTimer::~ScopedTextureUploadTimer() { |
1725 texture_state_->texture_upload_count++; | 1725 texture_state_->texture_upload_count++; |
1726 texture_state_->total_texture_upload_time += | 1726 texture_state_->total_texture_upload_time += |
1727 base::TimeTicks::HighResNow() - begin_time_; | 1727 base::TimeTicks::HighResNow() - begin_time_; |
1728 } | 1728 } |
1729 | 1729 |
1730 } // namespace gles2 | 1730 } // namespace gles2 |
1731 } // namespace gpu | 1731 } // namespace gpu |
OLD | NEW |