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

Side by Side Diff: fpdfsdk/fpdfformfill.cpp

Issue 1975143002: allow Skia to be the default graphics engine (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 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 | « fpdfsdk/fpdf_progressive.cpp ('k') | fpdfsdk/fpdfview.cpp » ('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 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
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
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 }
OLDNEW
« no previous file with comments | « fpdfsdk/fpdf_progressive.cpp ('k') | fpdfsdk/fpdfview.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698