Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: ui/gfx/image/image_family.cc

Issue 22243002: GTTF: Enable glibcxx debug mode for Debug builds by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/image/image_family.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/image/image.h" 9 #include "ui/gfx/image/image.h"
10 #include "ui/gfx/image/image_skia.h" 10 #include "ui/gfx/image/image_skia.h"
11 #include "ui/gfx/size.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)
22 : map_iterator_(other) {} 22 : map_iterator_(other) {}
23 23
24 ImageFamily::const_iterator::~const_iterator() {}
25
24 ImageFamily::ImageFamily() {} 26 ImageFamily::ImageFamily() {}
25 ImageFamily::~ImageFamily() {} 27 ImageFamily::~ImageFamily() {}
26 28
27 void ImageFamily::Add(const gfx::Image& image) { 29 void ImageFamily::Add(const gfx::Image& image) {
28 gfx::Size size = image.Size(); 30 gfx::Size size = image.Size();
29 if (size.IsEmpty()) { 31 if (size.IsEmpty()) {
30 map_[MapKey(1.0f, 0)] = image; 32 map_[MapKey(1.0f, 0)] = image;
31 } else { 33 } else {
32 float aspect = static_cast<float>(size.width()) / size.height(); 34 float aspect = static_cast<float>(size.width()) / size.height();
33 DCHECK_GT(aspect, 0.0f); 35 DCHECK_GT(aspect, 0.0f);
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 DCHECK(greater_or_equal != map_.begin()); 121 DCHECK(greater_or_equal != map_.begin());
120 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;
121 --less_than; 123 --less_than;
122 // 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|.
123 DCHECK_EQ(less_than->first.aspect(), aspect); 125 DCHECK_EQ(less_than->first.aspect(), aspect);
124 // We have found the largest image smaller than desired. 126 // We have found the largest image smaller than desired.
125 return &less_than->second; 127 return &less_than->second;
126 } 128 }
127 129
128 } // namespace gfx 130 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/image/image_family.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698