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/fpdfapi/fpdf_page/pageint.h" | 7 #include "core/fpdfapi/fpdf_page/pageint.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 1441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1452 } | 1452 } |
1453 | 1453 |
1454 void CPDF_StreamContentParser::AddPathObject(int FillType, FX_BOOL bStroke) { | 1454 void CPDF_StreamContentParser::AddPathObject(int FillType, FX_BOOL bStroke) { |
1455 int PathPointCount = m_PathPointCount; | 1455 int PathPointCount = m_PathPointCount; |
1456 uint8_t PathClipType = m_PathClipType; | 1456 uint8_t PathClipType = m_PathClipType; |
1457 m_PathPointCount = 0; | 1457 m_PathPointCount = 0; |
1458 m_PathClipType = 0; | 1458 m_PathClipType = 0; |
1459 if (PathPointCount <= 1) { | 1459 if (PathPointCount <= 1) { |
1460 if (PathPointCount && PathClipType) { | 1460 if (PathPointCount && PathClipType) { |
1461 CPDF_Path path; | 1461 CPDF_Path path; |
1462 path.Emplace()->AppendRect(0, 0, 0, 0); | 1462 path.AppendRect(0, 0, 0, 0); |
1463 m_pCurStates->m_ClipPath.AppendPath(path, FXFILL_WINDING, TRUE); | 1463 m_pCurStates->m_ClipPath.AppendPath(path, FXFILL_WINDING, TRUE); |
1464 } | 1464 } |
1465 return; | 1465 return; |
1466 } | 1466 } |
1467 if (PathPointCount && | 1467 if (PathPointCount && |
1468 m_pPathPoints[PathPointCount - 1].m_Flag == FXPT_MOVETO) { | 1468 m_pPathPoints[PathPointCount - 1].m_Flag == FXPT_MOVETO) { |
1469 PathPointCount--; | 1469 PathPointCount--; |
1470 } | 1470 } |
1471 CPDF_Path Path; | 1471 CPDF_Path Path; |
1472 CFX_PathData* pPathData = Path.Emplace(); | 1472 Path.SetPointCount(PathPointCount); |
1473 pPathData->SetPointCount(PathPointCount); | 1473 FXSYS_memcpy(Path.GetMutablePoints(), m_pPathPoints, |
1474 FXSYS_memcpy(pPathData->GetPoints(), m_pPathPoints, | |
1475 sizeof(FX_PATHPOINT) * PathPointCount); | 1474 sizeof(FX_PATHPOINT) * PathPointCount); |
1476 CFX_Matrix matrix = m_pCurStates->m_CTM; | 1475 CFX_Matrix matrix = m_pCurStates->m_CTM; |
1477 matrix.Concat(m_mtContentToUser); | 1476 matrix.Concat(m_mtContentToUser); |
1478 if (bStroke || FillType) { | 1477 if (bStroke || FillType) { |
1479 std::unique_ptr<CPDF_PathObject> pPathObj(new CPDF_PathObject); | 1478 std::unique_ptr<CPDF_PathObject> pPathObj(new CPDF_PathObject); |
1480 pPathObj->m_bStroke = bStroke; | 1479 pPathObj->m_bStroke = bStroke; |
1481 pPathObj->m_FillType = FillType; | 1480 pPathObj->m_FillType = FillType; |
1482 pPathObj->m_Path = Path; | 1481 pPathObj->m_Path = Path; |
1483 pPathObj->m_Matrix = matrix; | 1482 pPathObj->m_Matrix = matrix; |
1484 SetGraphicStates(pPathObj.get(), TRUE, FALSE, TRUE); | 1483 SetGraphicStates(pPathObj.get(), TRUE, FALSE, TRUE); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1673 } else { | 1672 } else { |
1674 PDF_ReplaceAbbr(pElement); | 1673 PDF_ReplaceAbbr(pElement); |
1675 } | 1674 } |
1676 } | 1675 } |
1677 break; | 1676 break; |
1678 } | 1677 } |
1679 default: | 1678 default: |
1680 break; | 1679 break; |
1681 } | 1680 } |
1682 } | 1681 } |
OLD | NEW |