OLD | NEW |
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_SKIA_UTILS_WIN_H_ | 5 #ifndef SKIA_EXT_SKIA_UTILS_WIN_H_ |
6 #define SKIA_EXT_SKIA_UTILS_WIN_H_ | 6 #define SKIA_EXT_SKIA_UTILS_WIN_H_ |
7 | 7 |
| 8 #include "third_party/skia/include/core/SkBitmap.h" |
8 #include "third_party/skia/include/core/SkColor.h" | 9 #include "third_party/skia/include/core/SkColor.h" |
9 | 10 |
10 #include "build/build_config.h" | 11 #include "build/build_config.h" |
11 #include <windows.h> | 12 #include <windows.h> |
12 | 13 |
13 struct SkIRect; | 14 struct SkIRect; |
14 struct SkPoint; | 15 struct SkPoint; |
15 struct SkRect; | 16 struct SkRect; |
| 17 class SkSurface; |
16 typedef unsigned long DWORD; | 18 typedef unsigned long DWORD; |
17 typedef DWORD COLORREF; | 19 typedef DWORD COLORREF; |
18 typedef struct tagPOINT POINT; | 20 typedef struct tagPOINT POINT; |
19 typedef struct tagRECT RECT; | 21 typedef struct tagRECT RECT; |
20 | 22 |
21 namespace skia { | 23 namespace skia { |
22 | 24 |
23 // Converts a Skia point to a Windows POINT. | 25 // Converts a Skia point to a Windows POINT. |
24 POINT SkPointToPOINT(const SkPoint& point); | 26 POINT SkPointToPOINT(const SkPoint& point); |
25 | 27 |
(...skipping 16 matching lines...) Expand all Loading... |
42 | 44 |
43 // Converts COLORREFs (0BGR) to the ARGB layout Skia expects. | 45 // Converts COLORREFs (0BGR) to the ARGB layout Skia expects. |
44 SK_API SkColor COLORREFToSkColor(COLORREF color); | 46 SK_API SkColor COLORREFToSkColor(COLORREF color); |
45 | 47 |
46 // Converts ARGB to COLORREFs (0BGR). | 48 // Converts ARGB to COLORREFs (0BGR). |
47 SK_API COLORREF SkColorToCOLORREF(SkColor color); | 49 SK_API COLORREF SkColorToCOLORREF(SkColor color); |
48 | 50 |
49 // Initializes the default settings and colors in a device context. | 51 // Initializes the default settings and colors in a device context. |
50 SK_API void InitializeDC(HDC context); | 52 SK_API void InitializeDC(HDC context); |
51 | 53 |
| 54 // Creates a surface writing to the pixels backing the HDC's bitmap. |
| 55 // Returns NULL on error. |
| 56 SK_API SkSurface* MapPlatformSurface(HDC context); |
| 57 |
| 58 // Creates a bitmap backed by the same pixels backing the HDC's bitmap. |
| 59 // Returns an empty bitmap on error. |
| 60 SK_API SkBitmap MapPlatformBitmap(HDC context); |
| 61 |
| 62 // Creates an offscreen HDC suitable for writing to via MapPlatformSurface(). |
| 63 // Caller is responsible for calling DeleteDC() when done. |
| 64 SK_API HDC CreateOffscreenSurface(int width, int height); |
| 65 |
52 } // namespace skia | 66 } // namespace skia |
53 | 67 |
54 #endif // SKIA_EXT_SKIA_UTILS_WIN_H_ | 68 #endif // SKIA_EXT_SKIA_UTILS_WIN_H_ |
55 | 69 |
OLD | NEW |