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_SKIA_UTIL_H_ | 5 #ifndef UI_GFX_SKIA_UTIL_H_ |
6 #define UI_GFX_SKIA_UTIL_H_ | 6 #define UI_GFX_SKIA_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 // Returns true if the two bitmaps contain the same pixels. | 82 // Returns true if the two bitmaps contain the same pixels. |
83 GFX_EXPORT bool BitmapsAreEqual(const SkBitmap& bitmap1, | 83 GFX_EXPORT bool BitmapsAreEqual(const SkBitmap& bitmap1, |
84 const SkBitmap& bitmap2); | 84 const SkBitmap& bitmap2); |
85 | 85 |
86 // Converts Skia ARGB format pixels in |skia| to RGBA. | 86 // Converts Skia ARGB format pixels in |skia| to RGBA. |
87 GFX_EXPORT void ConvertSkiaToRGBA(const unsigned char* skia, | 87 GFX_EXPORT void ConvertSkiaToRGBA(const unsigned char* skia, |
88 int pixel_width, | 88 int pixel_width, |
89 unsigned char* rgba); | 89 unsigned char* rgba); |
90 | 90 |
| 91 // Extracts the scale component from the matrix. Returns true if it succeeded |
| 92 // and false otherwise. |
| 93 GFX_EXPORT bool ExtractScale(const SkMatrix& matrix, SkSize* scale); |
| 94 |
| 95 // Applies the matrix to the rect and returns the resulting rect. |
| 96 GFX_EXPORT SkRect MapRect(const SkMatrix& matrix, const SkRect& src); |
| 97 |
91 } // namespace gfx | 98 } // namespace gfx |
92 | 99 |
93 #endif // UI_GFX_SKIA_UTIL_H_ | 100 #endif // UI_GFX_SKIA_UTIL_H_ |
OLD | NEW |