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

Unified Diff: chrome/renderer/print_web_view_helper_win.cc

Issue 9387027: Revert 121840 - Make scoped dc objects smarter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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: chrome/renderer/print_web_view_helper_win.cc
===================================================================
--- chrome/renderer/print_web_view_helper_win.cc (revision 121842)
+++ chrome/renderer/print_web_view_helper_win.cc (working copy)
@@ -279,23 +279,23 @@
// 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();
« no previous file with comments | « chrome/browser/ui/window_snapshot/window_snapshot_win.cc ('k') | chrome/service/cloud_print/print_system_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698