summaryrefslogtreecommitdiffstats
path: root/webkit/plugins/ppapi
diff options
context:
space:
mode:
authordpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-26 00:28:36 +0000
committerdpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-26 00:28:36 +0000
commit67c5be79a53904e4ab5a6617bf9cbad9f7f5de6f (patch)
treed3d8e5c52a081276c4e7e5a44f77cc8d49a70c21 /webkit/plugins/ppapi
parent70ce2ea6a9312b849f9909b26d52c147e6033e38 (diff)
downloadchromium_src-67c5be79a53904e4ab5a6617bf9cbad9f7f5de6f.zip
chromium_src-67c5be79a53904e4ab5a6617bf9cbad9f7f5de6f.tar.gz
chromium_src-67c5be79a53904e4ab5a6617bf9cbad9f7f5de6f.tar.bz2
Adding CreateFromData to NativeMetafileFactory
Also making Create method calling Init on the metafile before returning it. Usually clients of the NativeMetafileFactory call Create and the Init or InitFromData on the object to initialize it. Now the returned object will already be initialized. BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/6696076 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79475 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins/ppapi')
-rw-r--r--webkit/plugins/ppapi/ppapi_plugin_instance.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
index d6a1da0..a665285 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
@@ -1187,10 +1187,11 @@ bool PluginInstance::PrintPDFOutput(PP_Resource print_output,
if (metafile)
ret = metafile->InitFromData(buffer->mapped_buffer(), buffer->size());
#elif defined(OS_MACOSX)
- scoped_ptr<printing::NativeMetafile> metafile(
- printing::NativeMetafileFactory::Create());
// Create a PDF metafile and render from there into the passed in context.
- if (metafile->InitFromData(buffer->mapped_buffer(), buffer->size())) {
+ scoped_ptr<printing::NativeMetafile> metafile(
+ printing::NativeMetafileFactory::CreateFromData(buffer->mapped_buffer(),
+ buffer->size()));
+ if (metafile.get() != NULL) {
// Flip the transform.
CGContextSaveGState(canvas);
CGContextTranslateCTM(canvas, 0,