summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_page/cpdf_allstates.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-09-02 16:53:09 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-02 16:53:09 -0700
commite106b50129d5b8ce50228c67d3b0170bc46c4b2e (patch)
treeaea946d9a1f489e90abf132b73579dc83aae685e /core/fpdfapi/fpdf_page/cpdf_allstates.cpp
parentfc1d16f76f173b8437edc93dde8f9f82abb51298 (diff)
downloadpdfium-e106b50129d5b8ce50228c67d3b0170bc46c4b2e.tar.xz
Make CPDF_GeneralStateData private.
All interaction goes through the CPDF_GeneralState, which manages the underlying storage transparently to the callers. Make StateData use a real string and a real matrix rather than C-style arrays. Review-Url: https://codereview.chromium.org/2302683002
Diffstat (limited to 'core/fpdfapi/fpdf_page/cpdf_allstates.cpp')
-rw-r--r--core/fpdfapi/fpdf_page/cpdf_allstates.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/core/fpdfapi/fpdf_page/cpdf_allstates.cpp b/core/fpdfapi/fpdf_page/cpdf_allstates.cpp
index 89c13215ae..b92f10b095 100644
--- a/core/fpdfapi/fpdf_page/cpdf_allstates.cpp
+++ b/core/fpdfapi/fpdf_page/cpdf_allstates.cpp
@@ -106,10 +106,8 @@ void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS,
break;
case FXBSTR_ID('B', 'M', 0, 0): {
CPDF_Array* pArray = pObject->AsArray();
- CFX_ByteString mode =
- pArray ? pArray->GetStringAt(0) : pObject->GetString();
-
- m_GeneralState.SetBlendMode(mode.AsStringC());
+ m_GeneralState.SetBlendMode(pArray ? pArray->GetStringAt(0)
+ : pObject->GetString());
if (m_GeneralState.GetBlendType() > FXDIB_BLEND_MULTIPLY)
pParser->GetPageObjectHolder()->SetBackgroundAlphaNeeded(TRUE);
break;
@@ -117,8 +115,7 @@ void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS,
case FXBSTR_ID('S', 'M', 'a', 's'):
if (ToDictionary(pObject)) {
m_GeneralState.SetSoftMask(pObject);
- FXSYS_memcpy(m_GeneralState.GetMutableSMaskMatrix(),
- &pParser->GetCurStates()->m_CTM, sizeof(CFX_Matrix));
+ m_GeneralState.SetSMaskMatrix(pParser->GetCurStates()->m_CTM);
} else {
m_GeneralState.SetSoftMask(nullptr);
}