| 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 "xfa/fde/fde_render.h" | 7 #include "xfa/fde/fde_render.h" |
| 8 | 8 |
| 9 #include "xfa/fde/fde_renderdevice.h" | 9 #include "xfa/fde/fde_renderdevice.h" |
| 10 #include "xfa/fgas/crt/fgas_memory.h" | 10 #include "xfa/fgas/crt/fgas_memory.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 int32_t m_iCharPosCount; | 41 int32_t m_iCharPosCount; |
| 42 IFDE_VisualSetIterator* m_pIterator; | 42 IFDE_VisualSetIterator* m_pIterator; |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 } // namespace | 45 } // namespace |
| 46 | 46 |
| 47 void FDE_GetPageMatrix(CFX_Matrix& pageMatrix, | 47 void FDE_GetPageMatrix(CFX_Matrix& pageMatrix, |
| 48 const CFX_RectF& docPageRect, | 48 const CFX_RectF& docPageRect, |
| 49 const CFX_Rect& devicePageRect, | 49 const CFX_Rect& devicePageRect, |
| 50 int32_t iRotate, | 50 int32_t iRotate, |
| 51 FX_DWORD dwCoordinatesType) { | 51 uint32_t dwCoordinatesType) { |
| 52 FXSYS_assert(iRotate >= 0 && iRotate <= 3); | 52 FXSYS_assert(iRotate >= 0 && iRotate <= 3); |
| 53 FX_BOOL bFlipX = (dwCoordinatesType & 0x01) != 0; | 53 FX_BOOL bFlipX = (dwCoordinatesType & 0x01) != 0; |
| 54 FX_BOOL bFlipY = (dwCoordinatesType & 0x02) != 0; | 54 FX_BOOL bFlipY = (dwCoordinatesType & 0x02) != 0; |
| 55 CFX_Matrix m; | 55 CFX_Matrix m; |
| 56 m.Set((bFlipX ? -1.0f : 1.0f), 0, 0, (bFlipY ? -1.0f : 1.0f), 0, 0); | 56 m.Set((bFlipX ? -1.0f : 1.0f), 0, 0, (bFlipY ? -1.0f : 1.0f), 0, 0); |
| 57 if (iRotate == 0 || iRotate == 2) { | 57 if (iRotate == 0 || iRotate == 2) { |
| 58 m.a *= (FX_FLOAT)devicePageRect.width / docPageRect.width; | 58 m.a *= (FX_FLOAT)devicePageRect.width / docPageRect.width; |
| 59 m.d *= (FX_FLOAT)devicePageRect.height / docPageRect.height; | 59 m.d *= (FX_FLOAT)devicePageRect.height / docPageRect.height; |
| 60 } else { | 60 } else { |
| 61 m.a *= (FX_FLOAT)devicePageRect.height / docPageRect.width; | 61 m.a *= (FX_FLOAT)devicePageRect.height / docPageRect.width; |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 rtClip.Offset(rtObj.left, rtObj.top); | 281 rtClip.Offset(rtObj.left, rtObj.top); |
| 282 m_Transform.TransformRect(rtClip); | 282 m_Transform.TransformRect(rtClip); |
| 283 const CFX_RectF& rtDevClip = m_pRenderDevice->GetClipRect(); | 283 const CFX_RectF& rtDevClip = m_pRenderDevice->GetClipRect(); |
| 284 rtClip.Intersect(rtDevClip); | 284 rtClip.Intersect(rtDevClip); |
| 285 hState = m_pRenderDevice->SaveState(); | 285 hState = m_pRenderDevice->SaveState(); |
| 286 return m_pRenderDevice->SetClipRect(rtClip); | 286 return m_pRenderDevice->SetClipRect(rtClip); |
| 287 } | 287 } |
| 288 void CFDE_RenderContext::RestoreClip(FDE_HDEVICESTATE hState) { | 288 void CFDE_RenderContext::RestoreClip(FDE_HDEVICESTATE hState) { |
| 289 m_pRenderDevice->RestoreState(hState); | 289 m_pRenderDevice->RestoreState(hState); |
| 290 } | 290 } |
| OLD | NEW |