Index: skia/ext/skia_utils_win.h |
diff --git a/skia/ext/skia_utils_win.h b/skia/ext/skia_utils_win.h |
index b116efe19e2625cb896bcbd33f93d11e59266407..01a66f5d3526d11c67241f735616cc6e61ae16d1 100644 |
--- a/skia/ext/skia_utils_win.h |
+++ b/skia/ext/skia_utils_win.h |
@@ -5,7 +5,9 @@ |
#ifndef SKIA_EXT_SKIA_UTILS_WIN_H_ |
#define SKIA_EXT_SKIA_UTILS_WIN_H_ |
+#include "third_party/skia/include/core/SkBitmap.h" |
#include "third_party/skia/include/core/SkColor.h" |
+#include "third_party/skia/include/core/SkRefCnt.h" |
#include "build/build_config.h" |
#include <windows.h> |
@@ -13,6 +15,7 @@ |
struct SkIRect; |
struct SkPoint; |
struct SkRect; |
+class SkSurface; |
typedef unsigned long DWORD; |
typedef DWORD COLORREF; |
typedef struct tagPOINT POINT; |
@@ -49,6 +52,21 @@ SK_API COLORREF SkColorToCOLORREF(SkColor color); |
// Initializes the default settings and colors in a device context. |
SK_API void InitializeDC(HDC context); |
+// Creates a surface writing to the pixels backing the HDC's bitmap. |
+// Returns nullptr on error. |
+SK_API sk_sp<SkSurface> MapPlatformSurface(HDC context); |
+ |
+// Creates a bitmap backed by the same pixels backing the HDC's bitmap. |
+// Returns an empty bitmap on error. |
+SK_API SkBitmap MapPlatformBitmap(HDC context); |
+ |
+// Creates an offscreen HDC suitable for writing to via MapPlatformSurface(). |
+// Caller is responsible for calling DeleteDC() when done. |
+SK_API HDC CreateOffscreenSurface(int width, int height); |
+ |
+// Fills in a BITMAPINFOHEADER structure given the bitmap's size. |
+SK_API void CreateBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr); |
+ |
} // namespace skia |
#endif // SKIA_EXT_SKIA_UTILS_WIN_H_ |