summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-09 10:16:07 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-09 16:38:46 +0000
commit118a8e28783f42e089721eac4880f3b3f683e832 (patch)
tree879d6fb7b0442feff533c265fef3a48c71a4b91e /core/fpdfapi/render
parent21e954b59fcef1b84fdcdb9ae337e2d4c060b19e (diff)
downloadpdfium-118a8e28783f42e089721eac4880f3b3f683e832.tar.xz
Replace rect.Transform(matrix) with matrix.TransformRect(rect)
This Cl removes the rect based transform method which internally just called the matrix tranform method. The callers have been reversed to make it clearer the matrix is transforming the rect. Change-Id: I8ef57ccc2311e4e853b8180a6ff475f8eda2138e Reviewed-on: https://pdfium-review.googlesource.com/2572 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fpdfapi/render')
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index 1bdf4a0382..07987d616e 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -1860,7 +1860,8 @@ bool CPDF_RenderStatus::ProcessType3Text(CPDF_TextObject* textobj,
m_pDevice->RestoreState(false);
} else {
CFX_FloatRect rect_f = pType3Char->m_pForm->CalcBoundingBox();
- rect_f.Transform(&matrix);
+ matrix.TransformRect(rect_f);
+
FX_RECT rect = rect_f.GetOuterRect();
CFX_FxgeDevice bitmap_device;
if (!bitmap_device.Create((int)(rect.Width() * sa),
@@ -2038,7 +2039,7 @@ void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern,
}
if (pDict->KeyExist("BBox")) {
CFX_FloatRect rect = pDict->GetRectFor("BBox");
- rect.Transform(pMatrix);
+ pMatrix->TransformRect(rect);
clip_rect.Intersect(rect.GetOuterRect());
}
if (m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_SHADING &&
@@ -2204,8 +2205,9 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern,
int min_col, max_col, min_row, max_row;
CFX_Matrix mtDevice2Pattern;
mtDevice2Pattern.SetReverse(mtPattern2Device);
+
CFX_FloatRect clip_box_p(clip_box);
- clip_box_p.Transform(&mtDevice2Pattern);
+ mtDevice2Pattern.TransformRect(clip_box_p);
min_col = (int)FXSYS_ceil((clip_box_p.left - pPattern->bbox().right) /
pPattern->x_step());