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 "ui/gfx/image/image.h" | 5 #include "ui/gfx/image/image.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
13 #include "third_party/skia/include/core/SkBitmap.h" | 13 #include "third_party/skia/include/core/SkBitmap.h" |
14 #include "ui/gfx/image/image_png_rep.h" | 14 #include "ui/gfx/image/image_png_rep.h" |
15 #include "ui/gfx/image/image_skia.h" | 15 #include "ui/gfx/image/image_skia.h" |
16 #include "ui/gfx/image/image_skia_source.h" | 16 #include "ui/gfx/image/image_skia_source.h" |
17 #include "ui/gfx/size.h" | 17 #include "ui/gfx/size.h" |
18 | 18 |
19 #if !defined(OS_IOS) | 19 #if !defined(OS_IOS) |
20 #include "ui/gfx/codec/png_codec.h" | 20 #include "ui/gfx/codec/png_codec.h" |
21 #endif | 21 #endif |
22 | 22 |
23 #if defined(OS_IOS) | 23 #if defined(OS_IOS) |
24 #include "base/mac/foundation_util.h" | 24 #include "base/mac/foundation_util.h" |
25 #include "ui/gfx/image/image_skia_util_ios.h" | 25 #include "ui/gfx/image/image_skia_util_ios.h" |
26 #elif defined(OS_MACOSX) | 26 #elif defined(OS_MACOSX) |
| 27 #include "base/mac/foundation_util.h" |
27 #include "base/mac/mac_util.h" | 28 #include "base/mac/mac_util.h" |
28 #include "ui/gfx/image/image_skia_util_mac.h" | 29 #include "ui/gfx/image/image_skia_util_mac.h" |
29 #endif | 30 #endif |
30 | 31 |
31 namespace gfx { | 32 namespace gfx { |
32 | 33 |
33 namespace internal { | 34 namespace internal { |
34 | 35 |
35 #if defined(OS_IOS) | 36 #if defined(OS_IOS) |
36 scoped_refptr<base::RefCountedMemory> Get1xPNGBytesFromUIImage( | 37 scoped_refptr<base::RefCountedMemory> Get1xPNGBytesFromUIImage( |
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 } | 753 } |
753 return it->second; | 754 return it->second; |
754 } | 755 } |
755 | 756 |
756 void Image::AddRepresentation(internal::ImageRep* rep) const { | 757 void Image::AddRepresentation(internal::ImageRep* rep) const { |
757 CHECK(storage_.get()); | 758 CHECK(storage_.get()); |
758 storage_->representations().insert(std::make_pair(rep->type(), rep)); | 759 storage_->representations().insert(std::make_pair(rep->type(), rep)); |
759 } | 760 } |
760 | 761 |
761 } // namespace gfx | 762 } // namespace gfx |
OLD | NEW |