| 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 "core/include/fxge/fx_ge.h" | 7 #include "core/include/fxge/fx_ge.h" |
| 8 | 8 |
| 9 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ | 9 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 } | 966 } |
| 967 static GpPen* _GdipCreatePen(const CFX_GraphStateData* pGraphState, | 967 static GpPen* _GdipCreatePen(const CFX_GraphStateData* pGraphState, |
| 968 const CFX_Matrix* pMatrix, | 968 const CFX_Matrix* pMatrix, |
| 969 DWORD argb, | 969 DWORD argb, |
| 970 FX_BOOL bTextMode = FALSE) { | 970 FX_BOOL bTextMode = FALSE) { |
| 971 CGdiplusExt& GdiplusExt = | 971 CGdiplusExt& GdiplusExt = |
| 972 ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt; | 972 ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt; |
| 973 FX_FLOAT width = pGraphState ? pGraphState->m_LineWidth : 1.0f; | 973 FX_FLOAT width = pGraphState ? pGraphState->m_LineWidth : 1.0f; |
| 974 if (!bTextMode) { | 974 if (!bTextMode) { |
| 975 FX_FLOAT unit = | 975 FX_FLOAT unit = |
| 976 pMatrix | 976 pMatrix ? 1.0f / ((pMatrix->GetXUnit() + pMatrix->GetYUnit()) / 2) |
| 977 ? FXSYS_Div(1.0f, (pMatrix->GetXUnit() + pMatrix->GetYUnit()) / 2) | 977 : 1.0f; |
| 978 : 1.0f; | |
| 979 if (width < unit) { | 978 if (width < unit) { |
| 980 width = unit; | 979 width = unit; |
| 981 } | 980 } |
| 982 } | 981 } |
| 983 GpPen* pPen = NULL; | 982 GpPen* pPen = NULL; |
| 984 CallFunc(GdipCreatePen1)((ARGB)argb, width, UnitWorld, &pPen); | 983 CallFunc(GdipCreatePen1)((ARGB)argb, width, UnitWorld, &pPen); |
| 985 LineCap lineCap; | 984 LineCap lineCap; |
| 986 DashCap dashCap = DashCapFlat; | 985 DashCap dashCap = DashCapFlat; |
| 987 FX_BOOL bDashExtend = FALSE; | 986 FX_BOOL bDashExtend = FALSE; |
| 988 switch (pGraphState->m_LineCap) { | 987 switch (pGraphState->m_LineCap) { |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1507 dest_pitch); | 1506 dest_pitch); |
| 1508 } | 1507 } |
| 1509 } | 1508 } |
| 1510 CFX_DIBitmap* pDIBitmap = _FX_WindowsDIB_LoadFromBuf( | 1509 CFX_DIBitmap* pDIBitmap = _FX_WindowsDIB_LoadFromBuf( |
| 1511 pInfo->pbmi, pData, pInfo->pbmi->bmiHeader.biBitCount == 32); | 1510 pInfo->pbmi, pData, pInfo->pbmi->bmiHeader.biBitCount == 32); |
| 1512 FX_Free(pData); | 1511 FX_Free(pData); |
| 1513 FreeDIBitmap(pInfo); | 1512 FreeDIBitmap(pInfo); |
| 1514 return pDIBitmap; | 1513 return pDIBitmap; |
| 1515 } | 1514 } |
| 1516 #endif | 1515 #endif |
| OLD | NEW |