summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_textlayout.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-08-09 16:09:51 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-09 20:47:34 +0000
commit17aa0579f9ce11e5433b62ccb66c59b522b4f51e (patch)
tree39dce4b38c71a2442ef5dbeea2867af05fca8088 /xfa/fxfa/cxfa_textlayout.cpp
parentb6db95b0d55869168ee13e2b8accb0d16dc7ad8b (diff)
downloadpdfium-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/cxfa_textlayout.cpp')
-rw-r--r--xfa/fxfa/cxfa_textlayout.cpp18
1 files changed, 4 insertions, 14 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,