summaryrefslogtreecommitdiffstats
path: root/webkit/plugins
diff options
context:
space:
mode:
authorvandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-25 16:35:22 +0000
committervandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-25 16:35:22 +0000
commite6eddfdb8f1a9688145e5efba334d484c738a1c6 (patch)
treef7f527ea233ab64053683a7af7933314a93f1934 /webkit/plugins
parent8effd3f691277e168a10890127085a3bc999810f (diff)
downloadchromium_src-e6eddfdb8f1a9688145e5efba334d484c738a1c6.zip
chromium_src-e6eddfdb8f1a9688145e5efba334d484c738a1c6.tar.gz
chromium_src-e6eddfdb8f1a9688145e5efba334d484c738a1c6.tar.bz2
Make PluginInstance::PrintPDFOutput metafile-implementation agnostic on Linux.
PluginInstance::PrintPDFOutput wants to set the PDF bits in the metafile. This change makes it agnostic to the implementation of NativeMetafile in use by using the SkRefDict in SkDevice (and removes the old mechanism). BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/6733036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79412 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins')
-rw-r--r--webkit/plugins/ppapi/ppapi_plugin_instance.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
index 0756308..d6a1da0 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
@@ -69,7 +69,7 @@
#endif
#if defined(OS_LINUX)
-#include "printing/pdf_ps_metafile_cairo.h"
+#include "printing/native_metafile_skia_wrapper.h"
#endif
#if defined(OS_WIN)
@@ -1180,15 +1180,12 @@ bool PluginInstance::PrintPDFOutput(PP_Resource print_output,
bool ret = false;
#if defined(OS_LINUX)
- // On Linux we need to get the backing PdfPsMetafile and write the bits
- // directly.
- cairo_t* context = canvas->beginPlatformPaint();
+ // On Linux we just set the final bits in the native metafile.
printing::NativeMetafile* metafile =
- printing::PdfPsMetafile::FromCairoContext(context);
- DCHECK(metafile);
+ printing::NativeMetafileSkiaWrapper::GetMetafileFromCanvas(canvas);
+ DCHECK(metafile != NULL);
if (metafile)
ret = metafile->InitFromData(buffer->mapped_buffer(), buffer->size());
- canvas->endPlatformPaint();
#elif defined(OS_MACOSX)
scoped_ptr<printing::NativeMetafile> metafile(
printing::NativeMetafileFactory::Create());