| 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_render/render_int.h" | 7 #include "core/fpdfapi/fpdf_render/render_int.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 FX_PATHPOINT* pPoints = path.GetPoints(); | 670 FX_PATHPOINT* pPoints = path.GetPoints(); |
| 671 C1.GetPoints(pPoints); | 671 C1.GetPoints(pPoints); |
| 672 D2.GetPoints(pPoints + 3); | 672 D2.GetPoints(pPoints + 3); |
| 673 C2.GetPointsReverse(pPoints + 6); | 673 C2.GetPointsReverse(pPoints + 6); |
| 674 D1.GetPointsReverse(pPoints + 9); | 674 D1.GetPointsReverse(pPoints + 9); |
| 675 int fillFlags = FXFILL_WINDING | FXFILL_FULLCOVER; | 675 int fillFlags = FXFILL_WINDING | FXFILL_FULLCOVER; |
| 676 if (fill_mode & RENDER_NOPATHSMOOTH) { | 676 if (fill_mode & RENDER_NOPATHSMOOTH) { |
| 677 fillFlags |= FXFILL_NOPATHSMOOTH; | 677 fillFlags |= FXFILL_NOPATHSMOOTH; |
| 678 } | 678 } |
| 679 pDevice->DrawPath( | 679 pDevice->DrawPath( |
| 680 &path, NULL, NULL, | 680 &path, nullptr, nullptr, |
| 681 FXARGB_MAKE(alpha, div_colors[0].comp[0], div_colors[0].comp[1], | 681 FXARGB_MAKE(alpha, div_colors[0].comp[0], div_colors[0].comp[1], |
| 682 div_colors[0].comp[2]), | 682 div_colors[0].comp[2]), |
| 683 0, fillFlags); | 683 0, fillFlags); |
| 684 } else { | 684 } else { |
| 685 if (d_bottom < COONCOLOR_THRESHOLD && d_top < COONCOLOR_THRESHOLD) { | 685 if (d_bottom < COONCOLOR_THRESHOLD && d_top < COONCOLOR_THRESHOLD) { |
| 686 Coon_Bezier m1; | 686 Coon_Bezier m1; |
| 687 m1.BezierInterpol(D1, D2, C1, C2); | 687 m1.BezierInterpol(D1, D2, C1, C2); |
| 688 y_scale *= 2; | 688 y_scale *= 2; |
| 689 bottom *= 2; | 689 bottom *= 2; |
| 690 Draw(x_scale, y_scale, left, bottom, C1, m1, D1.first_half(), | 690 Draw(x_scale, y_scale, left, bottom, C1, m1, D1.first_half(), |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1037 pPattern->x_step()); | 1037 pPattern->x_step()); |
| 1038 max_col = (int)FXSYS_floor((clip_box_p.right - pPattern->bbox().left) / | 1038 max_col = (int)FXSYS_floor((clip_box_p.right - pPattern->bbox().left) / |
| 1039 pPattern->x_step()); | 1039 pPattern->x_step()); |
| 1040 min_row = (int)FXSYS_ceil((clip_box_p.bottom - pPattern->bbox().top) / | 1040 min_row = (int)FXSYS_ceil((clip_box_p.bottom - pPattern->bbox().top) / |
| 1041 pPattern->y_step()); | 1041 pPattern->y_step()); |
| 1042 max_row = (int)FXSYS_floor((clip_box_p.top - pPattern->bbox().bottom) / | 1042 max_row = (int)FXSYS_floor((clip_box_p.top - pPattern->bbox().bottom) / |
| 1043 pPattern->y_step()); | 1043 pPattern->y_step()); |
| 1044 | 1044 |
| 1045 if (width > clip_box.Width() || height > clip_box.Height() || | 1045 if (width > clip_box.Width() || height > clip_box.Height() || |
| 1046 width * height > clip_box.Width() * clip_box.Height()) { | 1046 width * height > clip_box.Width() * clip_box.Height()) { |
| 1047 CPDF_GraphicStates* pStates = NULL; | 1047 CPDF_GraphicStates* pStates = nullptr; |
| 1048 if (!pPattern->colored()) | 1048 if (!pPattern->colored()) |
| 1049 pStates = CloneObjStates(pPageObj, bStroke); | 1049 pStates = CloneObjStates(pPageObj, bStroke); |
| 1050 | 1050 |
| 1051 CPDF_Dictionary* pFormResource = nullptr; | 1051 CPDF_Dictionary* pFormResource = nullptr; |
| 1052 if (pPattern->form()->m_pFormDict) | 1052 if (pPattern->form()->m_pFormDict) |
| 1053 pFormResource = pPattern->form()->m_pFormDict->GetDictBy("Resources"); | 1053 pFormResource = pPattern->form()->m_pFormDict->GetDictBy("Resources"); |
| 1054 | 1054 |
| 1055 for (int col = min_col; col <= max_col; col++) | 1055 for (int col = min_col; col <= max_col; col++) |
| 1056 for (int row = min_row; row <= max_row; row++) { | 1056 for (int row = min_row; row <= max_row; row++) { |
| 1057 FX_FLOAT orig_x, orig_y; | 1057 FX_FLOAT orig_x, orig_y; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1190 } | 1190 } |
| 1191 } | 1191 } |
| 1192 if (bStroke) { | 1192 if (bStroke) { |
| 1193 CPDF_Color& StrokeColor = *pPathObj->m_ColorState.GetStrokeColor(); | 1193 CPDF_Color& StrokeColor = *pPathObj->m_ColorState.GetStrokeColor(); |
| 1194 if (StrokeColor.IsPattern()) { | 1194 if (StrokeColor.IsPattern()) { |
| 1195 DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, TRUE); | 1195 DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, TRUE); |
| 1196 bStroke = FALSE; | 1196 bStroke = FALSE; |
| 1197 } | 1197 } |
| 1198 } | 1198 } |
| 1199 } | 1199 } |
| OLD | NEW |