Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: core/fpdfapi/fpdf_page/cpdf_allstates.cpp

Issue 2292363002: Make CPDF_GraphState have a CPDF_GraphStateData instead of inheriting (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase, nits Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « BUILD.gn ('k') | core/fpdfapi/fpdf_page/cpdf_graphstate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_page/cpdf_allstates.cpp
diff --git a/core/fpdfapi/fpdf_page/cpdf_allstates.cpp b/core/fpdfapi/fpdf_page/cpdf_allstates.cpp
index e01b379bedf8b76a18ede7186b1dcae622b22fb6..acecafd01ebe764a9c8a978bc9438985a0e7c934 100644
--- a/core/fpdfapi/fpdf_page/cpdf_allstates.cpp
+++ b/core/fpdfapi/fpdf_page/cpdf_allstates.cpp
@@ -45,11 +45,7 @@ void CPDF_AllStates::Copy(const CPDF_AllStates& src) {
void CPDF_AllStates::SetLineDash(CPDF_Array* pArray,
FX_FLOAT phase,
FX_FLOAT scale) {
- CFX_GraphStateData* pData = m_GraphState.GetPrivateCopy();
- pData->m_DashPhase = phase * scale;
- pData->SetDashCount(static_cast<int>(pArray->GetCount()));
- for (size_t i = 0; i < pArray->GetCount(); i++)
- pData->m_DashArray[i] = pArray->GetNumberAt(i) * scale;
+ m_GraphState.SetLineDash(pArray, phase, scale);
}
void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS,
@@ -65,18 +61,18 @@ void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS,
uint32_t key = key_str.GetID();
switch (key) {
case FXBSTR_ID('L', 'W', 0, 0):
- m_GraphState.GetPrivateCopy()->m_LineWidth = pObject->GetNumber();
+ m_GraphState.SetLineWidth(pObject->GetNumber());
break;
case FXBSTR_ID('L', 'C', 0, 0):
- m_GraphState.GetPrivateCopy()->m_LineCap =
- (CFX_GraphStateData::LineCap)pObject->GetInteger();
+ m_GraphState.SetLineCap(
+ static_cast<CFX_GraphStateData::LineCap>(pObject->GetInteger()));
break;
case FXBSTR_ID('L', 'J', 0, 0):
- m_GraphState.GetPrivateCopy()->m_LineJoin =
- (CFX_GraphStateData::LineJoin)pObject->GetInteger();
+ m_GraphState.SetLineJoin(
+ static_cast<CFX_GraphStateData::LineJoin>(pObject->GetInteger()));
break;
case FXBSTR_ID('M', 'L', 0, 0):
- m_GraphState.GetPrivateCopy()->m_MiterLimit = pObject->GetNumber();
+ m_GraphState.SetMiterLimit(pObject->GetNumber());
break;
case FXBSTR_ID('D', 0, 0, 0): {
CPDF_Array* pDash = pObject->AsArray();
« no previous file with comments | « BUILD.gn ('k') | core/fpdfapi/fpdf_page/cpdf_graphstate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698