summaryrefslogtreecommitdiff
path: root/xfa/fwl
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-08-14 17:23:25 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-15 13:42:32 +0000
commit73b492a5d775c05d8c186c8478d1003edfffd34c (patch)
tree0815bab5627ae27f5eb2f1a45b90bb9dc10b9e1c /xfa/fwl
parent5f0e64435c97755a7d309e80ea0a4dad83e76e73 (diff)
downloadpdfium-73b492a5d775c05d8c186c8478d1003edfffd34c.tar.xz
Remove CFDE_RenderDevice
This CL removes CFDE_RenderDevice. For most of the proxy'd calls we call the CFX_RenderDevice directly now. To set the clip rect an overload was added to accept a CFX_RectF and handle the casting to FX_RECT. The one needed method, DrawString, is move to a static on CFDE_TextOut. Change-Id: I95ea7e1fa1fd4702074b797c06423c9c9cb51db9 Reviewed-on: https://pdfium-review.googlesource.com/10951 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fwl')
-rw-r--r--xfa/fwl/cfwl_edit.cpp16
-rw-r--r--xfa/fwl/theme/cfwl_widgettp.cpp4
2 files changed, 10 insertions, 10 deletions
diff --git a/xfa/fwl/cfwl_edit.cpp b/xfa/fwl/cfwl_edit.cpp
index 042e076ab6..526275313f 100644
--- a/xfa/fwl/cfwl_edit.cpp
+++ b/xfa/fwl/cfwl_edit.cpp
@@ -13,7 +13,7 @@
#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
-#include "xfa/fde/cfde_renderdevice.h"
+#include "xfa/fde/cfde_textout.h"
#include "xfa/fde/cfde_txtedtengine.h"
#include "xfa/fde/cfde_txtedtpage.h"
#include "xfa/fde/cfde_txtedttextset.h"
@@ -606,14 +606,13 @@ void CFWL_Edit::RenderText(CFX_RenderDevice* pRenderDev,
if (!pFont)
return;
- CFDE_RenderDevice renderDevice(pRenderDev);
- renderDevice.SetClipRect(clipRect);
+ pRenderDev->SetClip_Rect(clipRect);
- CFX_RectF rtDocClip = renderDevice.GetClipRect();
+ CFX_RectF rtDocClip = clipRect;
if (rtDocClip.IsEmpty()) {
rtDocClip.left = rtDocClip.top = 0;
- rtDocClip.width = static_cast<float>(renderDevice.GetWidth());
- rtDocClip.height = static_cast<float>(renderDevice.GetHeight());
+ rtDocClip.width = static_cast<float>(pRenderDev->GetWidth());
+ rtDocClip.height = static_cast<float>(pRenderDev->GetHeight());
}
mt.GetInverse().TransformRect(rtDocClip);
@@ -631,8 +630,9 @@ void CFWL_Edit::RenderText(CFX_RenderDevice* pRenderDev,
char_pos.resize(iCount, FXTEXT_CHARPOS());
iCount = pTextSet->GetDisplayPos(pText, char_pos.data(), false);
- renderDevice.DrawString(pTextSet->GetFontColor(), pFont, char_pos.data(),
- iCount, pTextSet->GetFontSize(), &mt);
+ CFDE_TextOut::DrawString(pRenderDev, pTextSet->GetFontColor(), pFont,
+ char_pos.data(), iCount, pTextSet->GetFontSize(),
+ &mt);
}
}
diff --git a/xfa/fwl/theme/cfwl_widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp
index bf5fd42736..fe63780c39 100644
--- a/xfa/fwl/theme/cfwl_widgettp.cpp
+++ b/xfa/fwl/theme/cfwl_widgettp.cpp
@@ -46,14 +46,14 @@ void CFWL_WidgetTP::DrawText(CFWL_ThemeText* pParams) {
return;
CXFA_Graphics* pGraphics = pParams->m_pGraphics;
- m_pTextOut->SetRenderDevice(pGraphics->GetRenderDevice());
m_pTextOut->SetStyles(pParams->m_dwTTOStyles);
m_pTextOut->SetAlignment(pParams->m_iTTOAlign);
CFX_Matrix* pMatrix = &pParams->m_matrix;
pMatrix->Concat(*pGraphics->GetMatrix());
m_pTextOut->SetMatrix(*pMatrix);
- m_pTextOut->DrawLogicText(pParams->m_wsText.c_str(), iLen, pParams->m_rtPart);
+ m_pTextOut->DrawLogicText(pGraphics->GetRenderDevice(),
+ pParams->m_wsText.c_str(), iLen, pParams->m_rtPart);
}
void CFWL_WidgetTP::InitializeArrowColorData() {