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 #ifndef UI_GFX_IMAGE_SKIA_OPERATIONS_H_ | 5 #ifndef UI_GFX_IMAGE_SKIA_OPERATIONS_H_ |
6 #define UI_GFX_IMAGE_SKIA_OPERATIONS_H_ | 6 #define UI_GFX_IMAGE_SKIA_OPERATIONS_H_ |
7 | 7 |
8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
| 9 #include "skia/ext/image_operations.h" |
9 #include "ui/base/ui_export.h" | 10 #include "ui/base/ui_export.h" |
10 #include "ui/gfx/color_utils.h" | 11 #include "ui/gfx/color_utils.h" |
11 #include "ui/gfx/shadow_value.h" | 12 #include "ui/gfx/shadow_value.h" |
12 | 13 |
13 namespace gfx { | 14 namespace gfx { |
14 class ImageSkia; | 15 class ImageSkia; |
15 class Rect; | 16 class Rect; |
16 class Size; | 17 class Size; |
17 | 18 |
18 class UI_EXPORT ImageSkiaOperations { | 19 class UI_EXPORT ImageSkiaOperations { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 const gfx::ImageSkia& image, | 73 const gfx::ImageSkia& image, |
73 const gfx::ImageSkia& mask); | 74 const gfx::ImageSkia& mask); |
74 | 75 |
75 // Returns an image which is a subset of |image| with bounds |subset_bounds|. | 76 // Returns an image which is a subset of |image| with bounds |subset_bounds|. |
76 // The |image| cannot use kA1_Config config. | 77 // The |image| cannot use kA1_Config config. |
77 static ImageSkia ExtractSubset(const gfx::ImageSkia& image, | 78 static ImageSkia ExtractSubset(const gfx::ImageSkia& image, |
78 const gfx::Rect& subset_bounds); | 79 const gfx::Rect& subset_bounds); |
79 | 80 |
80 // Creates an image by resizing |source| to given |target_dip_size|. | 81 // Creates an image by resizing |source| to given |target_dip_size|. |
81 static ImageSkia CreateResizedImage(const ImageSkia& source, | 82 static ImageSkia CreateResizedImage(const ImageSkia& source, |
| 83 skia::ImageOperations::ResizeMethod methd, |
82 const Size& target_dip_size); | 84 const Size& target_dip_size); |
83 | 85 |
84 // Creates an image with drop shadow defined in |shadows| for |source|. | 86 // Creates an image with drop shadow defined in |shadows| for |source|. |
85 static ImageSkia CreateImageWithDropShadow(const ImageSkia& source, | 87 static ImageSkia CreateImageWithDropShadow(const ImageSkia& source, |
86 const ShadowValues& shadows); | 88 const ShadowValues& shadows); |
87 | 89 |
88 private: | 90 private: |
89 ImageSkiaOperations(); // Class for scoping only. | 91 ImageSkiaOperations(); // Class for scoping only. |
90 }; | 92 }; |
91 | 93 |
92 } // namespace gfx | 94 } // namespace gfx |
93 | 95 |
94 #endif // UI_GFX_IMAGE_IMAGE_SKIA_OPERATIONS_H_ | 96 #endif // UI_GFX_IMAGE_IMAGE_SKIA_OPERATIONS_H_ |
OLD | NEW |