summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-16 18:22:35 +0000
committerdpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-16 18:22:35 +0000
commitb10c54d852dc3dd198df86430eeeaf5325f3129b (patch)
treecdd1cd3f0f2a454e2be51a9c5cc76968b7db349c
parent02ec798143ee3295b73c91593943748e8e835058 (diff)
downloadchromium_src-b10c54d852dc3dd198df86430eeeaf5325f3129b.zip
chromium_src-b10c54d852dc3dd198df86430eeeaf5325f3129b.tar.gz
chromium_src-b10c54d852dc3dd198df86430eeeaf5325f3129b.tar.bz2
Move Start/EndPage() from NewPage/PageDone()
to inside the metafile. BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/6673035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78399 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/renderer/print_web_view_helper_win.cc6
-rw-r--r--printing/printing_context_win.cc11
2 files changed, 11 insertions, 6 deletions
diff --git a/chrome/renderer/print_web_view_helper_win.cc b/chrome/renderer/print_web_view_helper_win.cc
index f81b93a..72e3399 100644
--- a/chrome/renderer/print_web_view_helper_win.cc
+++ b/chrome/renderer/print_web_view_helper_win.cc
@@ -209,6 +209,9 @@ void PrintWebViewHelper::RenderPage(
int width = static_cast<int>(content_width_in_points * params.max_shrink);
int height = static_cast<int>(content_height_in_points * params.max_shrink);
+ bool result = (*metafile)->StartPage();
+ DCHECK(result);
+
#if 0
// TODO(maruel): This code is kept for testing until the 100% GDI drawing
// code is stable. maruels use this code's output as a reference when the
@@ -255,6 +258,9 @@ void PrintWebViewHelper::RenderPage(
}
#endif
+ result = (*metafile)->FinishPage();
+ DCHECK(result);
+
skia::VectorPlatformDevice* platform_device =
static_cast<skia::VectorPlatformDevice*>(canvas.getDevice());
if (platform_device->alpha_blend_used() && !params.supports_alpha_blend) {
diff --git a/printing/printing_context_win.cc b/printing/printing_context_win.cc
index 467bf3c..32a44be 100644
--- a/printing/printing_context_win.cc
+++ b/printing/printing_context_win.cc
@@ -298,13 +298,11 @@ PrintingContext::Result PrintingContextWin::NewDocument(
PrintingContext::Result PrintingContextWin::NewPage() {
if (abort_printing_)
return CANCEL;
-
DCHECK(context_);
DCHECK(in_print_job_);
- // Inform the driver that the application is about to begin sending data.
- if (StartPage(context_) <= 0)
- return OnError();
+ // Intentional No-op. NativeMetafile::SafePlayback takes care of calling
+ // ::StartPage().
return OK;
}
@@ -314,8 +312,9 @@ PrintingContext::Result PrintingContextWin::PageDone() {
return CANCEL;
DCHECK(in_print_job_);
- if (EndPage(context_) <= 0)
- return OnError();
+ // Intentional No-op. NativeMetafile::SafePlayback takes care of calling
+ // ::EndPage().
+
return OK;
}