| 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 "../../../third_party/base/nonstd_unique_ptr.h" | 7 #include "../../../third_party/base/nonstd_unique_ptr.h" |
| 8 #include "../../include/fpdfdoc/fpdf_doc.h" | 8 #include "../../include/fpdfdoc/fpdf_doc.h" |
| 9 #include "../../include/fpdfapi/fpdf_pageobj.h" | 9 #include "../../include/fpdfapi/fpdf_pageobj.h" |
| 10 | 10 |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 pDashArray = pBS->GetArray("D"); | 322 pDashArray = pBS->GetArray("D"); |
| 323 style_char = style[1]; | 323 style_char = style[1]; |
| 324 width = pBS->GetNumber("W"); | 324 width = pBS->GetNumber("W"); |
| 325 } | 325 } |
| 326 if (width <= 0) { | 326 if (width <= 0) { |
| 327 return; | 327 return; |
| 328 } | 328 } |
| 329 CPDF_Array* pColor = m_pAnnotDict->GetArray("C"); | 329 CPDF_Array* pColor = m_pAnnotDict->GetArray("C"); |
| 330 FX_DWORD argb = 0xff000000; | 330 FX_DWORD argb = 0xff000000; |
| 331 if (pColor != NULL) { | 331 if (pColor != NULL) { |
| 332 int R = (FX_INT32)(pColor->GetNumber(0) * 255); | 332 int R = (int32_t)(pColor->GetNumber(0) * 255); |
| 333 int G = (FX_INT32)(pColor->GetNumber(1) * 255); | 333 int G = (int32_t)(pColor->GetNumber(1) * 255); |
| 334 int B = (FX_INT32)(pColor->GetNumber(2) * 255); | 334 int B = (int32_t)(pColor->GetNumber(2) * 255); |
| 335 argb = ArgbEncode(0xff, R, G, B); | 335 argb = ArgbEncode(0xff, R, G, B); |
| 336 } | 336 } |
| 337 CPDF_GraphStateData graph_state; | 337 CPDF_GraphStateData graph_state; |
| 338 graph_state.m_LineWidth = width; | 338 graph_state.m_LineWidth = width; |
| 339 if (style_char == 'D') { | 339 if (style_char == 'D') { |
| 340 if (pDashArray) { | 340 if (pDashArray) { |
| 341 FX_DWORD dash_count = pDashArray->GetCount(); | 341 FX_DWORD dash_count = pDashArray->GetCount(); |
| 342 if (dash_count % 2) { | 342 if (dash_count % 2) { |
| 343 dash_count++; | 343 dash_count++; |
| 344 } | 344 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 361 GetRect(rect); | 361 GetRect(rect); |
| 362 CPDF_PathData path; | 362 CPDF_PathData path; |
| 363 width /= 2; | 363 width /= 2; |
| 364 path.AppendRect(rect.left + width, rect.bottom + width, rect.right - width,
rect.top - width); | 364 path.AppendRect(rect.left + width, rect.bottom + width, rect.right - width,
rect.top - width); |
| 365 int fill_type = 0; | 365 int fill_type = 0; |
| 366 if (pOptions && (pOptions->m_Flags & RENDER_NOPATHSMOOTH)) { | 366 if (pOptions && (pOptions->m_Flags & RENDER_NOPATHSMOOTH)) { |
| 367 fill_type |= FXFILL_NOPATHSMOOTH; | 367 fill_type |= FXFILL_NOPATHSMOOTH; |
| 368 } | 368 } |
| 369 pDevice->DrawPath(&path, pUser2Device, &graph_state, argb, argb, fill_type); | 369 pDevice->DrawPath(&path, pUser2Device, &graph_state, argb, argb, fill_type); |
| 370 } | 370 } |
| OLD | NEW |