summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-09 13:07:43 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-09 19:02:55 +0000
commitafb44560a21298b3588b36cbaf45e2be50f2e75b (patch)
tree21f3ececad017e6be64a19c4370cfe9fd7f9c29c /core/fpdfapi
parent67e4faaf8be0aebc67ebfb96d33933d9f9119d20 (diff)
downloadpdfium-afb44560a21298b3588b36cbaf45e2be50f2e75b.tar.xz
Remove Transform in favour of TransformPoint
This CL removes the two Transform() overrides from CFX_Matrix and calls the TransformPoint methods directly. In the case of the 4 param version the values were assigned to the out values before calling. Change-Id: Id633826caec75b848774dcda6cfdcef2dbf5a7db Reviewed-on: https://pdfium-review.googlesource.com/2573 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/page/cpdf_meshstream.cpp4
-rw-r--r--core/fpdfapi/page/cpdf_streamcontentparser.cpp6
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.cpp12
3 files changed, 11 insertions, 11 deletions
diff --git a/core/fpdfapi/page/cpdf_meshstream.cpp b/core/fpdfapi/page/cpdf_meshstream.cpp
index 8bc2a851cc..b852901794 100644
--- a/core/fpdfapi/page/cpdf_meshstream.cpp
+++ b/core/fpdfapi/page/cpdf_meshstream.cpp
@@ -195,7 +195,7 @@ uint32_t CPDF_MeshStream::GetVertex(CPDF_MeshVertex& vertex,
CFX_Matrix* pObject2Bitmap) {
uint32_t flag = GetFlag();
GetCoords(vertex.x, vertex.y);
- pObject2Bitmap->Transform(vertex.x, vertex.y);
+ pObject2Bitmap->TransformPoint(vertex.x, vertex.y);
GetColor(vertex.r, vertex.g, vertex.b);
m_BitStream.ByteAlign();
return flag;
@@ -209,7 +209,7 @@ bool CPDF_MeshStream::GetVertexRow(CPDF_MeshVertex* vertex,
return false;
GetCoords(vertex[i].x, vertex[i].y);
- pObject2Bitmap->Transform(vertex[i].x, vertex[i].y);
+ pObject2Bitmap->TransformPoint(vertex[i].x, vertex[i].y);
GetColor(vertex[i].r, vertex[i].g, vertex[i].b);
m_BitStream.ByteAlign();
}
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
index 1fcb27a8c8..93478de174 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
@@ -1230,13 +1230,13 @@ CPDF_Pattern* CPDF_StreamContentParser::FindPattern(const CFX_ByteString& name,
}
void CPDF_StreamContentParser::ConvertTextSpace(FX_FLOAT& x, FX_FLOAT& y) {
- m_pCurStates->m_TextMatrix.Transform(x, y, x, y);
+ m_pCurStates->m_TextMatrix.TransformPoint(x, y);
ConvertUserSpace(x, y);
}
void CPDF_StreamContentParser::ConvertUserSpace(FX_FLOAT& x, FX_FLOAT& y) {
- m_pCurStates->m_CTM.Transform(x, y, x, y);
- m_mtContentToUser.Transform(x, y, x, y);
+ m_pCurStates->m_CTM.TransformPoint(x, y);
+ m_mtContentToUser.TransformPoint(x, y);
}
void CPDF_StreamContentParser::AddTextObject(CFX_ByteString* pStrs,
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index 07987d616e..813ff3784c 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -160,7 +160,7 @@ void DrawAxialShading(CFX_DIBitmap* pBitmap,
uint32_t* dib_buf = (uint32_t*)(pBitmap->GetBuffer() + row * pitch);
for (int column = 0; column < width; column++) {
FX_FLOAT x = (FX_FLOAT)column, y = (FX_FLOAT)row;
- matrix.Transform(x, y);
+ matrix.TransformPoint(x, y);
FX_FLOAT scale = (((x - start_x) * x_span) + ((y - start_y) * y_span)) /
axis_len_square;
int index = (int32_t)(scale * (SHADING_STEPS - 1));
@@ -253,7 +253,7 @@ void DrawRadialShading(CFX_DIBitmap* pBitmap,
uint32_t* dib_buf = (uint32_t*)(pBitmap->GetBuffer() + row * pitch);
for (int column = 0; column < width; column++) {
FX_FLOAT x = (FX_FLOAT)column, y = (FX_FLOAT)row;
- matrix.Transform(x, y);
+ matrix.TransformPoint(x, y);
FX_FLOAT b = -2 * (((x - start_x) * (end_x - start_x)) +
((y - start_y) * (end_y - start_y)) +
(start_r * (end_r - start_r)));
@@ -345,7 +345,7 @@ void DrawFuncShading(CFX_DIBitmap* pBitmap,
uint32_t* dib_buf = (uint32_t*)(pBitmap->GetBuffer() + row * pitch);
for (int column = 0; column < width; column++) {
FX_FLOAT x = (FX_FLOAT)column, y = (FX_FLOAT)row;
- matrix.Transform(x, y);
+ matrix.TransformPoint(x, y);
if (x < xmin || x > xmax || y < ymin || y > ymax) {
continue;
}
@@ -844,7 +844,7 @@ void DrawCoonPatchMeshes(
}
for (i = iStartPoint; i < point_count; i++) {
stream.GetCoords(coords[i].x, coords[i].y);
- pObject2Bitmap->Transform(coords[i].x, coords[i].y);
+ pObject2Bitmap->TransformPoint(coords[i].x, coords[i].y);
}
for (i = iStartColor; i < 4; i++) {
FX_FLOAT r = 0.0f, g = 0.0f, b = 0.0f;
@@ -2233,7 +2233,7 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern,
FX_FLOAT orig_x, orig_y;
orig_x = col * pPattern->x_step();
orig_y = row * pPattern->y_step();
- mtPattern2Device.Transform(orig_x, orig_y);
+ mtPattern2Device.TransformPoint(orig_x, orig_y);
CFX_Matrix matrix = *pObj2Device;
matrix.Translate(orig_x - mtPattern2Device.e,
orig_y - mtPattern2Device.f);
@@ -2308,7 +2308,7 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern,
} else {
FX_FLOAT orig_x = col * pPattern->x_step();
FX_FLOAT orig_y = row * pPattern->y_step();
- mtPattern2Device.Transform(orig_x, orig_y);
+ mtPattern2Device.TransformPoint(orig_x, orig_y);
pdfium::base::CheckedNumeric<int> safeStartX =
FXSYS_round(orig_x + left_offset);