OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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/fpdfapi/fpdf_page/cpdf_allstates.h" | 7 #include "core/fpdfapi/fpdf_page/cpdf_allstates.h" |
8 | 8 |
9 #include "core/fpdfapi/fpdf_page/pageint.h" | 9 #include "core/fpdfapi/fpdf_page/pageint.h" |
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 m_TextRise = src.m_TextRise; | 40 m_TextRise = src.m_TextRise; |
41 m_TextHorzScale = src.m_TextHorzScale; | 41 m_TextHorzScale = src.m_TextHorzScale; |
42 } | 42 } |
43 | 43 |
44 void CPDF_AllStates::SetLineDash(CPDF_Array* pArray, | 44 void CPDF_AllStates::SetLineDash(CPDF_Array* pArray, |
45 FX_FLOAT phase, | 45 FX_FLOAT phase, |
46 FX_FLOAT scale) { | 46 FX_FLOAT scale) { |
47 CFX_GraphStateData* pData = m_GraphState.GetModify(); | 47 CFX_GraphStateData* pData = m_GraphState.GetModify(); |
48 pData->m_DashPhase = phase * scale; | 48 pData->m_DashPhase = phase * scale; |
49 pData->SetDashCount(pArray->GetCount()); | 49 pData->SetDashCount(pArray->GetCount()); |
50 for (FX_DWORD i = 0; i < pArray->GetCount(); i++) { | 50 for (uint32_t i = 0; i < pArray->GetCount(); i++) { |
51 pData->m_DashArray[i] = pArray->GetNumberAt(i) * scale; | 51 pData->m_DashArray[i] = pArray->GetNumberAt(i) * scale; |
52 } | 52 } |
53 } | 53 } |
54 | 54 |
55 void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS, | 55 void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS, |
56 CPDF_StreamContentParser* pParser) { | 56 CPDF_StreamContentParser* pParser) { |
57 CPDF_GeneralStateData* pGeneralState = m_GeneralState.GetModify(); | 57 CPDF_GeneralStateData* pGeneralState = m_GeneralState.GetModify(); |
58 for (const auto& it : *pGS) { | 58 for (const auto& it : *pGS) { |
59 const CFX_ByteString& key_str = it.first; | 59 const CFX_ByteString& key_str = it.first; |
60 CPDF_Object* pElement = it.second; | 60 CPDF_Object* pElement = it.second; |
61 CPDF_Object* pObject = pElement ? pElement->GetDirect() : nullptr; | 61 CPDF_Object* pObject = pElement ? pElement->GetDirect() : nullptr; |
62 if (!pObject) | 62 if (!pObject) |
63 continue; | 63 continue; |
64 | 64 |
65 FX_DWORD key = key_str.GetID(); | 65 uint32_t key = key_str.GetID(); |
66 switch (key) { | 66 switch (key) { |
67 case FXBSTR_ID('L', 'W', 0, 0): | 67 case FXBSTR_ID('L', 'W', 0, 0): |
68 m_GraphState.GetModify()->m_LineWidth = pObject->GetNumber(); | 68 m_GraphState.GetModify()->m_LineWidth = pObject->GetNumber(); |
69 break; | 69 break; |
70 case FXBSTR_ID('L', 'C', 0, 0): | 70 case FXBSTR_ID('L', 'C', 0, 0): |
71 m_GraphState.GetModify()->m_LineCap = | 71 m_GraphState.GetModify()->m_LineCap = |
72 (CFX_GraphStateData::LineCap)pObject->GetInteger(); | 72 (CFX_GraphStateData::LineCap)pObject->GetInteger(); |
73 break; | 73 break; |
74 case FXBSTR_ID('L', 'J', 0, 0): | 74 case FXBSTR_ID('L', 'J', 0, 0): |
75 m_GraphState.GetModify()->m_LineJoin = | 75 m_GraphState.GetModify()->m_LineJoin = |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 case FXBSTR_ID('A', 'I', 'S', 0): | 177 case FXBSTR_ID('A', 'I', 'S', 0): |
178 pGeneralState->m_AlphaSource = pObject->GetInteger(); | 178 pGeneralState->m_AlphaSource = pObject->GetInteger(); |
179 break; | 179 break; |
180 case FXBSTR_ID('T', 'K', 0, 0): | 180 case FXBSTR_ID('T', 'K', 0, 0): |
181 pGeneralState->m_TextKnockout = pObject->GetInteger(); | 181 pGeneralState->m_TextKnockout = pObject->GetInteger(); |
182 break; | 182 break; |
183 } | 183 } |
184 } | 184 } |
185 pGeneralState->m_Matrix = m_CTM; | 185 pGeneralState->m_Matrix = m_CTM; |
186 } | 186 } |
OLD | NEW |