summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/print_web_view_helper_linux.cc
diff options
context:
space:
mode:
authorvandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-19 04:37:08 +0000
committervandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-19 04:37:08 +0000
commit4a146de428a502f0de45e571f415039b3989ef38 (patch)
tree75e661ee9d2fcdae72ff35dc5e953054885b5c4a /chrome/renderer/print_web_view_helper_linux.cc
parent09d8b96b586dc972f31b6e1c72643de6ffb5ad16 (diff)
downloadchromium_src-4a146de428a502f0de45e571f415039b3989ef38.zip
chromium_src-4a146de428a502f0de45e571f415039b3989ef38.tar.gz
chromium_src-4a146de428a502f0de45e571f415039b3989ef38.tar.bz2
Unfork VectorPlatformCanvas.
Unfork VectorPlatformCanvas by making NativeMetafile know how to create an appropriate VectorPlatformDevice. This will also be useful when we have multiple NativeMetafile implemenations (each requiring a different VectorPlatformDevices). BUG=NONE TEST=NONE Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=78662 Reverted: http://src.chromium.org/viewvc/chrome?view=rev&revision=78663 Review URL: http://codereview.chromium.org/6665046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78812 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/print_web_view_helper_linux.cc')
-rw-r--r--chrome/renderer/print_web_view_helper_linux.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/chrome/renderer/print_web_view_helper_linux.cc b/chrome/renderer/print_web_view_helper_linux.cc
index 970b47c..555f419 100644
--- a/chrome/renderer/print_web_view_helper_linux.cc
+++ b/chrome/renderer/print_web_view_helper_linux.cc
@@ -220,15 +220,14 @@ void PrintWebViewHelper::PrintPage(const ViewMsg_PrintPage_Params& params,
margin_left_in_points,
content_height_in_points + margin_top_in_points +
margin_bottom_in_points);
+ gfx::Point content_origin(margin_left_in_points, margin_top_in_points);
- gfx::Point content_origin(margin_top_in_points, margin_left_in_points);
-
- if (!metafile->StartPage(page_size, content_origin, 1))
+ skia::PlatformDevice* device = metafile->StartPageForVectorCanvas(
+ page_size, content_origin, 1.0f);
+ if (!device)
return;
- canvas->reset(new skia::VectorCanvas(metafile->context(),
- canvas_size.width(),
- canvas_size.height()));
+ canvas->reset(new skia::VectorCanvas(device));
frame->printPage(params.page_number, canvas->get());
// TODO(myhuang): We should handle transformation for paper margins.