| Index: printing/image_mac.cc
|
| diff --git a/printing/image_mac.cc b/printing/image_mac.cc
|
| index 423b1fcb5768e995f373c5748733ee37cf832a33..aa643de2cd66e3157fec0c45d2e16eeb1076c9d2 100644
|
| --- a/printing/image_mac.cc
|
| +++ b/printing/image_mac.cc
|
| @@ -5,11 +5,13 @@
|
| #include "printing/image.h"
|
|
|
| #include <ApplicationServices/ApplicationServices.h>
|
| +#include <CoreFoundation/CoreFoundation.h>
|
| #include <stddef.h>
|
| #include <stdint.h>
|
|
|
| #include "base/mac/scoped_cftyperef.h"
|
| #include "printing/metafile.h"
|
| +#include "printing/pdf_metafile_cg_mac.h"
|
| #include "ui/gfx/geometry/rect.h"
|
|
|
| namespace printing {
|
| @@ -39,12 +41,13 @@ bool Image::LoadMetafile(const Metafile& metafile) {
|
| kCGImageAlphaPremultipliedLast));
|
| DCHECK(bitmap_context.get());
|
|
|
| - struct Metafile::MacRenderPageParams params;
|
| + struct PdfMetafileCg::RenderPageParams params;
|
| params.shrink_to_fit = true;
|
| - metafile.RenderPage(page_number, bitmap_context,
|
| - CGRectMake(0, 0, size_.width(), size_.height()), params);
|
| -
|
| - return true;
|
| + CGRect cg_rect = CGRectMake(0, 0, size_.width(), size_.height());
|
| + std::vector<char> buffer;
|
| + return metafile.GetDataAsVector(&buffer) &&
|
| + PdfMetafileCg::RenderPage(buffer.data(), buffer.size(), page_number,
|
| + bitmap_context, cg_rect, params);
|
| }
|
|
|
| } // namespace printing
|
|
|