diff options
author | Lei Zhang <thestig@chromium.org> | 2018-10-25 19:02:50 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-25 19:02:50 +0000 |
commit | 0c327657fb8c23934c5beae520e7a97a48e2eef6 (patch) | |
tree | 75c5749124f32c464d29149e125e47325f0cbd2d /fpdfsdk | |
parent | 94f45b29897f801151ecd085fa083f84558065ee (diff) | |
download | pdfium-0c327657fb8c23934c5beae520e7a97a48e2eef6.tar.xz |
Change FXDIB_BLEND_FOO typedefs to an enum class.
BUG=pdfium:1085
Change-Id: Ieb43d4588e1d689e327e428dcbbf7adba45ce178
Reviewed-on: https://pdfium-review.googlesource.com/c/44545
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
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; } |