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

Unified Diff: skia/ext/skia_utils_win.h

Issue 2182083002: Remove BitmapPlatformDevice from NativeThemeWin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switch back to initialization-via-construction once Created 4 years, 4 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') | no next file with comments »
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 bfcbf2619b247810082e5a14b547a7c6289e92af..368d91b895fa200bd2d0203ba590e63f7a5875e5 100644
--- a/skia/ext/skia_utils_win.h
+++ b/skia/ext/skia_utils_win.h
@@ -5,8 +5,10 @@
#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/SkMatrix.h"
+#include "third_party/skia/include/core/SkRefCnt.h"
#include "build/build_config.h"
#include <windows.h>
@@ -14,6 +16,7 @@
struct SkIRect;
struct SkPoint;
struct SkRect;
+class SkSurface;
typedef unsigned long DWORD;
typedef DWORD COLORREF;
typedef struct tagPOINT POINT;
@@ -60,6 +63,21 @@ SK_API void LoadTransformToDC(HDC dc, const SkMatrix& matrix);
SK_API void CopyHDC(HDC source, HDC destination, int x, int y, bool is_opaque,
const RECT& src_rect, const SkMatrix& transform);
+// Creates a surface writing to the pixels backing |context|'s bitmap.
+// Returns null 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.
+// Will return null if any errors are encountered.
+// TODO(fmalita): consider returning ScopedCreateDC() when that type is
+// returnable (https://crbug.com/622442)
+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);
« no previous file with comments | « no previous file | skia/ext/skia_utils_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698