OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "cc/tiles/software_image_decode_controller.h" | 5 #include "cc/tiles/software_image_decode_controller.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <functional> | 9 #include <functional> |
10 | 10 |
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 base::HashInts(src_rect_.width(), src_rect_.height()))); | 814 base::HashInts(src_rect_.width(), src_rect_.height()))); |
815 | 815 |
816 uint64_t target_size_hash = | 816 uint64_t target_size_hash = |
817 base::HashInts(target_size_.width(), target_size_.height()); | 817 base::HashInts(target_size_.width(), target_size_.height()); |
818 | 818 |
819 hash_ = base::HashInts(base::HashInts(src_rect_hash, target_size_hash), | 819 hash_ = base::HashInts(base::HashInts(src_rect_hash, target_size_hash), |
820 base::HashInts(image_id_, filter_quality_)); | 820 base::HashInts(image_id_, filter_quality_)); |
821 } | 821 } |
822 } | 822 } |
823 | 823 |
| 824 ImageDecodeControllerKey::ImageDecodeControllerKey( |
| 825 const ImageDecodeControllerKey& other) = default; |
| 826 |
824 std::string ImageDecodeControllerKey::ToString() const { | 827 std::string ImageDecodeControllerKey::ToString() const { |
825 std::ostringstream str; | 828 std::ostringstream str; |
826 str << "id[" << image_id_ << "] src_rect[" << src_rect_.x() << "," | 829 str << "id[" << image_id_ << "] src_rect[" << src_rect_.x() << "," |
827 << src_rect_.y() << " " << src_rect_.width() << "x" << src_rect_.height() | 830 << src_rect_.y() << " " << src_rect_.width() << "x" << src_rect_.height() |
828 << "] target_size[" << target_size_.width() << "x" | 831 << "] target_size[" << target_size_.width() << "x" |
829 << target_size_.height() << "] filter_quality[" << filter_quality_ | 832 << target_size_.height() << "] filter_quality[" << filter_quality_ |
830 << "] can_use_original_decode [" << can_use_original_decode_ << "] hash [" | 833 << "] can_use_original_decode [" << can_use_original_decode_ << "] hash [" |
831 << hash_ << "]"; | 834 << hash_ << "]"; |
832 return str.str(); | 835 return str.str(); |
833 } | 836 } |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 void SoftwareImageDecodeController::MemoryBudget::ResetUsage() { | 890 void SoftwareImageDecodeController::MemoryBudget::ResetUsage() { |
888 current_usage_bytes_ = 0; | 891 current_usage_bytes_ = 0; |
889 } | 892 } |
890 | 893 |
891 size_t SoftwareImageDecodeController::MemoryBudget::GetCurrentUsageSafe() | 894 size_t SoftwareImageDecodeController::MemoryBudget::GetCurrentUsageSafe() |
892 const { | 895 const { |
893 return current_usage_bytes_.ValueOrDie(); | 896 return current_usage_bytes_.ValueOrDie(); |
894 } | 897 } |
895 | 898 |
896 } // namespace cc | 899 } // namespace cc |
OLD | NEW |