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