| Index: chrome/renderer/webplugin_delegate_pepper.cc
|
| diff --git a/chrome/renderer/webplugin_delegate_pepper.cc b/chrome/renderer/webplugin_delegate_pepper.cc
|
| index 921138f5f633f625fc9ca0fcfa83bb8b30f90185..6d2b2a62892d78e7428ce1ddfc96aa7bb461c6e4 100644
|
| --- a/chrome/renderer/webplugin_delegate_pepper.cc
|
| +++ b/chrome/renderer/webplugin_delegate_pepper.cc
|
| @@ -50,7 +50,7 @@
|
| #include "ui/gfx/codec/jpeg_codec.h"
|
| #include "ui/gfx/gdi_util.h"
|
| #endif
|
| -#include "printing/native_metafile.h"
|
| +#include "printing/metafile_factory.h"
|
| #include "third_party/npapi/bindings/npapi_extensions.h"
|
| #include "third_party/npapi/bindings/npapi_extensions_private.h"
|
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h"
|
| @@ -1221,24 +1221,25 @@ bool WebPluginDelegatePepper::VectorPrintPage(int page_number,
|
| // On Linux we need to get the backing PdfPsMetafile and write the bits
|
| // directly.
|
| cairo_t* context = canvas->beginPlatformPaint();
|
| - printing::NativeMetafile* metafile =
|
| - printing::NativeMetafile::FromCairoContext(context);
|
| - DCHECK(metafile);
|
| - if (metafile) {
|
| - ret = metafile->SetRawData(pdf_output, output_size);
|
| + printing::NativeMetafile* metafile_ptr =
|
| + printing::MetafileFactory::GetMetafileFrom(context);
|
| + DCHECK(metafile_ptr);
|
| + if (metafile_ptr) {
|
| + ret = metafile_ptr->SetRawData(pdf_output, output_size);
|
| if (ret)
|
| pdf_output_done_ = true;
|
| }
|
| canvas->endPlatformPaint();
|
| #elif defined(OS_MACOSX)
|
| - printing::NativeMetafile metafile;
|
| + scoped_ptr<printing::NativeMetafile> metafile_ptr(
|
| + printing::MetafileFactory::GetMetafile());
|
| // Create a PDF metafile and render from there into the passed in context.
|
| - if (metafile.Init(pdf_output, output_size)) {
|
| + if (metafile_ptr->Init(pdf_output, output_size)) {
|
| // Flip the transform.
|
| CGContextSaveGState(canvas);
|
| CGContextTranslateCTM(canvas, 0, current_printable_area_.height());
|
| CGContextScaleCTM(canvas, 1.0, -1.0);
|
| - ret = metafile.RenderPage(1, canvas, current_printable_area_.ToCGRect(),
|
| + ret = metafile_ptr->RenderPage(1, canvas, current_printable_area_.ToCGRect(),
|
| true, false, true, true);
|
| CGContextRestoreGState(canvas);
|
| }
|
|
|