| 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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 return; | 325 return; |
| 326 CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle; | 326 CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle; |
| 327 CPDFSDK_Document* pFXDoc = pEnv->GetSDKDocument(); | 327 CPDFSDK_Document* pFXDoc = pEnv->GetSDKDocument(); |
| 328 if (!pFXDoc) | 328 if (!pFXDoc) |
| 329 return; | 329 return; |
| 330 #endif // PDF_ENABLE_XFA | 330 #endif // PDF_ENABLE_XFA |
| 331 | 331 |
| 332 CFX_Matrix matrix; | 332 CFX_Matrix matrix; |
| 333 pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate); | 333 pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate); |
| 334 | 334 |
| 335 FX_RECT clip; | 335 FX_RECT clip(start_x, start_y, start_x + size_x, start_y + size_y); |
| 336 clip.left = start_x; | |
| 337 clip.right = start_x + size_x; | |
| 338 clip.top = start_y; | |
| 339 clip.bottom = start_y + size_y; | |
| 340 | 336 |
| 341 #ifdef _SKIA_SUPPORT_ | 337 #ifdef _SKIA_SUPPORT_ |
| 342 std::unique_ptr<CFX_SkiaDevice> pDevice(new CFX_SkiaDevice); | 338 std::unique_ptr<CFX_SkiaDevice> pDevice(new CFX_SkiaDevice); |
| 343 #else | 339 #else |
| 344 std::unique_ptr<CFX_FxgeDevice> pDevice(new CFX_FxgeDevice); | 340 std::unique_ptr<CFX_FxgeDevice> pDevice(new CFX_FxgeDevice); |
| 345 #endif | 341 #endif |
| 346 pDevice->Attach((CFX_DIBitmap*)bitmap); | 342 pDevice->Attach((CFX_DIBitmap*)bitmap); |
| 347 pDevice->SaveState(); | 343 pDevice->SaveState(); |
| 348 pDevice->SetClip_Rect(&clip); | 344 pDevice->SetClip_Rect(clip); |
| 349 | 345 |
| 350 #ifndef PDF_ENABLE_XFA | 346 #ifndef PDF_ENABLE_XFA |
| 351 if (CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, pPage)) | 347 if (CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, pPage)) |
| 352 pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options); | 348 pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options); |
| 353 #else // PDF_ENABLE_XFA | 349 #else // PDF_ENABLE_XFA |
| 354 CPDF_RenderOptions options; | 350 CPDF_RenderOptions options; |
| 355 if (flags & FPDF_LCD_TEXT) | 351 if (flags & FPDF_LCD_TEXT) |
| 356 options.m_Flags |= RENDER_CLEARTYPE; | 352 options.m_Flags |= RENDER_CLEARTYPE; |
| 357 else | 353 else |
| 358 options.m_Flags &= ~RENDER_CLEARTYPE; | 354 options.m_Flags &= ~RENDER_CLEARTYPE; |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); | 722 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); |
| 727 } | 723 } |
| 728 } else { | 724 } else { |
| 729 if (aa.ActionExist(CPDF_AAction::ClosePage)) { | 725 if (aa.ActionExist(CPDF_AAction::ClosePage)) { |
| 730 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); | 726 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); |
| 731 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); | 727 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); |
| 732 } | 728 } |
| 733 } | 729 } |
| 734 } | 730 } |
| 735 } | 731 } |
| OLD | NEW |