diff options
author | dsinclair <dsinclair@chromium.org> | 2016-06-07 10:10:45 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-07 10:10:45 -0700 |
commit | 705f829624bfc53e316f750bf91a32c8ae3ad1b5 (patch) | |
tree | e5ec525491a494bc34f2a34bbace458d2b433331 /xfa/fde/fde_render.cpp | |
parent | 8975902470dbfc15289b69f41e43ad0433ca51ae (diff) | |
download | pdfium-705f829624bfc53e316f750bf91a32c8ae3ad1b5.tar.xz |
Remove FDE_HVISUALOBJ.
This CL removes the FDE_HVISUALOBJ in favour of the concrete FDE_TEXTEDITPIECE
class. The parameter was removed from any method which didn't use it and the
non-implemented methods were removed.
Review-Url: https://codereview.chromium.org/2047693002
Diffstat (limited to 'xfa/fde/fde_render.cpp')
-rw-r--r-- | xfa/fde/fde_render.cpp | 46 |
1 files changed, 12 insertions, 34 deletions
diff --git a/xfa/fde/fde_render.cpp b/xfa/fde/fde_render.cpp index 57ad5bff72..6e6d739cf9 100644 --- a/xfa/fde/fde_render.cpp +++ b/xfa/fde/fde_render.cpp @@ -62,23 +62,23 @@ FDE_RENDERSTATUS CFDE_RenderContext::DoRender(IFX_Pause* pPause) { } rm.TransformRect(rtDocClip); IFDE_VisualSet* pVisualSet; - FDE_HVISUALOBJ hVisualObj; + FDE_TEXTEDITPIECE* pPiece; CFX_RectF rtObj; int32_t iCount = 0; while (TRUE) { - hVisualObj = m_pIterator->GetNext(pVisualSet); - if (!hVisualObj || !pVisualSet) { + pPiece = m_pIterator->GetNext(pVisualSet); + if (!pPiece || !pVisualSet) { eStatus = FDE_RENDERSTATUS_Done; break; } rtObj.Empty(); - pVisualSet->GetRect(hVisualObj, rtObj); + pVisualSet->GetRect(pPiece, rtObj); if (!rtDocClip.IntersectWith(rtObj)) continue; switch (pVisualSet->GetType()) { case FDE_VISUALOBJ_Text: - RenderText((IFDE_TextSet*)pVisualSet, hVisualObj); + RenderText((IFDE_TextSet*)pVisualSet, pPiece); iCount += 5; break; case FDE_VISUALOBJ_Canvas: @@ -107,15 +107,15 @@ void CFDE_RenderContext::StopRender() { } void CFDE_RenderContext::RenderText(IFDE_TextSet* pTextSet, - FDE_HVISUALOBJ hText) { + FDE_TEXTEDITPIECE* pText) { ASSERT(m_pRenderDevice); - ASSERT(pTextSet && hText); + ASSERT(pTextSet && pText); - IFGAS_Font* pFont = pTextSet->GetFont(hText); + IFGAS_Font* pFont = pTextSet->GetFont(); if (!pFont) return; - int32_t iCount = pTextSet->GetDisplayPos(hText, nullptr, FALSE); + int32_t iCount = pTextSet->GetDisplayPos(pText, nullptr, FALSE); if (iCount < 1) return; @@ -130,33 +130,11 @@ void CFDE_RenderContext::RenderText(IFDE_TextSet* pTextSet, if (m_iCharPosCount < iCount) m_iCharPosCount = iCount; - iCount = pTextSet->GetDisplayPos(hText, m_pCharPos, FALSE); - FX_FLOAT fFontSize = pTextSet->GetFontSize(hText); - FX_ARGB dwColor = pTextSet->GetFontColor(hText); + iCount = pTextSet->GetDisplayPos(pText, m_pCharPos, FALSE); + FX_FLOAT fFontSize = pTextSet->GetFontSize(); + FX_ARGB dwColor = pTextSet->GetFontColor(); m_pBrush->SetColor(dwColor); - FX_BOOL bClip = ApplyClip(pTextSet, hText); m_pRenderDevice->DrawString(m_pBrush.get(), pFont, m_pCharPos, iCount, fFontSize, &m_Transform); - if (bClip) - RestoreClip(); } -FX_BOOL CFDE_RenderContext::ApplyClip(IFDE_VisualSet* pVisualSet, - FDE_HVISUALOBJ hObj) { - CFX_RectF rtClip; - if (!pVisualSet->GetClip(hObj, rtClip)) - return FALSE; - - CFX_RectF rtObj; - pVisualSet->GetRect(hObj, rtObj); - rtClip.Offset(rtObj.left, rtObj.top); - m_Transform.TransformRect(rtClip); - const CFX_RectF& rtDevClip = m_pRenderDevice->GetClipRect(); - rtClip.Intersect(rtDevClip); - m_pRenderDevice->SaveState(); - return m_pRenderDevice->SetClipRect(rtClip); -} - -void CFDE_RenderContext::RestoreClip() { - m_pRenderDevice->RestoreState(); -} |