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/fpdf_formfill.h" | 7 #include "public/fpdf_formfill.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 CPDFSDK_Document* pFXDoc = pEnv->GetSDKDocument(); | 335 CPDFSDK_Document* pFXDoc = pEnv->GetSDKDocument(); |
336 if (!pFXDoc) | 336 if (!pFXDoc) |
337 return; | 337 return; |
338 #endif // PDF_ENABLE_XFA | 338 #endif // PDF_ENABLE_XFA |
339 | 339 |
340 CFX_Matrix matrix; | 340 CFX_Matrix matrix; |
341 pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate); | 341 pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate); |
342 | 342 |
343 FX_RECT clip(start_x, start_y, start_x + size_x, start_y + size_y); | 343 FX_RECT clip(start_x, start_y, start_x + size_x, start_y + size_y); |
344 | 344 |
| 345 std::unique_ptr<CFX_FxgeDevice> pDevice(new CFX_FxgeDevice); |
345 #ifdef _SKIA_SUPPORT_ | 346 #ifdef _SKIA_SUPPORT_ |
346 std::unique_ptr<CFX_SkiaDevice> pDevice(new CFX_SkiaDevice()); | |
347 pDevice->AttachRecorder(static_cast<SkPictureRecorder*>(recorder)); | 347 pDevice->AttachRecorder(static_cast<SkPictureRecorder*>(recorder)); |
348 #else | |
349 std::unique_ptr<CFX_FxgeDevice> pDevice(new CFX_FxgeDevice); | |
350 #endif | 348 #endif |
351 pDevice->Attach((CFX_DIBitmap*)bitmap); | 349 pDevice->Attach((CFX_DIBitmap*)bitmap); |
352 pDevice->SaveState(); | 350 pDevice->SaveState(); |
353 pDevice->SetClip_Rect(clip); | 351 pDevice->SetClip_Rect(clip); |
354 | 352 |
355 #ifndef PDF_ENABLE_XFA | 353 #ifndef PDF_ENABLE_XFA |
356 if (CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, pPage)) | 354 if (CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, pPage)) |
357 pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options); | 355 pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options); |
358 #else // PDF_ENABLE_XFA | 356 #else // PDF_ENABLE_XFA |
359 CPDF_RenderOptions options; | 357 CPDF_RenderOptions options; |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); | 716 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); |
719 } | 717 } |
720 } else { | 718 } else { |
721 if (aa.ActionExist(CPDF_AAction::ClosePage)) { | 719 if (aa.ActionExist(CPDF_AAction::ClosePage)) { |
722 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); | 720 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); |
723 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); | 721 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); |
724 } | 722 } |
725 } | 723 } |
726 } | 724 } |
727 } | 725 } |
OLD | NEW |