| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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/fxge/cfx_renderdevice.h" | 7 #include "core/fxge/cfx_renderdevice.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 CFX_PathData path; | 449 CFX_PathData path; |
| 450 path.AppendRect(rect.left, rect.bottom, rect.right, rect.top); | 450 path.AppendRect(rect.left, rect.bottom, rect.right, rect.top); |
| 451 if (!SetClip_PathFill(&path, nullptr, FXFILL_WINDING)) | 451 if (!SetClip_PathFill(&path, nullptr, FXFILL_WINDING)) |
| 452 return false; | 452 return false; |
| 453 | 453 |
| 454 UpdateClipBox(); | 454 UpdateClipBox(); |
| 455 return true; | 455 return true; |
| 456 } | 456 } |
| 457 | 457 |
| 458 void CFX_RenderDevice::UpdateClipBox() { | 458 void CFX_RenderDevice::UpdateClipBox() { |
| 459 if (m_pDeviceDriver->GetClipBox(&m_ClipBox)) | 459 if (m_pDeviceDriver->GetClipBox(&m_ClipBox)) { |
| 460 m_Width = m_ClipBox.right; |
| 461 m_Height = m_ClipBox.top; |
| 460 return; | 462 return; |
| 463 } |
| 461 m_ClipBox.left = 0; | 464 m_ClipBox.left = 0; |
| 462 m_ClipBox.top = 0; | 465 m_ClipBox.top = 0; |
| 463 m_ClipBox.right = m_Width; | 466 m_ClipBox.right = m_Width; |
| 464 m_ClipBox.bottom = m_Height; | 467 m_ClipBox.bottom = m_Height; |
| 465 } | 468 } |
| 466 | 469 |
| 467 bool CFX_RenderDevice::DrawPathWithBlend(const CFX_PathData* pPathData, | 470 bool CFX_RenderDevice::DrawPathWithBlend(const CFX_PathData* pPathData, |
| 468 const CFX_Matrix* pObject2Device, | 471 const CFX_Matrix* pObject2Device, |
| 469 const CFX_GraphStateData* pGraphState, | 472 const CFX_GraphStateData* pGraphState, |
| 470 uint32_t fill_color, | 473 uint32_t fill_color, |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1079 fill_color, stroke_color, fill_mode, | 1082 fill_color, stroke_color, fill_mode, |
| 1080 FXDIB_BLEND_NORMAL)) { | 1083 FXDIB_BLEND_NORMAL)) { |
| 1081 return false; | 1084 return false; |
| 1082 } | 1085 } |
| 1083 } | 1086 } |
| 1084 if (pClippingPath) | 1087 if (pClippingPath) |
| 1085 pClippingPath->Append(&TransformedPath, pUser2Device); | 1088 pClippingPath->Append(&TransformedPath, pUser2Device); |
| 1086 } | 1089 } |
| 1087 return true; | 1090 return true; |
| 1088 } | 1091 } |
| OLD | NEW |