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

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: update calling convention Created 4 years, 5 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 bfcbf2619b247810082e5a14b547a7c6289e92af..4ec29e81341707c09d103c98f5cc32cbd1f38a7a 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,19 @@ 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 the HDC's bitmap.
Peter Kasting 2016/08/03 01:40:25 Tiny nit: I would say "|context|'s" rather than "t
tomhudson 2016/08/03 12:55:03 Done.
+// Returns nullptr on error.
Peter Kasting 2016/08/03 01:40:25 Nit: I think we typically just say "null" in comme
tomhudson 2016/08/03 12:55:03 Done.
+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.
+SK_API HDC CreateOffscreenSurface(int width, int height);
Peter Kasting 2016/08/03 01:40:25 Nit: Might want a "TODO(tomhudson): Return a Scope
tomhudson 2016/08/03 12:55:03 TODO(fmalita) for now.
+
// 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') | skia/ext/skia_utils_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698