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_ICON_UTIL_H_ | 5 #ifndef UI_GFX_ICON_UTIL_H_ |
6 #define UI_GFX_ICON_UTIL_H_ | 6 #define UI_GFX_ICON_UTIL_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <stddef.h> |
| 10 #include <stdint.h> |
9 #include <string> | 11 #include <string> |
10 #include <vector> | 12 #include <vector> |
11 | 13 |
12 #include "base/basictypes.h" | 14 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
14 #include "base/win/scoped_gdi_object.h" | 16 #include "base/win/scoped_gdi_object.h" |
15 #include "ui/gfx/geometry/point.h" | 17 #include "ui/gfx/geometry/point.h" |
16 #include "ui/gfx/geometry/size.h" | 18 #include "ui/gfx/geometry/size.h" |
17 #include "ui/gfx/gfx_export.h" | 19 #include "ui/gfx/gfx_export.h" |
18 | 20 |
19 namespace base { | 21 namespace base { |
20 class FilePath; | 22 class FilePath; |
21 } | 23 } |
22 | 24 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 BITMAPINFOHEADER icHeader; | 199 BITMAPINFOHEADER icHeader; |
198 RGBQUAD icColors[1]; | 200 RGBQUAD icColors[1]; |
199 BYTE icXOR[1]; | 201 BYTE icXOR[1]; |
200 BYTE icAND[1]; | 202 BYTE icAND[1]; |
201 }; | 203 }; |
202 #pragma pack(pop) | 204 #pragma pack(pop) |
203 | 205 |
204 friend class IconUtilTest; | 206 friend class IconUtilTest; |
205 | 207 |
206 // Returns true if any pixel in the given pixels buffer has an non-zero alpha. | 208 // Returns true if any pixel in the given pixels buffer has an non-zero alpha. |
207 static bool PixelsHaveAlpha(const uint32* pixels, size_t num_pixels); | 209 static bool PixelsHaveAlpha(const uint32_t* pixels, size_t num_pixels); |
208 | 210 |
209 // A helper function that initializes a BITMAPV5HEADER structure with a set | 211 // A helper function that initializes a BITMAPV5HEADER structure with a set |
210 // of values. | 212 // of values. |
211 static void InitializeBitmapHeader(BITMAPV5HEADER* header, int width, | 213 static void InitializeBitmapHeader(BITMAPV5HEADER* header, int width, |
212 int height); | 214 int height); |
213 | 215 |
214 // Given a single SkBitmap object and pointers to the corresponding icon | 216 // Given a single SkBitmap object and pointers to the corresponding icon |
215 // structures within the icon data buffer, this function sets the image | 217 // structures within the icon data buffer, this function sets the image |
216 // information (dimensions, color depth, etc.) in the icon structures and | 218 // information (dimensions, color depth, etc.) in the icon structures and |
217 // also copies the underlying icon image into the appropriate location. | 219 // also copies the underlying icon image into the appropriate location. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 // A helper function of CreateSkBitmapFromHICON. | 265 // A helper function of CreateSkBitmapFromHICON. |
264 static SkBitmap CreateSkBitmapFromHICONHelper(HICON icon, | 266 static SkBitmap CreateSkBitmapFromHICONHelper(HICON icon, |
265 const gfx::Size& s); | 267 const gfx::Size& s); |
266 | 268 |
267 // Prevent clients from instantiating objects of that class by declaring the | 269 // Prevent clients from instantiating objects of that class by declaring the |
268 // ctor/dtor as private. | 270 // ctor/dtor as private. |
269 DISALLOW_IMPLICIT_CONSTRUCTORS(IconUtil); | 271 DISALLOW_IMPLICIT_CONSTRUCTORS(IconUtil); |
270 }; | 272 }; |
271 | 273 |
272 #endif // UI_GFX_ICON_UTIL_H_ | 274 #endif // UI_GFX_ICON_UTIL_H_ |
OLD | NEW |