summaryrefslogtreecommitdiffstats
path: root/chrome/utility
diff options
context:
space:
mode:
authorsanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-30 06:17:41 +0000
committersanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-30 06:17:41 +0000
commit489ab8a147a5d5c78757f2910e0b598453c61962 (patch)
tree26d27dec1e352b9e812fb981597242dc63a90221 /chrome/utility
parent95c0dc4adedaf68ca2e1ce0a3df70e98bc35260b (diff)
downloadchromium_src-489ab8a147a5d5c78757f2910e0b598453c61962.zip
chromium_src-489ab8a147a5d5c78757f2910e0b598453c61962.tar.gz
chromium_src-489ab8a147a5d5c78757f2910e0b598453c61962.tar.bz2
Changed the implementation of the utility process method to render a PDF into a metafile to use a file-backed metafile as opposed to an in-memory metafile.
BUG=None. TEST=Test Cloud Print proxy with Chrome OS generated PDFs. Review URL: http://codereview.chromium.org/3600001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61033 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/utility')
-rw-r--r--chrome/utility/utility_thread.cc10
-rw-r--r--chrome/utility/utility_thread.h2
2 files changed, 8 insertions, 4 deletions
diff --git a/chrome/utility/utility_thread.cc b/chrome/utility/utility_thread.cc
index ac8de68..4392557 100644
--- a/chrome/utility/utility_thread.cc
+++ b/chrome/utility/utility_thread.cc
@@ -119,6 +119,7 @@ void UtilityThread::OnDecodeImage(
void UtilityThread::OnRenderPDFPagesToMetafile(
base::PlatformFile pdf_file,
+ const FilePath& metafile_path,
const gfx::Rect& render_area,
int render_dpi,
const std::vector<printing::PageRange>& page_ranges) {
@@ -126,11 +127,11 @@ void UtilityThread::OnRenderPDFPagesToMetafile(
#if defined(OS_WIN)
printing::NativeMetafile metafile;
int highest_rendered_page_number = 0;
- succeeded = RenderPDFToWinMetafile(pdf_file, render_area, render_dpi,
- page_ranges, &metafile,
+ succeeded = RenderPDFToWinMetafile(pdf_file, metafile_path, render_area,
+ render_dpi, page_ranges, &metafile,
&highest_rendered_page_number);
if (succeeded) {
- Send(new UtilityHostMsg_RenderPDFPagesToMetafile_Succeeded(metafile,
+ Send(new UtilityHostMsg_RenderPDFPagesToMetafile_Succeeded(
highest_rendered_page_number));
}
#endif // defined(OS_WIN)
@@ -189,6 +190,7 @@ DWORD WINAPI UtilityProcess_GetFontDataPatch(
bool UtilityThread::RenderPDFToWinMetafile(
base::PlatformFile pdf_file,
+ const FilePath& metafile_path,
const gfx::Rect& render_area,
int render_dpi,
const std::vector<printing::PageRange>& page_ranges,
@@ -242,7 +244,7 @@ bool UtilityThread::RenderPDFToWinMetafile(
if (!get_info_proc(&buffer.front(), buffer.size(), &total_page_count, NULL))
return false;
- metafile->CreateDc(NULL, NULL);
+ metafile->CreateFileBackedDc(NULL, NULL, metafile_path);
// Since we created the metafile using the screen DPI (but we actually want
// the PDF DLL to print using the passed in render_dpi, we apply the following
// transformation.
diff --git a/chrome/utility/utility_thread.h b/chrome/utility/utility_thread.h
index a92c08b..36419aa 100644
--- a/chrome/utility/utility_thread.h
+++ b/chrome/utility/utility_thread.h
@@ -53,6 +53,7 @@ class UtilityThread : public ChildThread {
// IPC to render a PDF into a platform metafile.
void OnRenderPDFPagesToMetafile(
base::PlatformFile pdf_file,
+ const FilePath& metafile_path,
const gfx::Rect& render_area,
int render_dpi,
const std::vector<printing::PageRange>& page_ranges);
@@ -62,6 +63,7 @@ class UtilityThread : public ChildThread {
// |highest_rendered_page_number| is set to -1 on failure to render any page.
bool RenderPDFToWinMetafile(
base::PlatformFile pdf_file,
+ const FilePath& metafile_path,
const gfx::Rect& render_area,
int render_dpi,
const std::vector<printing::PageRange>& page_ranges,