diff options
Diffstat (limited to 'fpdfsdk')
-rw-r--r-- | fpdfsdk/fpdf_editpage.cpp | 23 | ||||
-rw-r--r-- | fpdfsdk/fpdf_view.cpp | 4 |
2 files changed, 12 insertions, 15 deletions
diff --git a/fpdfsdk/fpdf_editpage.cpp b/fpdfsdk/fpdf_editpage.cpp index 981baec70a..47f4caa672 100644 --- a/fpdfsdk/fpdf_editpage.cpp +++ b/fpdfsdk/fpdf_editpage.cpp @@ -486,8 +486,7 @@ FPDFPageObj_HasTransparency(FPDF_PAGEOBJECT pageObject) { if (!pPageObj) return false; - int blend_type = pPageObj->m_GeneralState.GetBlendType(); - if (blend_type != FXDIB_BLEND_NORMAL) + if (pPageObj->m_GeneralState.GetBlendType() != BlendMode::kNormal) return true; const CPDF_Dictionary* pSMaskDict = @@ -498,20 +497,18 @@ FPDFPageObj_HasTransparency(FPDF_PAGEOBJECT pageObject) { if (pPageObj->m_GeneralState.GetFillAlpha() != 1.0f) return true; - if (pPageObj->IsPath() && pPageObj->m_GeneralState.GetStrokeAlpha() != 1.0f) { + if (pPageObj->IsPath() && pPageObj->m_GeneralState.GetStrokeAlpha() != 1.0f) return true; - } - if (pPageObj->IsForm()) { - const CPDF_Form* pForm = pPageObj->AsForm()->form(); - if (pForm) { - const CPDF_Transparency& trans = pForm->GetTransparency(); - if (trans.IsGroup() || trans.IsIsolated()) - return true; - } - } + if (!pPageObj->IsForm()) + return false; - return false; + const CPDF_Form* pForm = pPageObj->AsForm()->form(); + if (!pForm) + return false; + + const CPDF_Transparency& trans = pForm->GetTransparency(); + return trans.IsGroup() || trans.IsIsolated(); } FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV diff --git a/fpdfsdk/fpdf_view.cpp b/fpdfsdk/fpdf_view.cpp index 136841d566..f924a36e23 100644 --- a/fpdfsdk/fpdf_view.cpp +++ b/fpdfsdk/fpdf_view.cpp @@ -498,7 +498,7 @@ void RenderBitmap(CFX_RenderDevice* device, pDst->Clear(0xffffffff); pDst->CompositeBitmap(0, 0, size_x_bm, size_y_bm, pSrc, 0, 0, - FXDIB_BLEND_NORMAL, nullptr, false); + BlendMode::kNormal, nullptr, false); if (device->GetDeviceCaps(FXDC_DEVICE_CLASS) == FXDC_PRINTER) { device->StretchDIBits(pDst, mask_area.left, mask_area.top, size_x_bm, @@ -606,7 +606,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_RenderPage(HDC dc, if (pDst->Create(size_x, size_y, FXDIB_Rgb32)) { memset(pDst->GetBuffer(), -1, pBitmap->GetPitch() * size_y); pDst->CompositeBitmap(0, 0, size_x, size_y, pBitmap, 0, 0, - FXDIB_BLEND_NORMAL, nullptr, false); + BlendMode::kNormal, nullptr, false); WinDC.StretchDIBits(pDst, 0, 0, size_x, size_y); bitsStretched = true; } |