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

Unified Diff: skia/ext/skia_utils_win.cc

Issue 2365903002: Fix GDI leak in NativeThemeWin::PaintIndirect (Closed)
Patch Set: fix comment 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
Index: skia/ext/skia_utils_win.cc
diff --git a/skia/ext/skia_utils_win.cc b/skia/ext/skia_utils_win.cc
index a78d0772619ff3cdea2477f7b0ff54c4689529e8..ba2a204dd7dda7cef37a430302a5041b9f58a0db 100644
--- a/skia/ext/skia_utils_win.cc
+++ b/skia/ext/skia_utils_win.cc
@@ -8,8 +8,6 @@
#include <windows.h>
#include "base/debug/gdi_debug_util_win.h"
-#include "base/win/scoped_hdc.h"
-#include "base/win/win_util.h"
#include "third_party/skia/include/core/SkRect.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/core/SkTypes.h"
@@ -195,35 +193,8 @@ SkBitmap MapPlatformBitmap(HDC context) {
return bitmap;
}
-HDC CreateOffscreenSurface(int width, int height) {
- HBITMAP bitmap = nullptr;
-
- // If this process doesn't have access to GDI, we'll have to use a shared
- // memory segment instead.
- if (!base::win::IsUser32AndGdi32Available())
- return nullptr;
-
- bitmap = CreateHBitmap(width, height, false, nullptr, nullptr);
- if (!bitmap)
- return nullptr;
-
- base::win::ScopedCreateDC scoped_hdc(CreateCompatibleDC(nullptr));
- if (!scoped_hdc.IsValid())
- return nullptr;
- InitializeDC(scoped_hdc.Get());
- HRGN clip = CreateRectRgn(0, 0, width, height);
- if ((SelectClipRgn(scoped_hdc.Get(), clip) == ERROR) ||
- (!DeleteObject(clip)))
- return nullptr;
-
- SelectObject(scoped_hdc.Get(), bitmap);
-
- // The caller must call DeleteDC(hdc) on this object once done with it.
- return scoped_hdc.Take();
-}
-
void CreateBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr) {
- CreateBitmapHeaderWithColorDepth(width, height, 32, hdr);
+ CreateBitmapHeaderWithColorDepth(width, height, 32, hdr);
}
HBITMAP CreateHBitmap(int width, int height, bool is_opaque,

Powered by Google App Engine
This is Rietveld 408576698