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

Unified Diff: skia/ext/skia_utils_win.h

Issue 1492353002: Consolidate Windows bitmap and DC code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-printing-dc-from-device
Patch Set: Created 4 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | skia/ext/skia_utils_win.cc » ('j') | skia/ext/skia_utils_win.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a99d3637b55d795fda8ca27f89455b7347f81f4c 100644
--- a/skia/ext/skia_utils_win.h
+++ b/skia/ext/skia_utils_win.h
@@ -5,6 +5,7 @@
#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 "build/build_config.h"
@@ -13,6 +14,7 @@
struct SkIRect;
struct SkPoint;
struct SkRect;
+class SkSurface;
typedef unsigned long DWORD;
typedef DWORD COLORREF;
typedef struct tagPOINT POINT;
@@ -49,6 +51,18 @@ 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 NULL on error.
Peter Kasting 2016/02/16 21:12:10 Nit: NULL -> null (since this actually returns nul
tomhudson 2016/06/21 22:20:22 "nullptr", or "null"?
Peter Kasting 2016/06/22 02:23:33 "null" -- that reads better in comments than actua
+SK_API 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);
+
} // namespace skia
#endif // SKIA_EXT_SKIA_UTILS_WIN_H_
« no previous file with comments | « no previous file | skia/ext/skia_utils_win.cc » ('j') | skia/ext/skia_utils_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698