OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/favicon_base/favicon_util.h" | 5 #include "components/favicon_base/favicon_util.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "components/favicon_base/favicon_types.h" | 9 #include "components/favicon_base/favicon_types.h" |
10 #include "components/favicon_base/select_favicon_frames.h" | 10 #include "components/favicon_base/select_favicon_frames.h" |
11 #include "skia/ext/image_operations.h" | 11 #include "skia/ext/image_operations.h" |
12 #include "third_party/skia/include/core/SkBitmap.h" | 12 #include "third_party/skia/include/core/SkBitmap.h" |
13 #include "third_party/skia/include/core/SkCanvas.h" | 13 #include "third_party/skia/include/core/SkCanvas.h" |
14 #include "ui/base/layout.h" | 14 #include "ui/base/layout.h" |
15 #include "ui/gfx/codec/png_codec.h" | 15 #include "ui/gfx/codec/png_codec.h" |
16 #include "ui/gfx/favicon_size.h" | 16 #include "ui/gfx/favicon_size.h" |
| 17 #include "ui/gfx/geometry/size.h" |
17 #include "ui/gfx/image/image_png_rep.h" | 18 #include "ui/gfx/image/image_png_rep.h" |
18 #include "ui/gfx/image/image_skia.h" | 19 #include "ui/gfx/image/image_skia.h" |
19 #include "ui/gfx/size.h" | |
20 | 20 |
21 #if defined(OS_MACOSX) && !defined(OS_IOS) | 21 #if defined(OS_MACOSX) && !defined(OS_IOS) |
22 #include "base/mac/mac_util.h" | 22 #include "base/mac/mac_util.h" |
23 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 23 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
24 | 24 |
25 namespace favicon_base { | 25 namespace favicon_base { |
26 namespace { | 26 namespace { |
27 | 27 |
28 // Creates image reps of DIP size |favicon_size| for the subset of | 28 // Creates image reps of DIP size |favicon_size| for the subset of |
29 // |favicon_scales| for which the image reps can be created without resizing | 29 // |favicon_scales| for which the image reps can be created without resizing |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 &png_bytes->data())) { | 236 &png_bytes->data())) { |
237 png_reps.push_back( | 237 png_reps.push_back( |
238 gfx::ImagePNGRep(png_bytes, resized_image_skia_reps[i].scale())); | 238 gfx::ImagePNGRep(png_bytes, resized_image_skia_reps[i].scale())); |
239 } | 239 } |
240 } | 240 } |
241 | 241 |
242 return gfx::Image(png_reps); | 242 return gfx::Image(png_reps); |
243 } | 243 } |
244 | 244 |
245 } // namespace favicon_base | 245 } // namespace favicon_base |
OLD | NEW |