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

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

Issue 1519693002: Merge to XFA: Remove CFX_AffineMatrix/CPDF_Matrix (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: XFA-specific changes Created 5 years 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 <algorithm> 7 #include <algorithm>
8 8
9 #include "fpdfsdk/include/fsdk_mgr.h" 9 #include "fpdfsdk/include/fsdk_mgr.h"
10 10
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 void CFX_SystemHandler::SetCursor(int32_t nCursorType) { 95 void CFX_SystemHandler::SetCursor(int32_t nCursorType) {
96 m_pEnv->FFI_SetCursor(nCursorType); 96 m_pEnv->FFI_SetCursor(nCursorType);
97 } 97 }
98 98
99 void CFX_SystemHandler::InvalidateRect(FX_HWND hWnd, FX_RECT rect) { 99 void CFX_SystemHandler::InvalidateRect(FX_HWND hWnd, FX_RECT rect) {
100 CPDFSDK_Annot* pSDKAnnot = (CPDFSDK_Annot*)hWnd; 100 CPDFSDK_Annot* pSDKAnnot = (CPDFSDK_Annot*)hWnd;
101 CPDFSDK_PageView* pPageView = pSDKAnnot->GetPageView(); 101 CPDFSDK_PageView* pPageView = pSDKAnnot->GetPageView();
102 UnderlyingPageType* pPage = pSDKAnnot->GetUnderlyingPage(); 102 UnderlyingPageType* pPage = pSDKAnnot->GetUnderlyingPage();
103 if (!pPage || !pPageView) 103 if (!pPage || !pPageView)
104 return; 104 return;
105 CPDF_Matrix page2device; 105 CFX_Matrix page2device;
106 pPageView->GetCurrentMatrix(page2device); 106 pPageView->GetCurrentMatrix(page2device);
107 CPDF_Matrix device2page; 107 CFX_Matrix device2page;
108 device2page.SetReverse(page2device); 108 device2page.SetReverse(page2device);
109 FX_FLOAT left, top, right, bottom; 109 FX_FLOAT left, top, right, bottom;
110 device2page.Transform((FX_FLOAT)rect.left, (FX_FLOAT)rect.top, left, top); 110 device2page.Transform((FX_FLOAT)rect.left, (FX_FLOAT)rect.top, left, top);
111 device2page.Transform((FX_FLOAT)rect.right, (FX_FLOAT)rect.bottom, right, 111 device2page.Transform((FX_FLOAT)rect.right, (FX_FLOAT)rect.bottom, right,
112 bottom); 112 bottom);
113 CPDF_Rect rcPDF(left, bottom, right, top); 113 CPDF_Rect rcPDF(left, bottom, right, top);
114 rcPDF.Normalize(); 114 rcPDF.Normalize();
115 115
116 m_pEnv->FFI_Invalidate(pPage, rcPDF.left, rcPDF.top, rcPDF.right, 116 m_pEnv->FFI_Invalidate(pPage, rcPDF.left, rcPDF.top, rcPDF.right,
117 rcPDF.bottom); 117 rcPDF.bottom);
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 m_pAnnotList.reset(); 650 m_pAnnotList.reset();
651 #ifndef PDF_ENABLE_XFA 651 #ifndef PDF_ENABLE_XFA
652 m_page->RemovePrivateData((void*)m_page); 652 m_page->RemovePrivateData((void*)m_page);
653 if (m_bTakeOverPage) { 653 if (m_bTakeOverPage) {
654 delete m_page; 654 delete m_page;
655 } 655 }
656 #endif // PDF_ENABLE_XFA 656 #endif // PDF_ENABLE_XFA
657 } 657 }
658 658
659 void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice, 659 void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice,
660 CPDF_Matrix* pUser2Device, 660 CFX_Matrix* pUser2Device,
661 #ifdef PDF_ENABLE_XFA 661 #ifdef PDF_ENABLE_XFA
662 CPDF_RenderOptions* pOptions, 662 CPDF_RenderOptions* pOptions,
663 const FX_RECT& pClip) { 663 const FX_RECT& pClip) {
664 #else 664 #else
665 CPDF_RenderOptions* pOptions) { 665 CPDF_RenderOptions* pOptions) {
666 #endif // PDF_ENABLE_XFA 666 #endif // PDF_ENABLE_XFA
667 m_curMatrix = *pUser2Device; 667 m_curMatrix = *pUser2Device;
668 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); 668 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
669 669
670 #ifdef PDF_ENABLE_XFA 670 #ifdef PDF_ENABLE_XFA
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
1163 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); 1163 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot();
1164 if (!pFocusAnnot) 1164 if (!pFocusAnnot)
1165 return nullptr; 1165 return nullptr;
1166 1166
1167 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { 1167 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) {
1168 if (pAnnot == pFocusAnnot) 1168 if (pAnnot == pFocusAnnot)
1169 return pAnnot; 1169 return pAnnot;
1170 } 1170 }
1171 return nullptr; 1171 return nullptr;
1172 } 1172 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698