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

Unified Diff: chrome/renderer/print_web_view_helper_win.cc

Issue 6611032: Unifying NativeMetafile class interface (as much as possible) for Linux, Mac, Win (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-enabled DCHECK in pdf_ps_metafile_cairo.cc Created 9 years, 9 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
diff --git a/chrome/renderer/print_web_view_helper_win.cc b/chrome/renderer/print_web_view_helper_win.cc
index e0332c85dbe012922bf7ad6da7f965fe8cf0f644..7a4a2bd59ca8453225a8d8cce89d62cc995f666b 100644
--- a/chrome/renderer/print_web_view_helper_win.cc
+++ b/chrome/renderer/print_web_view_helper_win.cc
@@ -72,8 +72,8 @@ void PrintWebViewHelper::PrintPage(const ViewMsg_PrintPage_Params& params,
scoped_ptr<printing::NativeMetafile> metafile(
printing::NativeMetafileFactory::CreateMetafile());
metafile->CreateDc(NULL, NULL);
- DCHECK(metafile->hdc());
- skia::PlatformDevice::InitializeDC(metafile->hdc());
+ DCHECK(metafile->context());
+ skia::PlatformDevice::InitializeDC(metafile->context());
int page_number = params.page_number;
@@ -85,7 +85,7 @@ void PrintWebViewHelper::PrintPage(const ViewMsg_PrintPage_Params& params,
RenderPage(params.params, &scale_factor, page_number, frame, &metafile);
// Close the device context to retrieve the compiled metafile.
- if (!metafile->CloseDc())
+ if (!metafile->Close())
NOTREACHED();
// Get the size of the compiled metafile.
@@ -139,8 +139,8 @@ void PrintWebViewHelper::CreatePreviewDocument(
scoped_ptr<printing::NativeMetafile> metafile(
printing::NativeMetafileFactory::CreateMetafile());
metafile->CreateDc(NULL, NULL);
- DCHECK(metafile->hdc());
- skia::PlatformDevice::InitializeDC(metafile->hdc());
+ DCHECK(metafile->context());
+ skia::PlatformDevice::InitializeDC(metafile->context());
// Calculate the dpi adjustment.
float shrink = static_cast<float>(params.params.desired_dpi /
@@ -162,7 +162,7 @@ void PrintWebViewHelper::CreatePreviewDocument(
}
// Close the device context to retrieve the compiled metafile.
- if (!metafile->CloseDc())
+ if (!metafile->Close())
NOTREACHED();
// Get the size of the compiled metafile.
@@ -193,7 +193,7 @@ void PrintWebViewHelper::CreatePreviewDocument(
void PrintWebViewHelper::RenderPage(
const ViewMsg_Print_Params& params, float* scale_factor, int page_number,
WebFrame* frame, scoped_ptr<printing::NativeMetafile>* metafile) {
- HDC hdc = (*metafile)->hdc();
+ HDC hdc = (*metafile)->context();
DCHECK(hdc);
double content_width_in_points;
@@ -258,7 +258,7 @@ void PrintWebViewHelper::RenderPage(
static_cast<skia::VectorPlatformDevice*>(canvas.getDevice());
if (platform_device->alpha_blend_used() && !params.supports_alpha_blend) {
// Close the device context to retrieve the compiled metafile.
- if (!(*metafile)->CloseDc())
+ if (!(*metafile)->Close())
NOTREACHED();
scoped_ptr<printing::NativeMetafile> metafile2(
@@ -283,11 +283,11 @@ void PrintWebViewHelper::RenderPage(
FillRect(bitmap_dc, &rect, whiteBrush);
metafile2->CreateDc(NULL, NULL);
- HDC hdc = metafile2->hdc();
+ HDC hdc = metafile2->context();
DCHECK(hdc);
skia::PlatformDevice::InitializeDC(hdc);
- RECT metafile_bounds = (*metafile)->GetBounds().ToRECT();
+ RECT metafile_bounds = (*metafile)->GetPageBounds(1).ToRECT();
// Process the old metafile, placing all non-AlphaBlend calls into the
// new metafile, and copying the results of all the AlphaBlend calls
// from the bitmap DC.

Powered by Google App Engine
This is Rietveld 408576698