From ea1ae9915d1702ab62af520b1487f70a553fc6ae Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 25 Feb 2016 11:17:16 -0800 Subject: Make CFX_PSVTemplate simpler. Add default ctor so we don't have to zero these out. Also, make CFX_VTemplate simpler. Also, remove the Set() method in favor of assignment. Also, remove CFX_FloatPoint define. Also, remove unused (and wrong) CFX_VTemplate methods. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1733523003 . --- .../fpdfapi/fpdf_render/fpdf_render_pattern.cpp | 10 +++------ core/src/fpdftext/fpdf_text_int.cpp | 3 +-- core/src/fxcrt/fx_basic_coords.cpp | 24 +--------------------- 3 files changed, 5 insertions(+), 32 deletions(-) (limited to 'core/src') diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp index 4ad6f81d5e..cc9a998e57 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp @@ -768,11 +768,7 @@ static void DrawCoonPatchMeshes(FX_BOOL bTensor, for (int i = 1; i < 13; i++) { pPoints[i].m_Flag = FXPT_BEZIERTO; } - CFX_FloatPoint coords[16]; - for (int i = 0; i < 16; i++) { - coords[i].Set(0.0f, 0.0f); - } - + CFX_PointF coords[16]; int point_count = bTensor ? 16 : 12; while (!stream.m_BitStream.IsEOF()) { FX_DWORD flag = stream.GetFlag(); @@ -780,11 +776,11 @@ static void DrawCoonPatchMeshes(FX_BOOL bTensor, if (flag) { iStartPoint = 4; iStartColor = 2; - CFX_FloatPoint tempCoords[4]; + CFX_PointF tempCoords[4]; for (i = 0; i < 4; i++) { tempCoords[i] = coords[(flag * 3 + i) % 12]; } - FXSYS_memcpy(coords, tempCoords, sizeof(CFX_FloatPoint) * 4); + FXSYS_memcpy(coords, tempCoords, sizeof(tempCoords)); Coon_Color tempColors[2]; tempColors[0] = patch.patch_colors[flag]; tempColors[1] = patch.patch_colors[(flag + 1) % 4]; diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp index 7858fa0bf6..8e2eae1251 100644 --- a/core/src/fpdftext/fpdf_text_int.cpp +++ b/core/src/fpdftext/fpdf_text_int.cpp @@ -1552,8 +1552,7 @@ int32_t CPDF_TextPage::GetTextObjectWritingMode( if (dX <= 0.0001f && dY <= 0.0001f) { return -1; } - CFX_VectorF v; - v.Set(dX, dY); + CFX_VectorF v(dX, dY); v.Normalize(); if (v.y <= 0.0872f) { return v.x <= 0.0872f ? m_TextlineDir : 0; diff --git a/core/src/fxcrt/fx_basic_coords.cpp b/core/src/fxcrt/fx_basic_coords.cpp index 814fa36347..27feb55113 100644 --- a/core/src/fxcrt/fx_basic_coords.cpp +++ b/core/src/fxcrt/fx_basic_coords.cpp @@ -217,8 +217,7 @@ void CFX_FloatRect::UpdateRect(FX_FLOAT x, FX_FLOAT y) { top = y; } } -CFX_FloatRect CFX_FloatRect::GetBBox(const CFX_FloatPoint* pPoints, - int nPoints) { +CFX_FloatRect CFX_FloatRect::GetBBox(const CFX_PointF* pPoints, int nPoints) { if (nPoints == 0) { return CFX_FloatRect(); } @@ -454,27 +453,6 @@ void CFX_Matrix::TransformVector(CFX_Vector& v) const { v.x = FXSYS_round(fx); v.y = FXSYS_round(fy); } -void CFX_Matrix::TransformPoints(CFX_Point* points, int32_t iCount) const { - FXSYS_assert(iCount > 0); - FX_FLOAT fx, fy; - for (int32_t i = 0; i < iCount; i++) { - fx = a * points->x + c * points->y + e; - fy = b * points->x + d * points->y + f; - points->x = FXSYS_round(fx); - points->y = FXSYS_round(fy); - points++; - } -} -void CFX_Matrix::TransformPoints(CFX_PointF* points, int32_t iCount) const { - FXSYS_assert(iCount > 0); - FX_FLOAT fx, fy; - for (int32_t i = 0; i < iCount; i++) { - fx = a * points->x + c * points->y + e; - fy = b * points->x + d * points->y + f; - points->x = fx, points->y = fy; - points++; - } -} void CFX_Matrix::TransformPoint(FX_FLOAT& x, FX_FLOAT& y) const { FX_FLOAT fx = a * x + c * y + e; FX_FLOAT fy = b * x + d * y + f; -- cgit v1.2.3