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

Side by Side Diff: fpdfsdk/src/fpdfformfill.cpp

Issue 1776313002: Add bitmaps and skp output to Skia port (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: wip; add skp output to test framework Created 4 years, 9 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
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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 DLLEXPORT FPDF_BOOL STDCALL FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle) { 282 DLLEXPORT FPDF_BOOL STDCALL FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle) {
283 CPDFSDK_Document* pSDKDoc = CPDFSDK_Document::FromFPDFFormHandle(hHandle); 283 CPDFSDK_Document* pSDKDoc = CPDFSDK_Document::FromFPDFFormHandle(hHandle);
284 if (!pSDKDoc) 284 if (!pSDKDoc)
285 return FALSE; 285 return FALSE;
286 286
287 return pSDKDoc->KillFocusAnnot(0); 287 return pSDKDoc->KillFocusAnnot(0);
288 } 288 }
289 289
290 DLLEXPORT void STDCALL FPDF_FFLDraw(FPDF_FORMHANDLE hHandle, 290 DLLEXPORT void STDCALL FPDF_FFLDraw(FPDF_FORMHANDLE hHandle,
291 FPDF_BITMAP bitmap, 291 FPDF_BITMAP bitmap,
292 void* recorder,
dsinclair 2016/03/10 14:38:54 This is part of the public API, so we can't change
caryclark 2016/03/10 20:44:55 Done.
292 FPDF_PAGE page, 293 FPDF_PAGE page,
293 int start_x, 294 int start_x,
294 int start_y, 295 int start_y,
295 int size_x, 296 int size_x,
296 int size_y, 297 int size_y,
297 int rotate, 298 int rotate,
298 int flags) { 299 int flags) {
299 if (!hHandle) 300 if (!hHandle)
300 return; 301 return;
301 302
(...skipping 27 matching lines...) Expand all
329 if (!pFXDoc) 330 if (!pFXDoc)
330 return; 331 return;
331 #endif // PDF_ENABLE_XFA 332 #endif // PDF_ENABLE_XFA
332 333
333 CFX_Matrix matrix; 334 CFX_Matrix matrix;
334 pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate); 335 pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate);
335 336
336 FX_RECT clip(start_x, start_y, start_x + size_x, start_y + size_y); 337 FX_RECT clip(start_x, start_y, start_x + size_x, start_y + size_y);
337 338
338 #ifdef _SKIA_SUPPORT_ 339 #ifdef _SKIA_SUPPORT_
339 std::unique_ptr<CFX_SkiaDevice> pDevice(new CFX_SkiaDevice); 340 std::unique_ptr<CFX_SkiaDevice> pDevice(new CFX_SkiaDevice(size_x, size_y, rec order));
340 #else 341 #else
341 std::unique_ptr<CFX_FxgeDevice> pDevice(new CFX_FxgeDevice); 342 std::unique_ptr<CFX_FxgeDevice> pDevice(new CFX_FxgeDevice);
342 #endif 343 #endif
343 pDevice->Attach((CFX_DIBitmap*)bitmap); 344 pDevice->Attach((CFX_DIBitmap*)bitmap);
344 pDevice->SaveState(); 345 pDevice->SaveState();
345 pDevice->SetClip_Rect(clip); 346 pDevice->SetClip_Rect(clip);
346 347
347 #ifndef PDF_ENABLE_XFA 348 #ifndef PDF_ENABLE_XFA
348 if (CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, pPage)) 349 if (CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, pPage))
349 pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options); 350 pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options);
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); 724 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc);
724 } 725 }
725 } else { 726 } else {
726 if (aa.ActionExist(CPDF_AAction::ClosePage)) { 727 if (aa.ActionExist(CPDF_AAction::ClosePage)) {
727 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); 728 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage);
728 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); 729 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc);
729 } 730 }
730 } 731 }
731 } 732 }
732 } 733 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698