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 "ui/gfx/paint_vector_icon.h" | 5 #include "ui/gfx/paint_vector_icon.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <tuple> | 8 #include <tuple> |
9 | 9 |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ptr_util.h" |
13 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
14 #include "base/strings/string_split.h" | 15 #include "base/strings/string_split.h" |
15 #include "third_party/skia/include/core/SkPaint.h" | 16 #include "third_party/skia/include/core/SkPaint.h" |
16 #include "third_party/skia/include/core/SkPath.h" | 17 #include "third_party/skia/include/core/SkPath.h" |
17 #include "third_party/skia/include/core/SkXfermode.h" | 18 #include "third_party/skia/include/core/SkXfermode.h" |
18 #include "ui/gfx/canvas.h" | 19 #include "ui/gfx/canvas.h" |
19 #include "ui/gfx/image/canvas_image_source.h" | 20 #include "ui/gfx/image/canvas_image_source.h" |
20 #include "ui/gfx/scoped_canvas.h" | 21 #include "ui/gfx/scoped_canvas.h" |
21 #include "ui/gfx/vector_icon_types.h" | 22 #include "ui/gfx/vector_icon_types.h" |
22 #include "ui/gfx/vector_icons_public.h" | 23 #include "ui/gfx/vector_icons_public.h" |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 SkColor color, | 590 SkColor color, |
590 const VectorIcon& badge_icon) { | 591 const VectorIcon& badge_icon) { |
591 return icon.is_empty() ? gfx::ImageSkia() | 592 return icon.is_empty() ? gfx::ImageSkia() |
592 : g_icon_cache.Get().GetOrCreateIcon( | 593 : g_icon_cache.Get().GetOrCreateIcon( |
593 icon, dip_size, color, badge_icon); | 594 icon, dip_size, color, badge_icon); |
594 } | 595 } |
595 | 596 |
596 ImageSkia CreateVectorIconFromSource(const std::string& source, | 597 ImageSkia CreateVectorIconFromSource(const std::string& source, |
597 int dip_size, | 598 int dip_size, |
598 SkColor color) { | 599 SkColor color) { |
599 return ImageSkia(new VectorIconSourceLegacy(source, dip_size, color), | 600 return CanvasImageSource::MakeImageSkia<VectorIconSourceLegacy>( |
600 gfx::Size(dip_size, dip_size)); | 601 source, dip_size, color); |
601 } | 602 } |
602 | 603 |
603 } // namespace gfx | 604 } // namespace gfx |
OLD | NEW |