| 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_IMAGE_SKIA_OPERATIONS_H_ | 5 #ifndef UI_GFX_IMAGE_IMAGE_SKIA_OPERATIONS_H_ |
| 6 #define UI_GFX_IMAGE_IMAGE_SKIA_OPERATIONS_H_ | 6 #define UI_GFX_IMAGE_IMAGE_SKIA_OPERATIONS_H_ |
| 7 | 7 |
| 8 #include "skia/ext/image_operations.h" | 8 #include "skia/ext/image_operations.h" |
| 9 #include "ui/gfx/color_utils.h" | 9 #include "ui/gfx/color_utils.h" |
| 10 #include "ui/gfx/gfx_export.h" | 10 #include "ui/gfx/gfx_export.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 // Creates an image by resizing |source| to given |target_dip_size|. | 81 // Creates an image by resizing |source| to given |target_dip_size|. |
| 82 static ImageSkia CreateResizedImage(const ImageSkia& source, | 82 static ImageSkia CreateResizedImage(const ImageSkia& source, |
| 83 skia::ImageOperations::ResizeMethod methd, | 83 skia::ImageOperations::ResizeMethod methd, |
| 84 const Size& target_dip_size); | 84 const Size& target_dip_size); |
| 85 | 85 |
| 86 // Creates an image with drop shadow defined in |shadows| for |source|. | 86 // Creates an image with drop shadow defined in |shadows| for |source|. |
| 87 static ImageSkia CreateImageWithDropShadow(const ImageSkia& source, | 87 static ImageSkia CreateImageWithDropShadow(const ImageSkia& source, |
| 88 const ShadowValues& shadows); | 88 const ShadowValues& shadows); |
| 89 | 89 |
| 90 // Creates an image that is 1dp wide, suitable for tiling horizontally to |
| 91 // create a drop shadow effect. The purpose of tiling a static image is to |
| 92 // avoid repeatedly asking Skia to draw a shadow. |
| 93 static gfx::ImageSkia CreateHorizontalShadow( |
| 94 const std::vector<ShadowValue>& shadows, |
| 95 bool fades_down); |
| 96 |
| 90 // Creates an image which is a rotation of the |source|. |rotation| is the | 97 // Creates an image which is a rotation of the |source|. |rotation| is the |
| 91 // amount of clockwise rotation in degrees. | 98 // amount of clockwise rotation in degrees. |
| 92 static ImageSkia CreateRotatedImage( | 99 static ImageSkia CreateRotatedImage( |
| 93 const ImageSkia& source, | 100 const ImageSkia& source, |
| 94 SkBitmapOperations::RotationAmount rotation); | 101 SkBitmapOperations::RotationAmount rotation); |
| 95 | 102 |
| 96 // Creates an icon by painting the second icon as a badge to the first one. | 103 // Creates an icon by painting the second icon as a badge to the first one. |
| 97 // The second icon is in the right corner of the first icon. If the icon | 104 // The second icon is in the right corner of the first icon. If the icon |
| 98 // is valid and the badge is not, the icon will be returned. | 105 // is valid and the badge is not, the icon will be returned. |
| 99 static ImageSkia CreateIconWithBadge(const ImageSkia& icon, | 106 static ImageSkia CreateIconWithBadge(const ImageSkia& icon, |
| 100 const ImageSkia& badge); | 107 const ImageSkia& badge); |
| 101 | 108 |
| 102 private: | 109 private: |
| 103 ImageSkiaOperations(); // Class for scoping only. | 110 ImageSkiaOperations(); // Class for scoping only. |
| 104 }; | 111 }; |
| 105 | 112 |
| 106 } // namespace gfx | 113 } // namespace gfx |
| 107 | 114 |
| 108 #endif // UI_GFX_IMAGE_IMAGE_SKIA_OPERATIONS_H_ | 115 #endif // UI_GFX_IMAGE_IMAGE_SKIA_OPERATIONS_H_ |
| OLD | NEW |