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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 } | 99 } |
100 case FXBSTR_ID('T', 'R', 0, 0): | 100 case FXBSTR_ID('T', 'R', 0, 0): |
101 if (pGS->KeyExist("TR2")) { | 101 if (pGS->KeyExist("TR2")) { |
102 continue; | 102 continue; |
103 } | 103 } |
104 case FXBSTR_ID('T', 'R', '2', 0): | 104 case FXBSTR_ID('T', 'R', '2', 0): |
105 m_GeneralState.SetTR(pObject && !pObject->IsName() ? pObject : nullptr); | 105 m_GeneralState.SetTR(pObject && !pObject->IsName() ? pObject : nullptr); |
106 break; | 106 break; |
107 case FXBSTR_ID('B', 'M', 0, 0): { | 107 case FXBSTR_ID('B', 'M', 0, 0): { |
108 CPDF_Array* pArray = pObject->AsArray(); | 108 CPDF_Array* pArray = pObject->AsArray(); |
109 CFX_ByteString mode = | 109 m_GeneralState.SetBlendMode(pArray ? pArray->GetStringAt(0) |
110 pArray ? pArray->GetStringAt(0) : pObject->GetString(); | 110 : pObject->GetString()); |
111 | |
112 m_GeneralState.SetBlendMode(mode.AsStringC()); | |
113 if (m_GeneralState.GetBlendType() > FXDIB_BLEND_MULTIPLY) | 111 if (m_GeneralState.GetBlendType() > FXDIB_BLEND_MULTIPLY) |
114 pParser->GetPageObjectHolder()->SetBackgroundAlphaNeeded(TRUE); | 112 pParser->GetPageObjectHolder()->SetBackgroundAlphaNeeded(TRUE); |
115 break; | 113 break; |
116 } | 114 } |
117 case FXBSTR_ID('S', 'M', 'a', 's'): | 115 case FXBSTR_ID('S', 'M', 'a', 's'): |
118 if (ToDictionary(pObject)) { | 116 if (ToDictionary(pObject)) { |
119 m_GeneralState.SetSoftMask(pObject); | 117 m_GeneralState.SetSoftMask(pObject); |
120 FXSYS_memcpy(m_GeneralState.GetMutableSMaskMatrix(), | 118 m_GeneralState.SetSMaskMatrix(pParser->GetCurStates()->m_CTM); |
121 &pParser->GetCurStates()->m_CTM, sizeof(CFX_Matrix)); | |
122 } else { | 119 } else { |
123 m_GeneralState.SetSoftMask(nullptr); | 120 m_GeneralState.SetSoftMask(nullptr); |
124 } | 121 } |
125 break; | 122 break; |
126 case FXBSTR_ID('C', 'A', 0, 0): | 123 case FXBSTR_ID('C', 'A', 0, 0): |
127 m_GeneralState.SetStrokeAlpha(ClipFloat(pObject->GetNumber())); | 124 m_GeneralState.SetStrokeAlpha(ClipFloat(pObject->GetNumber())); |
128 break; | 125 break; |
129 case FXBSTR_ID('c', 'a', 0, 0): | 126 case FXBSTR_ID('c', 'a', 0, 0): |
130 m_GeneralState.SetFillAlpha(ClipFloat(pObject->GetNumber())); | 127 m_GeneralState.SetFillAlpha(ClipFloat(pObject->GetNumber())); |
131 break; | 128 break; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 case FXBSTR_ID('A', 'I', 'S', 0): | 166 case FXBSTR_ID('A', 'I', 'S', 0): |
170 m_GeneralState.SetAlphaSource(!!pObject->GetInteger()); | 167 m_GeneralState.SetAlphaSource(!!pObject->GetInteger()); |
171 break; | 168 break; |
172 case FXBSTR_ID('T', 'K', 0, 0): | 169 case FXBSTR_ID('T', 'K', 0, 0): |
173 m_GeneralState.SetTextKnockout(!!pObject->GetInteger()); | 170 m_GeneralState.SetTextKnockout(!!pObject->GetInteger()); |
174 break; | 171 break; |
175 } | 172 } |
176 } | 173 } |
177 m_GeneralState.SetMatrix(m_CTM); | 174 m_GeneralState.SetMatrix(m_CTM); |
178 } | 175 } |
OLD | NEW |