Chromium Code Reviews| 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 dade2ee2e63503878d7917311a4de7a5f33ce407..49aa201c6df9d75fa6dd2463cfdcb625f3516511 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 MetafileSkiaWrapper; |
| +} |
| + |
| 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::MetafileSkiaWrapper* wrapper); |
| // Updates the layer for compositing. This creates a layer and attaches to the |
| // container if: |
| @@ -660,8 +665,7 @@ class CONTENT_EXPORT PepperPluginInstanceImpl |
| // Internal helper function for PrintPage(). |
| void PrintPageHelper(PP_PrintPageNumberRange_Dev* page_ranges, |
| - int num_ranges, |
| - blink::WebCanvas* canvas); |
| + int num_ranges, printing::MetafileSkiaWrapper* wrapper); |
| void DoSetCursor(blink::WebCursorInfo* cursor); |
| @@ -835,13 +839,13 @@ 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_wrapper_| |
|
bbudge
2016/11/17 22:37:00
nit: formatting is a little hard to read here.
|
| // is preserved in PrintWebViewHelper::PrintPages. This makes it possible |
| // to generate the entire PDF given the variables below: |
| // |
| - // The most recently used WebCanvas to be used in printEnd(). Caller must |
| - // ensure that it remains valid until that point. |
| - blink::WebCanvas* canvas_; |
| + // The most recently used metafile wrapper from the most recently used canvas |
| + sk_sp<printing::MetafileSkiaWrapper> metafile_wrapper_; |
|
Lei Zhang
2016/11/18 02:25:53
So this is slightly problematic as-is because it a
|
| // An array of page ranges. |
| std::vector<PP_PrintPageNumberRange_Dev> ranges_; |