Chromium Code Reviews| Index: printing/printed_document_mac.cc |
| diff --git a/printing/printed_document_mac.cc b/printing/printed_document_mac.cc |
| index 73286966f993986daba7c976d96427e62c0cb7ad..faa221b8d4ef8b85335d579a62096209f0ae5567 100644 |
| --- a/printing/printed_document_mac.cc |
| +++ b/printing/printed_document_mac.cc |
| @@ -4,11 +4,12 @@ |
| #include "printing/printed_document.h" |
| -#import <ApplicationServices/ApplicationServices.h> |
| -#import <CoreFoundation/CoreFoundation.h> |
| +#include <ApplicationServices/ApplicationServices.h> |
|
Lei Zhang
2017/04/08 01:24:25
BTW, I'm clueless about #import vs #include, so ma
hal.canary
2017/04/11 19:07:27
Acknowledged.
|
| +#include <CoreFoundation/CoreFoundation.h> |
| #include "base/logging.h" |
| #include "printing/page_number.h" |
| +#include "printing/pdf_metafile_cg_mac.h" |
| #include "printing/printed_page.h" |
| namespace printing { |
| @@ -31,11 +32,16 @@ void PrintedDocument::RenderPrintedPage( |
| page.GetCenteredPageContentRect(page_setup.physical_size(), &content_area); |
| const MetafilePlayer* metafile = page.metafile(); |
| + |
| // Each Metafile is a one-page PDF, and pages use 1-based indexing. |
| const int page_number = 1; |
| - struct Metafile::MacRenderPageParams params; |
| + struct PdfMetafileCg::RenderPageParams params; |
|
Lei Zhang
2017/04/08 01:24:25
I think you can omit the struct keyword.
hal.canary
2017/04/11 19:07:27
Done.
|
| params.autorotate = true; |
| - metafile->RenderPage(page_number, context, content_area.ToCGRect(), params); |
| + std::vector<char> buffer; |
| + if (metafile->GetDataAsVector(&buffer)) { |
| + PdfMetafileCg::RenderPage(buffer.data(), buffer.size(), page_number, |
| + context, content_area.ToCGRect(), params); |
| + } |
| } |
| } // namespace printing |