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

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: Making virtual methods not virtual (for clang bots) 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
« no previous file with comments | « chrome/renderer/print_web_view_helper_linux.cc ('k') | chrome/utility/utility_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8d45aa2b9523de3ea63c75795feda1868ce3573c..f81b93a79c801089f3dcc4145ebf035d5a7fd0b8 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.
@@ -140,8 +140,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 /
@@ -163,7 +163,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.
@@ -194,7 +194,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;
@@ -259,7 +259,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(
@@ -284,11 +284,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.
« no previous file with comments | « chrome/renderer/print_web_view_helper_linux.cc ('k') | chrome/utility/utility_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698