summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_render
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-08-26 16:52:33 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-26 16:52:33 -0700
commitc10c23a2b1999b1cb0354fd4db9837dc63a3d833 (patch)
tree2f5b9f35d372de26476411295120146baa93f5fb /core/fpdfapi/fpdf_render
parent9ed91376d562f3c6e7ca0a99035a74502f648776 (diff)
downloadpdfium-c10c23a2b1999b1cb0354fd4db9837dc63a3d833.tar.xz
Add -> operators to CFX_CountRef.chromium/2842
Allows CFX_CountRefs to behave more like pointers. Rename SetNull() to Clear() for consistency with other ptrs. Change GetPrivateCopy() into MakePrivateCopy() with no return, since the -> operators are clearer than getting an object pointer. Review-Url: https://codereview.chromium.org/2283113002
Diffstat (limited to 'core/fpdfapi/fpdf_render')
-rw-r--r--core/fpdfapi/fpdf_render/fpdf_render.cpp28
-rw-r--r--core/fpdfapi/fpdf_render/fpdf_render_text.cpp5
2 files changed, 16 insertions, 17 deletions
diff --git a/core/fpdfapi/fpdf_render/fpdf_render.cpp b/core/fpdfapi/fpdf_render/fpdf_render.cpp
index f77e46d923..f5ab9696c7 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render.cpp
@@ -199,16 +199,16 @@ FX_BOOL CPDF_RenderStatus::Initialize(CPDF_RenderContext* pContext,
const CPDF_ColorStateData* pParentData =
pParentState->m_InitialStates.m_ColorState.GetObject();
if (!pColorData || pColorData->m_FillColor.IsNull()) {
- CPDF_ColorStateData* pData =
- m_InitialStates.m_ColorState.GetPrivateCopy();
- pData->m_FillRGB = pParentData->m_FillRGB;
- pData->m_FillColor.Copy(&pParentData->m_FillColor);
+ m_InitialStates.m_ColorState.MakePrivateCopy();
+ m_InitialStates.m_ColorState->m_FillRGB = pParentData->m_FillRGB;
+ m_InitialStates.m_ColorState->m_FillColor.Copy(
+ &pParentData->m_FillColor);
}
if (!pColorData || pColorData->m_StrokeColor.IsNull()) {
- CPDF_ColorStateData* pData =
- m_InitialStates.m_ColorState.GetPrivateCopy();
- pData->m_StrokeRGB = pParentData->m_FillRGB;
- pData->m_StrokeColor.Copy(&pParentData->m_StrokeColor);
+ m_InitialStates.m_ColorState.MakePrivateCopy();
+ m_InitialStates.m_ColorState->m_StrokeRGB = pParentData->m_FillRGB;
+ m_InitialStates.m_ColorState->m_StrokeColor.Copy(
+ &pParentData->m_StrokeColor);
}
}
} else {
@@ -579,7 +579,7 @@ void CPDF_RenderStatus::ProcessClipPath(CPDF_ClipPath ClipPath,
if (!ClipPath) {
if (m_LastClipPath) {
m_pDevice->RestoreState(true);
- m_LastClipPath.SetNull();
+ m_LastClipPath.Clear();
}
return;
}
@@ -921,11 +921,11 @@ CPDF_GraphicStates* CPDF_RenderStatus::CloneObjStates(
? pSrcStates->m_ColorState.GetStrokeColor()
: pSrcStates->m_ColorState.GetFillColor();
if (!pObjColor->IsNull()) {
- CPDF_ColorStateData* pColorData = pStates->m_ColorState.GetPrivateCopy();
- pColorData->m_FillRGB =
- bStroke ? pSrcStates->m_ColorState.GetObject()->m_StrokeRGB
- : pSrcStates->m_ColorState.GetObject()->m_FillRGB;
- pColorData->m_StrokeRGB = pColorData->m_FillRGB;
+ pStates->m_ColorState.MakePrivateCopy();
+ pStates->m_ColorState->m_FillRGB =
+ bStroke ? pSrcStates->m_ColorState->m_StrokeRGB
+ : pSrcStates->m_ColorState->m_FillRGB;
+ pStates->m_ColorState->m_StrokeRGB = pStates->m_ColorState->m_FillRGB;
}
return pStates;
}
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
index 16d1235f4d..4b59f1d61a 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
@@ -231,8 +231,7 @@ FX_BOOL CPDF_RenderStatus::ProcessText(const CPDF_TextObject* textobj,
if (textobj->m_nChars == 0)
return TRUE;
- const TextRenderingMode& text_render_mode =
- textobj->m_TextState.GetObject()->m_TextMode;
+ const TextRenderingMode& text_render_mode = textobj->m_TextState->m_TextMode;
if (text_render_mode == TextRenderingMode::MODE_INVISIBLE)
return TRUE;
@@ -308,7 +307,7 @@ FX_BOOL CPDF_RenderStatus::ProcessText(const CPDF_TextObject* textobj,
const CFX_Matrix* pDeviceMatrix = pObj2Device;
CFX_Matrix device_matrix;
if (bStroke) {
- const FX_FLOAT* pCTM = textobj->m_TextState.GetObject()->m_CTM;
+ const FX_FLOAT* pCTM = textobj->m_TextState->m_CTM;
if (pCTM[0] != 1.0f || pCTM[3] != 1.0f) {
CFX_Matrix ctm(pCTM[0], pCTM[1], pCTM[2], pCTM[3], 0, 0);
text_matrix.ConcatInverse(ctm);