OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium 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 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "public/fpdfview.h" | 7 #include "public/fpdfview.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 int size_y) { | 655 int size_y) { |
656 CPDF_Page* pPage = CPDFPageFromFPDFPage(page); | 656 CPDF_Page* pPage = CPDFPageFromFPDFPage(page); |
657 if (!pPage) | 657 if (!pPage) |
658 return nullptr; | 658 return nullptr; |
659 | 659 |
660 CRenderContext* pContext = new CRenderContext; | 660 CRenderContext* pContext = new CRenderContext; |
661 pPage->SetRenderContext(std::unique_ptr<CFX_Deletable>(pContext)); | 661 pPage->SetRenderContext(std::unique_ptr<CFX_Deletable>(pContext)); |
662 CFX_FxgeDevice* skDevice = new CFX_FxgeDevice; | 662 CFX_FxgeDevice* skDevice = new CFX_FxgeDevice; |
663 FPDF_RECORDER recorder = skDevice->CreateRecorder(size_x, size_y); | 663 FPDF_RECORDER recorder = skDevice->CreateRecorder(size_x, size_y); |
664 pContext->m_pDevice = skDevice; | 664 pContext->m_pDevice = skDevice; |
665 FPDF_RenderPage_Retail(pContext.get(), page, 0, 0, size_x, size_y, 0, 0, TRUE, | 665 FPDF_RenderPage_Retail(pContext, page, 0, 0, size_x, size_y, 0, 0, TRUE, |
666 nullptr); | 666 nullptr); |
667 pPage->SetRenderContext(std::unique_ptr<CFX_Deletable>()); | 667 pPage->SetRenderContext(std::unique_ptr<CFX_Deletable>()); |
668 return recorder; | 668 return recorder; |
669 } | 669 } |
670 #endif | 670 #endif |
671 | 671 |
672 DLLEXPORT void STDCALL FPDF_ClosePage(FPDF_PAGE page) { | 672 DLLEXPORT void STDCALL FPDF_ClosePage(FPDF_PAGE page) { |
673 UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page); | 673 UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page); |
674 if (!page) | 674 if (!page) |
675 return; | 675 return; |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1134 if (!buffer) { | 1134 if (!buffer) { |
1135 *buflen = len; | 1135 *buflen = len; |
1136 } else if (*buflen >= len) { | 1136 } else if (*buflen >= len) { |
1137 memcpy(buffer, utf16Name.c_str(), len); | 1137 memcpy(buffer, utf16Name.c_str(), len); |
1138 *buflen = len; | 1138 *buflen = len; |
1139 } else { | 1139 } else { |
1140 *buflen = -1; | 1140 *buflen = -1; |
1141 } | 1141 } |
1142 return (FPDF_DEST)pDestObj; | 1142 return (FPDF_DEST)pDestObj; |
1143 } | 1143 } |
OLD | NEW |