| 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/fpdfapi/render/cpdf_renderstatus.h" | 7 #include "core/fpdfapi/render/cpdf_renderstatus.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1118 return; | 1118 return; |
| 1119 case CPDF_PageObject::FORM: | 1119 case CPDF_PageObject::FORM: |
| 1120 bRet = ProcessForm(pObj->AsForm(), pObj2Device); | 1120 bRet = ProcessForm(pObj->AsForm(), pObj2Device); |
| 1121 break; | 1121 break; |
| 1122 } | 1122 } |
| 1123 if (!bRet) | 1123 if (!bRet) |
| 1124 DrawObjWithBackground(pObj, pObj2Device); | 1124 DrawObjWithBackground(pObj, pObj2Device); |
| 1125 #if defined _SKIA_SUPPORT_ | 1125 #if defined _SKIA_SUPPORT_ |
| 1126 DebugVerifyDeviceIsPreMultiplied(); | 1126 DebugVerifyDeviceIsPreMultiplied(); |
| 1127 #endif | 1127 #endif |
| 1128 #if defined _SKIA_SUPPORT_PATHS_ |
| 1129 UnPreMultiplyDevice(); |
| 1130 #endif |
| 1128 } | 1131 } |
| 1129 | 1132 |
| 1130 bool CPDF_RenderStatus::DrawObjWithBlend(CPDF_PageObject* pObj, | 1133 bool CPDF_RenderStatus::DrawObjWithBlend(CPDF_PageObject* pObj, |
| 1131 const CFX_Matrix* pObj2Device) { | 1134 const CFX_Matrix* pObj2Device) { |
| 1132 bool bRet = false; | 1135 bool bRet = false; |
| 1133 switch (pObj->GetType()) { | 1136 switch (pObj->GetType()) { |
| 1134 case CPDF_PageObject::PATH: | 1137 case CPDF_PageObject::PATH: |
| 1135 bRet = ProcessPath(pObj->AsPath(), pObj2Device); | 1138 bRet = ProcessPath(pObj->AsPath(), pObj2Device); |
| 1136 break; | 1139 break; |
| 1137 case CPDF_PageObject::IMAGE: | 1140 case CPDF_PageObject::IMAGE: |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1639 } | 1642 } |
| 1640 return pStates; | 1643 return pStates; |
| 1641 } | 1644 } |
| 1642 | 1645 |
| 1643 #if defined _SKIA_SUPPORT_ | 1646 #if defined _SKIA_SUPPORT_ |
| 1644 void CPDF_RenderStatus::DebugVerifyDeviceIsPreMultiplied() const { | 1647 void CPDF_RenderStatus::DebugVerifyDeviceIsPreMultiplied() const { |
| 1645 m_pDevice->DebugVerifyBitmapIsPreMultiplied(); | 1648 m_pDevice->DebugVerifyBitmapIsPreMultiplied(); |
| 1646 } | 1649 } |
| 1647 #endif | 1650 #endif |
| 1648 | 1651 |
| 1652 #if defined _SKIA_SUPPORT_PATHS_ |
| 1653 void CPDF_RenderStatus::UnPreMultiplyDevice() { |
| 1654 m_pDevice->UnPreMultiplyDevice(); |
| 1655 } |
| 1656 #endif |
| 1657 |
| 1649 bool CPDF_RenderStatus::ProcessText(CPDF_TextObject* textobj, | 1658 bool CPDF_RenderStatus::ProcessText(CPDF_TextObject* textobj, |
| 1650 const CFX_Matrix* pObj2Device, | 1659 const CFX_Matrix* pObj2Device, |
| 1651 CFX_PathData* pClippingPath) { | 1660 CFX_PathData* pClippingPath) { |
| 1652 if (textobj->m_nChars == 0) | 1661 if (textobj->m_nChars == 0) |
| 1653 return true; | 1662 return true; |
| 1654 | 1663 |
| 1655 const TextRenderingMode text_render_mode = textobj->m_TextState.GetTextMode(); | 1664 const TextRenderingMode text_render_mode = textobj->m_TextState.GetTextMode(); |
| 1656 if (text_render_mode == TextRenderingMode::MODE_INVISIBLE) | 1665 if (text_render_mode == TextRenderingMode::MODE_INVISIBLE) |
| 1657 return true; | 1666 return true; |
| 1658 | 1667 |
| (...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2617 } else if (pFunc) { | 2626 } else if (pFunc) { |
| 2618 int size = dest_pitch * height; | 2627 int size = dest_pitch * height; |
| 2619 for (int i = 0; i < size; i++) { | 2628 for (int i = 0; i < size; i++) { |
| 2620 dest_buf[i] = transfers[src_buf[i]]; | 2629 dest_buf[i] = transfers[src_buf[i]]; |
| 2621 } | 2630 } |
| 2622 } else { | 2631 } else { |
| 2623 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); | 2632 FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height); |
| 2624 } | 2633 } |
| 2625 return pMask.release(); | 2634 return pMask.release(); |
| 2626 } | 2635 } |
| OLD | NEW |