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

Side by Side Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 2686033005: Move metafile printing code from platform canvas to PaintCanvas (Closed)
Patch Set: Fix missing build_config include Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « components/printing/renderer/print_web_view_helper_mac.mm ('k') | content/shell/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bit_cast.h" 10 #include "base/bit_cast.h"
(...skipping 1817 matching lines...) Expand 10 before | Expand all | Expand 10 after
1828 } 1828 }
1829 1829
1830 void PepperPluginInstanceImpl::PrintPage(int page_number, 1830 void PepperPluginInstanceImpl::PrintPage(int page_number,
1831 blink::WebCanvas* canvas) { 1831 blink::WebCanvas* canvas) {
1832 #if BUILDFLAG(ENABLE_PRINTING) 1832 #if BUILDFLAG(ENABLE_PRINTING)
1833 DCHECK(plugin_print_interface_); 1833 DCHECK(plugin_print_interface_);
1834 PP_PrintPageNumberRange_Dev page_range; 1834 PP_PrintPageNumberRange_Dev page_range;
1835 page_range.first_page_number = page_range.last_page_number = page_number; 1835 page_range.first_page_number = page_range.last_page_number = page_number;
1836 // The canvas only has a metafile on it for print preview. 1836 // The canvas only has a metafile on it for print preview.
1837 printing::PdfMetafileSkia* metafile = 1837 printing::PdfMetafileSkia* metafile =
1838 printing::MetafileSkiaWrapper::GetMetafileFromCanvas(*canvas); 1838 printing::MetafileSkiaWrapper::GetMetafileFromCanvas(canvas);
1839 bool save_for_later = (metafile != NULL); 1839 bool save_for_later = (metafile != NULL);
1840 #if defined(OS_MACOSX) 1840 #if defined(OS_MACOSX)
1841 save_for_later = save_for_later && skia::IsPreviewMetafile(*canvas); 1841 save_for_later = save_for_later && cc::IsPreviewMetafile(canvas);
1842 #endif // defined(OS_MACOSX) 1842 #endif // defined(OS_MACOSX)
1843 if (save_for_later) { 1843 if (save_for_later) {
1844 ranges_.push_back(page_range); 1844 ranges_.push_back(page_range);
1845 metafile_ = metafile; 1845 metafile_ = metafile;
1846 } else { 1846 } else {
1847 PrintPageHelper(&page_range, 1, metafile); 1847 PrintPageHelper(&page_range, 1, metafile);
1848 } 1848 }
1849 #endif 1849 #endif
1850 } 1850 }
1851 1851
(...skipping 1599 matching lines...) Expand 10 before | Expand all | Expand 10 after
3451 const cc::TextureMailbox& mailbox) const { 3451 const cc::TextureMailbox& mailbox) const {
3452 auto it = 3452 auto it =
3453 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(), 3453 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(),
3454 [&mailbox](const TextureMailboxRefCount& ref_count) { 3454 [&mailbox](const TextureMailboxRefCount& ref_count) {
3455 return ref_count.first.mailbox() == mailbox.mailbox(); 3455 return ref_count.first.mailbox() == mailbox.mailbox();
3456 }); 3456 });
3457 return it != texture_ref_counts_.end(); 3457 return it != texture_ref_counts_.end();
3458 } 3458 }
3459 3459
3460 } // namespace content 3460 } // namespace content
OLDNEW
« no previous file with comments | « components/printing/renderer/print_web_view_helper_mac.mm ('k') | content/shell/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698