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

Unified Diff: skia/ext/skia_utils_win.h

Issue 2365903002: Fix GDI leak in NativeThemeWin::PaintIndirect (Closed)
Patch Set: Created 4 years, 3 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 368d91b895fa200bd2d0203ba590e63f7a5875e5..00b71250a322b3381a853c45cb8d32469e23ec42 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 "base/win/scoped_gdi_object.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"
@@ -73,10 +74,14 @@ SK_API SkBitmap MapPlatformBitmap(HDC context);
// Creates an offscreen HDC suitable for writing to via MapPlatformSurface().
// Caller is responsible for calling DeleteDC() when done.
+// The |bitmap| is a pointer to the ScopedBitmap instance that caller must
+// provide so that the bitmap is deleted when returned HDC gets deleted.
// 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);
+SK_API HDC CreateOffscreenSurface(base::win::ScopedBitmap* bitmap,
Peter Kasting 2016/09/23 18:45:00 Nit: Outparam should go last.
+ 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') | skia/ext/skia_utils_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698