diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-02 17:20:21 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-02 17:20:21 +0000 |
commit | 7756e5b1e7919fe530ff1ff27503d4893efcee13 (patch) | |
tree | 5b7ac359e22bf58e5ae72fbdc57a6b6c92efe285 /webkit/plugins/ppapi | |
parent | f3e9d6e12d38ea05e476899eb2620c57d351f74b (diff) | |
download | chromium_src-7756e5b1e7919fe530ff1ff27503d4893efcee13.zip chromium_src-7756e5b1e7919fe530ff1ff27503d4893efcee13.tar.gz chromium_src-7756e5b1e7919fe530ff1ff27503d4893efcee13.tar.bz2 |
Revert 76553 - Applying factory pattern (through NativeMetafileFactory class). It is used to retrieve different printing contexts (based on the platform and user preferences).
BUG=NONE
TEST=NONE
Review URL: http://codereview.chromium.org/6544028
TBR=dpapad@chromium.org
Review URL: http://codereview.chromium.org/6594121
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76555 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins/ppapi')
-rw-r--r-- | webkit/plugins/ppapi/ppapi_plugin_instance.cc | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc index 3c24dfb..bd4264c 100644 --- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc +++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc @@ -22,6 +22,7 @@ #include "ppapi/c/ppb_core.h" #include "ppapi/c/ppb_instance.h" #include "ppapi/c/ppp_instance.h" +#include "printing/native_metafile.h" #include "printing/units.h" #include "skia/ext/vector_platform_device.h" #include "skia/ext/platform_canvas.h" @@ -53,18 +54,9 @@ #include "webkit/plugins/ppapi/string.h" #include "webkit/plugins/ppapi/var.h" -#if defined(OS_POSIX) -#include "printing/native_metafile.h" -#endif - #if defined(OS_MACOSX) #include "base/mac/mac_util.h" #include "base/mac/scoped_cftyperef.h" -#include "printing/native_metafile_factory.h" -#endif - -#if defined(OS_LINUX) -#include "printing/pdf_ps_metafile_cairo.h" #endif #if defined(OS_WIN) @@ -1043,16 +1035,15 @@ bool PluginInstance::PrintPDFOutput(PP_Resource print_output, // directly. cairo_t* context = canvas->beginPlatformPaint(); printing::NativeMetafile* metafile = - printing::PdfPsMetafile::FromCairoContext(context); + printing::NativeMetafile::FromCairoContext(context); DCHECK(metafile); if (metafile) ret = metafile->SetRawData(buffer->mapped_buffer(), buffer->size()); canvas->endPlatformPaint(); #elif defined(OS_MACOSX) - scoped_ptr<printing::NativeMetafile> metafile( - printing::NativeMetafileFactory::CreateMetafile()); + printing::NativeMetafile metafile; // Create a PDF metafile and render from there into the passed in context. - if (metafile->Init(buffer->mapped_buffer(), buffer->size())) { + if (metafile.Init(buffer->mapped_buffer(), buffer->size())) { // Flip the transform. CGContextSaveGState(canvas); CGContextTranslateCTM(canvas, 0, @@ -1064,7 +1055,7 @@ bool PluginInstance::PrintPDFOutput(PP_Resource print_output, page_rect.size.width = current_print_settings_.printable_area.size.width; page_rect.size.height = current_print_settings_.printable_area.size.height; - ret = metafile->RenderPage(1, canvas, page_rect, true, false, true, true); + ret = metafile.RenderPage(1, canvas, page_rect, true, false, true, true); CGContextRestoreGState(canvas); } #elif defined(OS_WIN) |