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/fxfa/include/xfa_ffwidget.h" | 7 #include "xfa/fxfa/include/xfa_ffwidget.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
11 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h" | 11 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h" |
| 12 #include "core/fxcodec/codec/include/ccodec_progressivedecoder.h" |
12 #include "core/fxcodec/include/fx_codec.h" | 13 #include "core/fxcodec/include/fx_codec.h" |
13 #include "xfa/fxfa/app/xfa_textlayout.h" | 14 #include "xfa/fxfa/app/xfa_textlayout.h" |
14 #include "xfa/fxfa/include/xfa_ffapp.h" | 15 #include "xfa/fxfa/include/xfa_ffapp.h" |
15 #include "xfa/fxfa/include/xfa_ffdoc.h" | 16 #include "xfa/fxfa/include/xfa_ffdoc.h" |
16 #include "xfa/fxfa/include/xfa_ffdocview.h" | 17 #include "xfa/fxfa/include/xfa_ffdocview.h" |
17 #include "xfa/fxfa/include/xfa_ffpageview.h" | 18 #include "xfa/fxfa/include/xfa_ffpageview.h" |
18 #include "xfa/fxfa/parser/cxfa_corner.h" | 19 #include "xfa/fxfa/parser/cxfa_corner.h" |
19 #include "xfa/fxgraphics/cfx_color.h" | 20 #include "xfa/fxgraphics/cfx_color.h" |
20 #include "xfa/fxgraphics/cfx_path.h" | 21 #include "xfa/fxgraphics/cfx_path.h" |
21 #include "xfa/fxgraphics/cfx_pattern.h" | 22 #include "xfa/fxgraphics/cfx_pattern.h" |
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 CFX_GEModule* pGeModule = CFX_GEModule::Get(); | 1051 CFX_GEModule* pGeModule = CFX_GEModule::Get(); |
1051 if (!pGeModule) { | 1052 if (!pGeModule) { |
1052 return NULL; | 1053 return NULL; |
1053 } | 1054 } |
1054 CCodec_ModuleMgr* pCodecMgr = pGeModule->GetCodecModule(); | 1055 CCodec_ModuleMgr* pCodecMgr = pGeModule->GetCodecModule(); |
1055 if (!pCodecMgr) { | 1056 if (!pCodecMgr) { |
1056 return NULL; | 1057 return NULL; |
1057 } | 1058 } |
1058 CFX_DIBAttribute dibAttr; | 1059 CFX_DIBAttribute dibAttr; |
1059 CFX_DIBitmap* pBitmap = NULL; | 1060 CFX_DIBitmap* pBitmap = NULL; |
1060 ICodec_ProgressiveDecoder* pProgressiveDecoder = | 1061 CCodec_ProgressiveDecoder* pProgressiveDecoder = |
1061 pCodecMgr->CreateProgressiveDecoder(); | 1062 pCodecMgr->CreateProgressiveDecoder(); |
1062 pProgressiveDecoder->LoadImageInfo(pImageFileRead, type, &dibAttr); | 1063 pProgressiveDecoder->LoadImageInfo(pImageFileRead, type, &dibAttr); |
1063 switch (dibAttr.m_wDPIUnit) { | 1064 switch (dibAttr.m_wDPIUnit) { |
1064 case FXCODEC_RESUNIT_CENTIMETER: | 1065 case FXCODEC_RESUNIT_CENTIMETER: |
1065 dibAttr.m_nXDPI = (int32_t)(dibAttr.m_nXDPI * 2.54f); | 1066 dibAttr.m_nXDPI = (int32_t)(dibAttr.m_nXDPI * 2.54f); |
1066 dibAttr.m_nYDPI = (int32_t)(dibAttr.m_nYDPI * 2.54f); | 1067 dibAttr.m_nYDPI = (int32_t)(dibAttr.m_nYDPI * 2.54f); |
1067 break; | 1068 break; |
1068 case FXCODEC_RESUNIT_METER: | 1069 case FXCODEC_RESUNIT_METER: |
1069 dibAttr.m_nXDPI = (int32_t)(dibAttr.m_nXDPI / (FX_FLOAT)100 * 2.54f); | 1070 dibAttr.m_nXDPI = (int32_t)(dibAttr.m_nXDPI / (FX_FLOAT)100 * 2.54f); |
1070 dibAttr.m_nYDPI = (int32_t)(dibAttr.m_nYDPI / (FX_FLOAT)100 * 2.54f); | 1071 dibAttr.m_nYDPI = (int32_t)(dibAttr.m_nYDPI / (FX_FLOAT)100 * 2.54f); |
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1957 iType != XFA_ELEMENT_Rectangle) { | 1958 iType != XFA_ELEMENT_Rectangle) { |
1958 return; | 1959 return; |
1959 } | 1960 } |
1960 CXFA_StrokeArray strokes; | 1961 CXFA_StrokeArray strokes; |
1961 if (!(dwFlags & XFA_DRAWBOX_ForceRound) && iType != XFA_ELEMENT_Arc) { | 1962 if (!(dwFlags & XFA_DRAWBOX_ForceRound) && iType != XFA_ELEMENT_Arc) { |
1962 box.GetStrokes(strokes); | 1963 box.GetStrokes(strokes); |
1963 } | 1964 } |
1964 XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags); | 1965 XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags); |
1965 XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags); | 1966 XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags); |
1966 } | 1967 } |
OLD | NEW |