Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1358)

Unified Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 6696076: Adding CreateFromData to NativeMetafileFactory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebasing Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« printing/native_metafile_factory.cc ('K') | « printing/native_metafile_factory.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppapi_plugin_instance.cc
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
index 075630863a30d837bc124f06ff51c78a19b2d717..e6bd0c0d01c8b4e8f4a9ad4394d254486be49de4 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
@@ -1190,10 +1190,11 @@ bool PluginInstance::PrintPDFOutput(PP_Resource print_output,
ret = metafile->InitFromData(buffer->mapped_buffer(), buffer->size());
canvas->endPlatformPaint();
#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,
« printing/native_metafile_factory.cc ('K') | « printing/native_metafile_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698