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

Side by Side Diff: ui/gfx/skia_util.h

Issue 1497543004: ui/gfx: Add MapRect and ExtractScale skia helper functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « no previous file | ui/gfx/skia_util.cc » ('j') | ui/gfx/skia_util.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/skia_util.cc » ('j') | ui/gfx/skia_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698