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

Unified Diff: content/renderer/pepper/pepper_plugin_instance_impl.h

Issue 2515783002: remember the last metafile, instead of the last canvas (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | content/renderer/pepper/pepper_plugin_instance_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/pepper_plugin_instance_impl.h
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.h b/content/renderer/pepper/pepper_plugin_instance_impl.h
index dc08cfff6c7d0e8a085e2f1a3ec9db7d9faa366a..213c81262a0e64b0c91b9fb70f0a1ddc6e98c3c0 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.h
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.h
@@ -98,6 +98,10 @@ struct PPP_Instance_Combined;
class ScopedPPVar;
}
+namespace printing {
+class PdfMetafileSkia;
+}
+
namespace content {
class ContentDecryptorDelegate;
@@ -645,7 +649,8 @@ class CONTENT_EXPORT PepperPluginInstanceImpl
// best format to use. Returns false if the plugin does not support any
// print format that we can handle (we can handle only PDF).
bool GetPreferredPrintOutputFormat(PP_PrintOutputFormat_Dev* format);
- bool PrintPDFOutput(PP_Resource print_output, blink::WebCanvas* canvas);
+ bool PrintPDFOutput(PP_Resource print_output,
+ printing::PdfMetafileSkia* metafile);
// Updates the layer for compositing. This creates a layer and attaches to the
// container if:
@@ -661,7 +666,7 @@ class CONTENT_EXPORT PepperPluginInstanceImpl
// Internal helper function for PrintPage().
void PrintPageHelper(PP_PrintPageNumberRange_Dev* page_ranges,
int num_ranges,
- blink::WebCanvas* canvas);
+ printing::PdfMetafileSkia* metafile);
void DoSetCursor(blink::WebCursorInfo* cursor);
@@ -835,12 +840,12 @@ class CONTENT_EXPORT PepperPluginInstanceImpl
// and Win, 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_|
+ // number in |ranges_|. The hack is in PrintEnd(), where a valid |metafile_|
// 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.
- sk_sp<blink::WebCanvas> canvas_;
+ // The most recently used metafile_, guaranteed to be valid.
+ printing::PdfMetafileSkia* metafile_;
// An array of page ranges.
std::vector<PP_PrintPageNumberRange_Dev> ranges_;
« no previous file with comments | « no previous file | content/renderer/pepper/pepper_plugin_instance_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698