OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "core/include/fxcrt/fx_system.h" | 7 #include "core/include/fxcrt/fx_system.h" |
8 #include "core/include/fxge/fx_ge.h" | 8 #include "core/include/fxge/fx_ge.h" |
9 #include "third_party/base/numerics/safe_math.h" | 9 #include "third_party/base/numerics/safe_math.h" |
10 | 10 |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 FX_FLOAT join_x = (end_outside_c - start_outside_c) / (start_k - end_k); | 333 FX_FLOAT join_x = (end_outside_c - start_outside_c) / (start_k - end_k); |
334 FX_FLOAT join_y = (start_k * join_x) + start_outside_c; | 334 FX_FLOAT join_y = (start_k * join_x) + start_outside_c; |
335 rect.UpdateRect(join_x, join_y); | 335 rect.UpdateRect(join_x, join_y); |
336 } | 336 } |
337 CFX_FloatRect CFX_PathData::GetBoundingBox(FX_FLOAT line_width, | 337 CFX_FloatRect CFX_PathData::GetBoundingBox(FX_FLOAT line_width, |
338 FX_FLOAT miter_limit) const { | 338 FX_FLOAT miter_limit) const { |
339 CFX_FloatRect rect(100000 * 1.0f, 100000 * 1.0f, -100000 * 1.0f, | 339 CFX_FloatRect rect(100000 * 1.0f, 100000 * 1.0f, -100000 * 1.0f, |
340 -100000 * 1.0f); | 340 -100000 * 1.0f); |
341 int iPoint = 0; | 341 int iPoint = 0; |
342 FX_FLOAT half_width = line_width; | 342 FX_FLOAT half_width = line_width; |
343 int iStartPoint, iEndPoint, iMiddlePoint; | 343 int iStartPoint = 0; |
| 344 int iEndPoint = 0; |
| 345 int iMiddlePoint = 0; |
344 FX_BOOL bJoin; | 346 FX_BOOL bJoin; |
345 while (iPoint < m_PointCount) { | 347 while (iPoint < m_PointCount) { |
346 if (m_pPoints[iPoint].m_Flag == FXPT_MOVETO) { | 348 if (m_pPoints[iPoint].m_Flag == FXPT_MOVETO) { |
347 iStartPoint = iPoint + 1; | 349 iStartPoint = iPoint + 1; |
348 iEndPoint = iPoint; | 350 iEndPoint = iPoint; |
349 bJoin = FALSE; | 351 bJoin = FALSE; |
350 } else { | 352 } else { |
351 if (m_pPoints[iPoint].m_Flag == FXPT_BEZIERTO) { | 353 if (m_pPoints[iPoint].m_Flag == FXPT_BEZIERTO) { |
352 rect.UpdateRect(m_pPoints[iPoint].m_PointX, m_pPoints[iPoint].m_PointY); | 354 rect.UpdateRect(m_pPoints[iPoint].m_PointX, m_pPoints[iPoint].m_PointY); |
353 rect.UpdateRect(m_pPoints[iPoint + 1].m_PointX, | 355 rect.UpdateRect(m_pPoints[iPoint + 1].m_PointX, |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 } | 649 } |
648 void CFX_GraphStateData::SetDashCount(int count) { | 650 void CFX_GraphStateData::SetDashCount(int count) { |
649 FX_Free(m_DashArray); | 651 FX_Free(m_DashArray); |
650 m_DashArray = NULL; | 652 m_DashArray = NULL; |
651 m_DashCount = count; | 653 m_DashCount = count; |
652 if (count == 0) { | 654 if (count == 0) { |
653 return; | 655 return; |
654 } | 656 } |
655 m_DashArray = FX_Alloc(FX_FLOAT, count); | 657 m_DashArray = FX_Alloc(FX_FLOAT, count); |
656 } | 658 } |
OLD | NEW |