OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |