diff options
author | tsepez <tsepez@chromium.org> | 2016-08-26 16:52:33 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-26 16:52:33 -0700 |
commit | c10c23a2b1999b1cb0354fd4db9837dc63a3d833 (patch) | |
tree | 2f5b9f35d372de26476411295120146baa93f5fb /core/fpdfapi/fpdf_render/fpdf_render.cpp | |
parent | 9ed91376d562f3c6e7ca0a99035a74502f648776 (diff) | |
download | pdfium-chromium/2842.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/fpdf_render.cpp')
-rw-r--r-- | core/fpdfapi/fpdf_render/fpdf_render.cpp | 28 |
1 files changed, 14 insertions, 14 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; } |