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

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

Issue 7065011: Change printing of PDFs for preview on Windows to not rasterize. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 years, 7 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 | « printing/printing.gyp ('k') | webkit/plugins/ppapi/ppapi_plugin_instance.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppapi_plugin_instance.h
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.h b/webkit/plugins/ppapi/ppapi_plugin_instance.h
index 5ce4fcf0b3d287f128156eb16d1d32ada57840fa..58a118694f5b990809f7bd19882ba1060a7801b4 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.h
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.h
@@ -24,6 +24,7 @@
#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_resource.h"
#include "third_party/skia/include/core/SkBitmap.h"
+#include "third_party/skia/include/core/SkRefCnt.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCanvas.h"
#include "ui/gfx/rect.h"
#include "webkit/plugins/ppapi/plugin_delegate.h"
@@ -375,20 +376,21 @@ class PluginInstance : public base::RefCounted<PluginInstance> {
// to keep the pixels valid until CGContextEndPage is called. We use this
// variable to hold on to the pixels.
scoped_refptr<PPB_ImageData_Impl> last_printed_page_;
-#elif defined(OS_LINUX)
- // On Linux, all pages need to be written to a PDF file in one shot. However,
- // when users print only a subset of all the pages, it is impossible to know
- // if a call to PrintPage() is the last call. Thus in PrintPage(), just store
- // the page number in |ranges_|.
+#endif // defined(OS_MACOSX)
+#if WEBKIT_USING_SKIA
+ // When printing to PDF (print preview, Linux) the entire document goes into
+ // one metafile. However, when users print only a subset of all the pages,
+ // it is impossible to know if a call to PrintPage() is the last call.
+ // Thus in PrintPage(), just store the page number in |ranges_|.
// The hack is in PrintEnd(), where a valid |canvas_| is preserved in
// PrintWebViewHelper::PrintPages. This makes it possible to generate the
// entire PDF given the variables below:
//
// The most recently used WebCanvas, guaranteed to be valid.
- WebKit::WebCanvas* canvas_;
+ SkRefPtr<WebKit::WebCanvas> canvas_;
// An array of page ranges.
std::vector<PP_PrintPageNumberRange_Dev> ranges_;
-#endif // defined(OS_LINUX)
+#endif // WEBKIT_USING_SKIA
// The plugin print interface. This nested struct adds functions needed for
// backwards compatibility.
« no previous file with comments | « printing/printing.gyp ('k') | webkit/plugins/ppapi/ppapi_plugin_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698