From e4602321f3175fa5addb6761d0e94f5c2fc93d0c Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 15 Feb 2017 11:07:32 -0500 Subject: Cleanup CFX_PathData. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL replaces the array of path points with a vector. Cleaning up the usage as required. Change-Id: Ifa386a2c847005fef68af748ebe99c4e08961238 Reviewed-on: https://pdfium-review.googlesource.com/2710 Reviewed-by: Nicolás Peña Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- core/fxge/skia/fx_skia_device.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'core/fxge/skia') diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp index ba21bf4134..8263cf66f5 100644 --- a/core/fxge/skia/fx_skia_device.cpp +++ b/core/fxge/skia/fx_skia_device.cpp @@ -278,9 +278,8 @@ static void DebugValidate(const CFX_DIBitmap* bitmap, SkPath BuildPath(const CFX_PathData* pPathData) { SkPath skPath; const CFX_PathData* pFPath = pPathData; - int nPoints = pFPath->GetPointCount(); - FX_PATHPOINT* pPoints = pFPath->GetPoints(); - for (int i = 0; i < nPoints; i++) { + const std::vector& pPoints = pFPath->GetPoints(); + for (size_t i = 0; i < pPoints.size(); i++) { FX_FLOAT x = pPoints[i].m_PointX; FX_FLOAT y = pPoints[i].m_PointY; FXPT_TYPE point_type = pPoints[i].m_Type; @@ -306,7 +305,7 @@ SkMatrix ToSkMatrix(const CFX_Matrix& m) { return skMatrix; } -// use when pdf's y-axis points up insead of down +// use when pdf's y-axis points up instead of down SkMatrix ToFlippedSkMatrix(const CFX_Matrix& m, SkScalar flip) { SkMatrix skMatrix; skMatrix.setAll(m.a * flip, -m.c * flip, m.e, m.b * flip, -m.d * flip, m.f, 0, @@ -1432,7 +1431,8 @@ bool CFX_SkiaDeviceDriver::SetClip_PathFill( GetDeviceCaps(FXDC_PIXEL_WIDTH), GetDeviceCaps(FXDC_PIXEL_HEIGHT)); } #endif // _SKIA_SUPPORT_PATHS_ - if (pPathData->GetPointCount() == 5 || pPathData->GetPointCount() == 4) { + if (pPathData->GetPoints().size() == 5 || + pPathData->GetPoints().size() == 4) { CFX_FloatRect rectf; if (pPathData->IsRect(deviceMatrix, &rectf)) { rectf.Intersect( -- cgit v1.2.3