| 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 "public/fpdf_transformpage.h" | 7 #include "public/fpdf_transformpage.h" |
| 8 | 8 |
| 9 #include "fpdfsdk/include/fsdk_define.h" | 9 #include "fpdfsdk/include/fsdk_define.h" |
| 10 | 10 |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 buf << (pPoints[0].m_PointX) << " " << (pPoints[0].m_PointY) << " " | 233 buf << (pPoints[0].m_PointX) << " " << (pPoints[0].m_PointY) << " " |
| 234 << (pPoints[2].m_PointX - pPoints[0].m_PointX) << " " | 234 << (pPoints[2].m_PointX - pPoints[0].m_PointX) << " " |
| 235 << (pPoints[2].m_PointY - pPoints[0].m_PointY) << " re\n"; | 235 << (pPoints[2].m_PointY - pPoints[0].m_PointY) << " re\n"; |
| 236 return; | 236 return; |
| 237 } | 237 } |
| 238 | 238 |
| 239 CFX_ByteString temp; | 239 CFX_ByteString temp; |
| 240 for (int i = 0; i < pPathData->GetPointCount(); i++) { | 240 for (int i = 0; i < pPathData->GetPointCount(); i++) { |
| 241 buf << (pPoints[i].m_PointX) << " " << (pPoints[i].m_PointY); | 241 buf << (pPoints[i].m_PointX) << " " << (pPoints[i].m_PointY); |
| 242 int point_type = pPoints[i].m_Flag & FXPT_TYPE; | 242 int point_type = pPoints[i].m_Flag & FXPT_TYPE; |
| 243 if (point_type == FXPT_MOVETO) | 243 if (point_type == FXPT_MOVETO) { |
| 244 buf << " m\n"; | 244 buf << " m\n"; |
| 245 else if (point_type == FXPT_BEZIERTO) { | 245 } else if (point_type == FXPT_BEZIERTO) { |
| 246 buf << " " << (pPoints[i + 1].m_PointX) << " " | 246 buf << " " << (pPoints[i + 1].m_PointX) << " " |
| 247 << (pPoints[i + 1].m_PointY) << " " << (pPoints[i + 2].m_PointX) | 247 << (pPoints[i + 1].m_PointY) << " " << (pPoints[i + 2].m_PointX) |
| 248 << " " << (pPoints[i + 2].m_PointY); | 248 << " " << (pPoints[i + 2].m_PointY); |
| 249 if (pPoints[i + 2].m_Flag & FXPT_CLOSEFIGURE) | 249 if (pPoints[i + 2].m_Flag & FXPT_CLOSEFIGURE) |
| 250 buf << " c h\n"; | 250 buf << " c h\n"; |
| 251 else | 251 else |
| 252 buf << " c\n"; | 252 buf << " c\n"; |
| 253 i += 2; | 253 i += 2; |
| 254 } else if (point_type == FXPT_LINETO) { | 254 } else if (point_type == FXPT_LINETO) { |
| 255 if (pPoints[i].m_Flag & FXPT_CLOSEFIGURE) | 255 if (pPoints[i].m_Flag & FXPT_CLOSEFIGURE) |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 } else if (pDirectObj->IsStream()) { | 314 } else if (pDirectObj->IsStream()) { |
| 315 pContentArray = new CPDF_Array(); | 315 pContentArray = new CPDF_Array(); |
| 316 pContentArray->AddReference(pDoc, pStream->GetObjNum()); | 316 pContentArray->AddReference(pDoc, pStream->GetObjNum()); |
| 317 pContentArray->AddReference(pDoc, pDirectObj->GetObjNum()); | 317 pContentArray->AddReference(pDoc, pDirectObj->GetObjNum()); |
| 318 pPageDic->SetAtReference("Contents", pDoc, | 318 pPageDic->SetAtReference("Contents", pDoc, |
| 319 pDoc->AddIndirectObject(pContentArray)); | 319 pDoc->AddIndirectObject(pContentArray)); |
| 320 } | 320 } |
| 321 } | 321 } |
| 322 } | 322 } |
| 323 } | 323 } |
| OLD | NEW |