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/fxge/agg/fx_agg_driver.h" | 7 #include "core/fxge/agg/fx_agg_driver.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1099 m_ClipBox.bottom = m_pDevice->GetHeight(); | 1099 m_ClipBox.bottom = m_pDevice->GetHeight(); |
1100 } | 1100 } |
1101 m_pClipMask = NULL; | 1101 m_pClipMask = NULL; |
1102 if (m_pClipRgn && m_pClipRgn->GetType() == CFX_ClipRgn::MaskF) { | 1102 if (m_pClipRgn && m_pClipRgn->GetType() == CFX_ClipRgn::MaskF) { |
1103 m_pClipMask = m_pClipRgn->GetMask(); | 1103 m_pClipMask = m_pClipRgn->GetMask(); |
1104 } | 1104 } |
1105 m_bFullCover = bFullCover; | 1105 m_bFullCover = bFullCover; |
1106 FX_BOOL bObjectCMYK = FXGETFLAG_COLORTYPE(alpha_flag); | 1106 FX_BOOL bObjectCMYK = FXGETFLAG_COLORTYPE(alpha_flag); |
1107 FX_BOOL bDeviceCMYK = pDevice->IsCmykImage(); | 1107 FX_BOOL bDeviceCMYK = pDevice->IsCmykImage(); |
1108 m_Alpha = bObjectCMYK ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color); | 1108 m_Alpha = bObjectCMYK ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color); |
1109 ICodec_IccModule* pIccModule = NULL; | 1109 CCodec_IccModule* pIccModule = NULL; |
1110 if (!CFX_GEModule::Get()->GetCodecModule() || | 1110 if (!CFX_GEModule::Get()->GetCodecModule() || |
1111 !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) { | 1111 !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) { |
1112 pIccTransform = NULL; | 1112 pIccTransform = NULL; |
1113 } else { | 1113 } else { |
1114 pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); | 1114 pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); |
1115 } | 1115 } |
1116 if (m_pDevice->GetBPP() == 8) { | 1116 if (m_pDevice->GetBPP() == 8) { |
1117 ASSERT(!m_bRgbByteOrder); | 1117 ASSERT(!m_bRgbByteOrder); |
1118 composite_span = &CFX_Renderer::CompositeSpanGray; | 1118 composite_span = &CFX_Renderer::CompositeSpanGray; |
1119 if (m_pDevice->IsAlphaMask()) { | 1119 if (m_pDevice->IsAlphaMask()) { |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1522 | 1522 |
1523 FX_BOOL _DibSetPixel(CFX_DIBitmap* pDevice, | 1523 FX_BOOL _DibSetPixel(CFX_DIBitmap* pDevice, |
1524 int x, | 1524 int x, |
1525 int y, | 1525 int y, |
1526 uint32_t color, | 1526 uint32_t color, |
1527 int alpha_flag, | 1527 int alpha_flag, |
1528 void* pIccTransform) { | 1528 void* pIccTransform) { |
1529 FX_BOOL bObjCMYK = FXGETFLAG_COLORTYPE(alpha_flag); | 1529 FX_BOOL bObjCMYK = FXGETFLAG_COLORTYPE(alpha_flag); |
1530 int alpha = bObjCMYK ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color); | 1530 int alpha = bObjCMYK ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color); |
1531 if (pIccTransform) { | 1531 if (pIccTransform) { |
1532 ICodec_IccModule* pIccModule = | 1532 CCodec_IccModule* pIccModule = |
1533 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); | 1533 CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); |
1534 color = bObjCMYK ? FXCMYK_TODIB(color) : FXARGB_TODIB(color); | 1534 color = bObjCMYK ? FXCMYK_TODIB(color) : FXARGB_TODIB(color); |
1535 pIccModule->TranslateScanline(pIccTransform, (uint8_t*)&color, | 1535 pIccModule->TranslateScanline(pIccTransform, (uint8_t*)&color, |
1536 (uint8_t*)&color, 1); | 1536 (uint8_t*)&color, 1); |
1537 color = bObjCMYK ? FXCMYK_TODIB(color) : FXARGB_TODIB(color); | 1537 color = bObjCMYK ? FXCMYK_TODIB(color) : FXARGB_TODIB(color); |
1538 if (!pDevice->IsCmykImage()) { | 1538 if (!pDevice->IsCmykImage()) { |
1539 color = (color & 0xffffff) | (alpha << 24); | 1539 color = (color & 0xffffff) | (alpha << 24); |
1540 } | 1540 } |
1541 } else { | 1541 } else { |
1542 if (pDevice->IsCmykImage()) { | 1542 if (pDevice->IsCmykImage()) { |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1830 new CFX_AggDeviceDriver(pBitmap, dither_bits, FALSE, pOriDevice, FALSE); | 1830 new CFX_AggDeviceDriver(pBitmap, dither_bits, FALSE, pOriDevice, FALSE); |
1831 SetDeviceDriver(pDriver); | 1831 SetDeviceDriver(pDriver); |
1832 return true; | 1832 return true; |
1833 } | 1833 } |
1834 | 1834 |
1835 CFX_FxgeDevice::~CFX_FxgeDevice() { | 1835 CFX_FxgeDevice::~CFX_FxgeDevice() { |
1836 if (m_bOwnedBitmap) { | 1836 if (m_bOwnedBitmap) { |
1837 delete GetBitmap(); | 1837 delete GetBitmap(); |
1838 } | 1838 } |
1839 } | 1839 } |
OLD | NEW |