summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/print_web_view_helper_win.cc
diff options
context:
space:
mode:
authorcpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-14 03:56:18 +0000
committercpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-14 03:56:18 +0000
commit6f0db2b2c15a0919bbeeb6568c69b7196b186d27 (patch)
treea9e1c0067cba88556eff8541dfd87b09acd0a16c /chrome/renderer/print_web_view_helper_win.cc
parent46db9f43fe29b92895d3138a22d3bc042632135a (diff)
downloadchromium_src-6f0db2b2c15a0919bbeeb6568c69b7196b186d27.zip
chromium_src-6f0db2b2c15a0919bbeeb6568c69b7196b186d27.tar.gz
chromium_src-6f0db2b2c15a0919bbeeb6568c69b7196b186d27.tar.bz2
Revert 121840 - Make scoped dc objects smarter
So we don't destroy the dc with gdi objects selected. Also remove implicit conversion to HDC. BUG=110113,113683 TEST=chrome runs, base unittests green. Review URL: https://chromiumcodereview.appspot.com/9212020 TBR=cpu@chromium.org Review URL: https://chromiumcodereview.appspot.com/9387027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121843 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/print_web_view_helper_win.cc')
-rw-r--r--chrome/renderer/print_web_view_helper_win.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/chrome/renderer/print_web_view_helper_win.cc b/chrome/renderer/print_web_view_helper_win.cc
index 1cac932..3ed93fd 100644
--- a/chrome/renderer/print_web_view_helper_win.cc
+++ b/chrome/renderer/print_web_view_helper_win.cc
@@ -279,23 +279,23 @@ Metafile* PrintWebViewHelper::RenderPage(
// Page used alpha blend, but printer doesn't support it. Rewrite the
// metafile and flatten out the transparency.
base::win::ScopedGetDC screen_dc(NULL);
- base::win::ScopedCreateDC bitmap_dc(CreateCompatibleDC(screen_dc.get()));
- if (!bitmap_dc.get())
+ base::win::ScopedCreateDC bitmap_dc(CreateCompatibleDC(screen_dc));
+ if (!bitmap_dc)
NOTREACHED() << "Bitmap DC creation failed";
- SetGraphicsMode(bitmap_dc.get(), GM_ADVANCED);
+ SetGraphicsMode(bitmap_dc, GM_ADVANCED);
void* bits = NULL;
BITMAPINFO hdr;
gfx::CreateBitmapHeader(page_size.width(), page_size.height(),
&hdr.bmiHeader);
base::win::ScopedBitmap hbitmap(CreateDIBSection(
- bitmap_dc.get(), &hdr, DIB_RGB_COLORS, &bits, NULL, 0));
+ bitmap_dc, &hdr, DIB_RGB_COLORS, &bits, NULL, 0));
if (!hbitmap)
NOTREACHED() << "Raster bitmap creation for printing failed";
- base::win::ScopedSelectObject selectBitmap(bitmap_dc.get(), hbitmap);
+ base::win::ScopedSelectObject selectBitmap(bitmap_dc, hbitmap);
RECT rect = { 0, 0, page_size.width(), page_size.height() };
HBRUSH whiteBrush = static_cast<HBRUSH>(GetStockObject(WHITE_BRUSH));
- FillRect(bitmap_dc.get(), &rect, whiteBrush);
+ FillRect(bitmap_dc, &rect, whiteBrush);
Metafile* metafile2(new printing::NativeMetafile);
metafile2->Init();