diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-08-09 16:09:51 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-08-09 20:47:34 +0000 |
commit | 17aa0579f9ce11e5433b62ccb66c59b522b4f51e (patch) | |
tree | 39dce4b38c71a2442ef5dbeea2867af05fca8088 /xfa/fxfa | |
parent | b6db95b0d55869168ee13e2b8accb0d16dc7ad8b (diff) | |
download | pdfium-17aa0579f9ce11e5433b62ccb66c59b522b4f51e.tar.xz |
Remove CFDE_{Pen|Brush} classes
These classes just hold a color value. Instead of creating the class to
pass the color we just pass the colors.
Change-Id: I7f65ca4100bfbdcb02171c1e7e46150508e338f4
Reviewed-on: https://pdfium-review.googlesource.com/10451
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa')
-rw-r--r-- | xfa/fxfa/cxfa_textlayout.cpp | 18 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_textlayout.h | 4 |
2 files changed, 4 insertions, 18 deletions
diff --git a/xfa/fxfa/cxfa_textlayout.cpp b/xfa/fxfa/cxfa_textlayout.cpp index 125c73a11d..05cc165d52 100644 --- a/xfa/fxfa/cxfa_textlayout.cpp +++ b/xfa/fxfa/cxfa_textlayout.cpp @@ -16,9 +16,7 @@ #include "core/fxcrt/xml/cfx_xmltext.h" #include "third_party/base/ptr_util.h" #include "third_party/base/stl_util.h" -#include "xfa/fde/cfde_brush.h" #include "xfa/fde/cfde_path.h" -#include "xfa/fde/cfde_pen.h" #include "xfa/fde/cfde_renderdevice.h" #include "xfa/fxfa/cxfa_linkuserdata.h" #include "xfa/fxfa/cxfa_loadercontext.h" @@ -563,8 +561,6 @@ bool CXFA_TextLayout::DrawString(CFX_RenderDevice* pFxDevice, pDevice->SaveState(); pDevice->SetClipRect(rtClip); - auto pSolidBrush = pdfium::MakeUnique<CFDE_Brush>(); - auto pPen = pdfium::MakeUnique<CFDE_Pen>(); if (m_pieceLines.empty()) { int32_t iBlockCount = CountBlocks(); for (int32_t i = 0; i < iBlockCount; i++) @@ -602,12 +598,10 @@ bool CXFA_TextLayout::DrawString(CFX_RenderDevice* pFxDevice, iCharCount = iChars; } memset(pCharPos, 0, iCharCount * sizeof(FXTEXT_CHARPOS)); - RenderString(pDevice.get(), pSolidBrush.get(), pPieceLine, j, pCharPos, - tmDoc2Device); + RenderString(pDevice.get(), pPieceLine, j, pCharPos, tmDoc2Device); } for (j = 0; j < iPieces; j++) { - RenderPath(pDevice.get(), pPen.get(), pPieceLine, j, pCharPos, - tmDoc2Device); + RenderPath(pDevice.get(), pPieceLine, j, pCharPos, tmDoc2Device); } } pDevice->RestoreState(); @@ -1144,7 +1138,6 @@ void CXFA_TextLayout::AppendTextLine(CFX_BreakType dwStatus, } void CXFA_TextLayout::RenderString(CFDE_RenderDevice* pDevice, - CFDE_Brush* pBrush, CXFA_PieceLine* pPieceLine, int32_t iPiece, FXTEXT_CHARPOS* pCharPos, @@ -1152,15 +1145,13 @@ void CXFA_TextLayout::RenderString(CFDE_RenderDevice* pDevice, const CXFA_TextPiece* pPiece = pPieceLine->m_textPieces[iPiece].get(); int32_t iCount = GetDisplayPos(pPiece, pCharPos); if (iCount > 0) { - pBrush->SetColor(pPiece->dwColor); - pDevice->DrawString(pBrush, pPiece->pFont, pCharPos, iCount, + pDevice->DrawString(pPiece->dwColor, pPiece->pFont, pCharPos, iCount, pPiece->fFontSize, &tmDoc2Device); } pPieceLine->m_charCounts.push_back(iCount); } void CXFA_TextLayout::RenderPath(CFDE_RenderDevice* pDevice, - CFDE_Pen* pPen, CXFA_PieceLine* pPieceLine, int32_t iPiece, FXTEXT_CHARPOS* pCharPos, @@ -1171,7 +1162,6 @@ void CXFA_TextLayout::RenderPath(CFDE_RenderDevice* pDevice, if (bNoUnderline && bNoLineThrough) return; - pPen->SetColor(pPiece->dwColor); auto pPath = pdfium::MakeUnique<CFDE_Path>(); int32_t iChars = GetDisplayPos(pPiece, pCharPos); if (iChars > 0) { @@ -1270,7 +1260,7 @@ void CXFA_TextLayout::RenderPath(CFDE_RenderDevice* pDevice, fEndY += 2.0f; } } - pDevice->DrawPath(pPen, 1, pPath.get(), &tmDoc2Device); + pDevice->DrawPath(pPiece->dwColor, 1, pPath.get(), &tmDoc2Device); } int32_t CXFA_TextLayout::GetDisplayPos(const CXFA_TextPiece* pPiece, diff --git a/xfa/fxfa/cxfa_textlayout.h b/xfa/fxfa/cxfa_textlayout.h index 642fa25dd9..d2ff0d21ea 100644 --- a/xfa/fxfa/cxfa_textlayout.h +++ b/xfa/fxfa/cxfa_textlayout.h @@ -17,9 +17,7 @@ #include "xfa/fgas/layout/cfx_rtfbreak.h" #include "xfa/fxfa/cxfa_textparser.h" -class CFDE_Brush; class CFX_CSSComputedStyle; -class CFDE_Pen; class CFDE_RenderDevice; class CFX_XMLNode; class CFX_RTFBreak; @@ -101,13 +99,11 @@ class CXFA_TextLayout { void ProcessText(CFX_WideString& wsText); void UpdateAlign(float fHeight, float fBottom); void RenderString(CFDE_RenderDevice* pDevice, - CFDE_Brush* pBrush, CXFA_PieceLine* pPieceLine, int32_t iPiece, FXTEXT_CHARPOS* pCharPos, const CFX_Matrix& tmDoc2Device); void RenderPath(CFDE_RenderDevice* pDevice, - CFDE_Pen* pPen, CXFA_PieceLine* pPieceLine, int32_t iPiece, FXTEXT_CHARPOS* pCharPos, |