| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ui/gfx/image/image_family.h" | 5 #include "ui/gfx/image/image_family.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "ui/gfx/geometry/size.h" |
| 9 #include "ui/gfx/image/image.h" | 10 #include "ui/gfx/image/image.h" |
| 10 #include "ui/gfx/image/image_skia.h" | 11 #include "ui/gfx/image/image_skia.h" |
| 11 #include "ui/gfx/size.h" | |
| 12 | 12 |
| 13 namespace gfx { | 13 namespace gfx { |
| 14 | 14 |
| 15 ImageFamily::const_iterator::const_iterator() {} | 15 ImageFamily::const_iterator::const_iterator() {} |
| 16 | 16 |
| 17 ImageFamily::const_iterator::const_iterator(const const_iterator& other) | 17 ImageFamily::const_iterator::const_iterator(const const_iterator& other) |
| 18 : map_iterator_(other.map_iterator_) {} | 18 : map_iterator_(other.map_iterator_) {} |
| 19 | 19 |
| 20 ImageFamily::const_iterator::const_iterator( | 20 ImageFamily::const_iterator::const_iterator( |
| 21 const std::map<MapKey, gfx::Image>::const_iterator& other) | 21 const std::map<MapKey, gfx::Image>::const_iterator& other) |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 DCHECK(greater_or_equal != map_.begin()); | 121 DCHECK(greater_or_equal != map_.begin()); |
| 122 std::map<MapKey, gfx::Image>::const_iterator less_than = greater_or_equal; | 122 std::map<MapKey, gfx::Image>::const_iterator less_than = greater_or_equal; |
| 123 --less_than; | 123 --less_than; |
| 124 // This must be true because there must be at least one image with |aspect|. | 124 // This must be true because there must be at least one image with |aspect|. |
| 125 DCHECK_EQ(less_than->first.aspect(), aspect); | 125 DCHECK_EQ(less_than->first.aspect(), aspect); |
| 126 // We have found the largest image smaller than desired. | 126 // We have found the largest image smaller than desired. |
| 127 return &less_than->second; | 127 return &less_than->second; |
| 128 } | 128 } |
| 129 | 129 |
| 130 } // namespace gfx | 130 } // namespace gfx |
| OLD | NEW |