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

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

Issue 8052020: Revert 103021 - PrintPreview: Printing preview of a PDF on Mac with Skia only previews the last p... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 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
« no previous file with comments | « webkit/plugins/ppapi/ppapi_plugin_instance.h ('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
===================================================================
--- webkit/plugins/ppapi/ppapi_plugin_instance.cc (revision 103025)
+++ webkit/plugins/ppapi/ppapi_plugin_instance.cc (working copy)
@@ -851,10 +851,10 @@
if (!num_pages)
return 0;
current_print_settings_ = print_settings;
-#if defined(USE_SKIA)
+#if defined(OS_LINUX) || defined(OS_WIN)
canvas_ = NULL;
ranges_.clear();
-#endif // USE_SKIA
+#endif // OS_LINUX || OS_WIN
return num_pages;
}
@@ -862,19 +862,14 @@
DCHECK(plugin_print_interface_);
PP_PrintPageNumberRange_Dev page_range;
page_range.first_page_number = page_range.last_page_number = page_number;
-#if defined(USE_SKIA)
+#if defined(OS_LINUX) || defined(OS_WIN)
// The canvas only has a metafile on it for print preview.
- bool save_for_later =
- (printing::MetafileSkiaWrapper::GetMetafileFromCanvas(*canvas) != NULL);
-#if defined(OS_MACOSX) || defined(OS_WIN)
- save_for_later = save_for_later && skia::IsPreviewMetafile(*canvas);
-#endif
- if (save_for_later) {
+ if (printing::MetafileSkiaWrapper::GetMetafileFromCanvas(canvas)) {
ranges_.push_back(page_range);
canvas_ = canvas;
return true;
} else
-#endif // USE_SKIA
+#endif // OS_LINUX || OS_WIN
{
return PrintPageHelper(&page_range, 1, canvas);
}
@@ -906,12 +901,12 @@
void PluginInstance::PrintEnd() {
// Keep a reference on the stack. See NOTE above.
scoped_refptr<PluginInstance> ref(this);
-#if defined(USE_SKIA)
+#if defined(OS_LINUX) || defined(OS_WIN)
if (!ranges_.empty())
PrintPageHelper(&(ranges_.front()), ranges_.size(), canvas_.get());
canvas_ = NULL;
ranges_.clear();
-#endif // USE_SKIA
+#endif // OS_LINUX || OS_WIN
DCHECK(plugin_print_interface_);
if (plugin_print_interface_)
@@ -1066,7 +1061,7 @@
// (NativeMetafile and PreviewMetafile must have compatible formats,
// i.e. both PDF for this to work).
printing::Metafile* metafile =
- printing::MetafileSkiaWrapper::GetMetafileFromCanvas(*canvas);
+ printing::MetafileSkiaWrapper::GetMetafileFromCanvas(canvas);
DCHECK(metafile != NULL);
if (metafile)
ret = metafile->InitFromData(mapper.data(), mapper.size());
@@ -1091,7 +1086,7 @@
}
#elif defined(OS_WIN)
printing::Metafile* metafile =
- printing::MetafileSkiaWrapper::GetMetafileFromCanvas(*canvas);
+ printing::MetafileSkiaWrapper::GetMetafileFromCanvas(canvas);
if (metafile) {
// We only have a metafile when doing print preview, so we just want to
// pass the PDF off to preview.
« no previous file with comments | « webkit/plugins/ppapi/ppapi_plugin_instance.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698