Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Side by Side Diff: skia/ext/image_operations.h

Issue 119025: Add ability to theme our buttons.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 SKIA_EXT_IMAGE_OPERATIONS_H_ 5 #ifndef SKIA_EXT_IMAGE_OPERATIONS_H_
6 #define SKIA_EXT_IMAGE_OPERATIONS_H_ 6 #define SKIA_EXT_IMAGE_OPERATIONS_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/gfx/rect.h" 9 #include "base/gfx/rect.h"
10 #include "skia/ext/skia_utils.h" 10 #include "skia/ext/skia_utils.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 static SkBitmap CreateBlendedBitmap(const SkBitmap& first, 54 static SkBitmap CreateBlendedBitmap(const SkBitmap& first,
55 const SkBitmap& second, 55 const SkBitmap& second,
56 double alpha); 56 double alpha);
57 57
58 // Create a bitmap that is the original bitmap masked out by the mask defined 58 // Create a bitmap that is the original bitmap masked out by the mask defined
59 // in the alpha bitmap. The images must use the kARGB_8888_Config config and 59 // in the alpha bitmap. The images must use the kARGB_8888_Config config and
60 // be of equal dimensions. 60 // be of equal dimensions.
61 static SkBitmap CreateMaskedBitmap(const SkBitmap& first, 61 static SkBitmap CreateMaskedBitmap(const SkBitmap& first,
62 const SkBitmap& alpha); 62 const SkBitmap& alpha);
63 63
64 // We create a button background image by compositing the color and image
65 // together, then applying the mask. This is a highly specialized composite
66 // operation that is the equivalent of drawing a background in |color|,
67 // tiling |image| over the top, and then masking the result out with |mask|.
68 // The images must use kARGB_8888_Config config.
69 static SkBitmap CreateButtonBackground(SkColor color,
70 const SkBitmap& image,
71 const SkBitmap& mask);
72
64 // Blur a bitmap using an average-blur algorithm over the rectangle defined 73 // Blur a bitmap using an average-blur algorithm over the rectangle defined
65 // by |blur_amount|. The blur will wrap around image edges. 74 // by |blur_amount|. The blur will wrap around image edges.
66 static SkBitmap CreateBlurredBitmap(const SkBitmap& bitmap, int blur_amount); 75 static SkBitmap CreateBlurredBitmap(const SkBitmap& bitmap, int blur_amount);
67 76
68 // Shift a bitmap's HSL values. The shift values are in the range of 0-1, 77 // Shift a bitmap's HSL values. The shift values are in the range of 0-1,
69 // with the option to specify -1 for 'no change'. The shift values are 78 // with the option to specify -1 for 'no change'. The shift values are
70 // defined as: 79 // defined as:
71 // hsl_shift[0] (hue): The absolute hue value for the image - 0 and 1 map 80 // hsl_shift[0] (hue): The absolute hue value for the image - 0 and 1 map
72 // to 0 and 360 on the hue color wheel (red). 81 // to 0 and 360 on the hue color wheel (red).
73 // hsl_shift[1] (saturation): A saturation shift for the image, with the 82 // hsl_shift[1] (saturation): A saturation shift for the image, with the
(...skipping 16 matching lines...) Expand all
90 int src_x, int src_y, 99 int src_x, int src_y,
91 int dst_w, int dst_h); 100 int dst_w, int dst_h);
92 private: 101 private:
93 ImageOperations(); // Class for scoping only. 102 ImageOperations(); // Class for scoping only.
94 }; 103 };
95 104
96 } // namespace skia 105 } // namespace skia
97 106
98 #endif // SKIA_EXT_IMAGE_OPERATIONS_H_ 107 #endif // SKIA_EXT_IMAGE_OPERATIONS_H_
99 108
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698