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

Unified Diff: ui/native_theme/native_theme_win.cc

Issue 1406403007: Eliminate HICON leaks caused by creating icons from bitmap image. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use ScopedGeneric to define ScopedGDIObject. Created 5 years, 1 month 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: ui/native_theme/native_theme_win.cc
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc
index c9b604fd2947a861be02ffe124ebaec4c6ab644e..98eef2ea88ac174e9c8d1ffa72aefeab40c57a45 100644
--- a/ui/native_theme/native_theme_win.cc
+++ b/ui/native_theme/native_theme_win.cc
@@ -880,7 +880,7 @@ HRESULT NativeThemeWin::PaintMenuArrow(
base::win::ScopedCreateDC mem_dc(CreateCompatibleDC(hdc));
base::win::ScopedBitmap mem_bitmap(CreateCompatibleBitmap(hdc, r.width(),
r.height()));
- base::win::ScopedSelectObject select_bitmap(mem_dc.Get(), mem_bitmap);
+ base::win::ScopedSelectObject select_bitmap(mem_dc.Get(), mem_bitmap.get());
// Copy and horizontally mirror the background from hdc into mem_dc. Use
// a negative-width source rect, starting at the rightmost pixel.
StretchBlt(mem_dc.Get(), 0, 0, r.width(), r.height(),
@@ -1607,8 +1607,9 @@ HRESULT NativeThemeWin::PaintTextField(HDC hdc,
DrawEdge(hdc, rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
if (fill_content_area) {
- FillRect(hdc, rect, (classic_state & DFCS_INACTIVE) ?
- reinterpret_cast<HBRUSH>(COLOR_BTNFACE + 1) : bg_brush);
+ FillRect(hdc, rect, (classic_state & DFCS_INACTIVE)
+ ? reinterpret_cast<HBRUSH>(COLOR_BTNFACE + 1)
+ : bg_brush.get());
}
return S_OK;
}
@@ -1628,7 +1629,7 @@ HRESULT NativeThemeWin::PaintTextField(HDC hdc,
RECT content_rect;
hr = get_theme_content_rect_(handle, hdc, part_id, state_id, rect,
&content_rect);
- FillRect(hdc, &content_rect, bg_brush);
+ FillRect(hdc, &content_rect, bg_brush.get());
}
return hr;
}
@@ -1982,7 +1983,8 @@ HRESULT NativeThemeWin::PaintFrameControl(HDC hdc,
return E_OUTOFMEMORY;
base::win::ScopedCreateDC bitmap_dc(CreateCompatibleDC(NULL));
- base::win::ScopedSelectObject select_bitmap(bitmap_dc.Get(), mask_bitmap);
+ base::win::ScopedSelectObject select_bitmap(bitmap_dc.Get(),
+ mask_bitmap.get());
RECT local_rect = { 0, 0, width, height };
DrawFrameControl(bitmap_dc.Get(), &local_rect, type, state);

Powered by Google App Engine
This is Rietveld 408576698