diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-02-09 10:16:07 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-09 16:38:46 +0000 |
commit | 118a8e28783f42e089721eac4880f3b3f683e832 (patch) | |
tree | 879d6fb7b0442feff533c265fef3a48c71a4b91e /core/fxge/win32 | |
parent | 21e954b59fcef1b84fdcdb9ae337e2d4c060b19e (diff) | |
download | pdfium-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/fxge/win32')
-rw-r--r-- | core/fxge/win32/cfx_psrenderer.cpp | 5 | ||||
-rw-r--r-- | core/fxge/win32/fx_win32_device.cpp | 6 |
2 files changed, 6 insertions, 5 deletions
diff --git a/core/fxge/win32/cfx_psrenderer.cpp b/core/fxge/win32/cfx_psrenderer.cpp index 71e62a75f2..2e4519c46f 100644 --- a/core/fxge/win32/cfx_psrenderer.cpp +++ b/core/fxge/win32/cfx_psrenderer.cpp @@ -158,7 +158,8 @@ void CFX_PSRenderer::SetClip_PathFill(const CFX_PathData* pPathData, OutputPath(pPathData, pObject2Device); CFX_FloatRect rect = pPathData->GetBoundingBox(); if (pObject2Device) - rect.Transform(pObject2Device); + pObject2Device->TransformRect(rect); + m_ClipBox.left = static_cast<int>(rect.left); m_ClipBox.right = static_cast<int>(rect.left + rect.right); m_ClipBox.top = static_cast<int>(rect.top + rect.bottom); @@ -185,7 +186,7 @@ void CFX_PSRenderer::SetClip_PathStroke(const CFX_PathData* pPathData, OutputPath(pPathData, nullptr); CFX_FloatRect rect = pPathData->GetBoundingBox(pGraphState->m_LineWidth, pGraphState->m_MiterLimit); - rect.Transform(pObject2Device); + pObject2Device->TransformRect(rect); m_ClipBox.Intersect(rect.GetOuterRect()); if (pObject2Device) { OUTPUT_PS("strokepath W n sm\n"); diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp index 223f64d041..c8ceacfc4c 100644 --- a/core/fxge/win32/fx_win32_device.cpp +++ b/core/fxge/win32/fx_win32_device.cpp @@ -996,9 +996,9 @@ bool CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData, if (!(pGraphState || stroke_color == 0) && !pPlatform->m_GdiplusExt.IsAvailable()) { CFX_FloatRect bbox_f = pPathData->GetBoundingBox(); - if (pMatrix) { - bbox_f.Transform(pMatrix); - } + if (pMatrix) + pMatrix->TransformRect(bbox_f); + FX_RECT bbox = bbox_f.GetInnerRect(); if (bbox.Width() <= 0) { return DrawCosmeticLine( |