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 /core/fxge/win32/fx_win32_device.cpp | |
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 'core/fxge/win32/fx_win32_device.cpp')
-rw-r--r-- | core/fxge/win32/fx_win32_device.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp index fec656ef93..537e67564c 100644 --- a/core/fxge/win32/fx_win32_device.cpp +++ b/core/fxge/win32/fx_win32_device.cpp @@ -959,8 +959,8 @@ bool CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData, uint32_t fill_color, uint32_t stroke_color, int fill_mode, - int blend_type) { - if (blend_type != FXDIB_BLEND_NORMAL) + BlendMode blend_type) { + if (blend_type != BlendMode::kNormal) return false; CWin32Platform* pPlatform = @@ -975,12 +975,12 @@ bool CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData, if (bbox.Width() <= 0) { return DrawCosmeticLine(CFX_PointF(bbox.left, bbox.top), CFX_PointF(bbox.left, bbox.bottom + 1), - fill_color, FXDIB_BLEND_NORMAL); + fill_color, BlendMode::kNormal); } if (bbox.Height() <= 0) { return DrawCosmeticLine(CFX_PointF(bbox.left, bbox.top), CFX_PointF(bbox.right + 1, bbox.top), fill_color, - FXDIB_BLEND_NORMAL); + BlendMode::kNormal); } } int fill_alpha = FXARGB_A(fill_color); @@ -1061,8 +1061,8 @@ bool CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData, bool CGdiDeviceDriver::FillRectWithBlend(const FX_RECT& rect, uint32_t fill_color, - int blend_type) { - if (blend_type != FXDIB_BLEND_NORMAL) + BlendMode blend_type) { + if (blend_type != BlendMode::kNormal) return false; int alpha; @@ -1116,8 +1116,8 @@ bool CGdiDeviceDriver::SetClip_PathStroke( bool CGdiDeviceDriver::DrawCosmeticLine(const CFX_PointF& ptMoveTo, const CFX_PointF& ptLineTo, uint32_t color, - int blend_type) { - if (blend_type != FXDIB_BLEND_NORMAL) + BlendMode blend_type) { + if (blend_type != BlendMode::kNormal) return false; int alpha; @@ -1191,8 +1191,8 @@ bool CGdiDisplayDriver::SetDIBits(const RetainPtr<CFX_DIBBase>& pSource, const FX_RECT* pSrcRect, int left, int top, - int blend_type) { - ASSERT(blend_type == FXDIB_BLEND_NORMAL); + BlendMode blend_type) { + ASSERT(blend_type == BlendMode::kNormal); if (pSource->IsAlphaMask()) { int width = pSource->GetWidth(), height = pSource->GetHeight(); int alpha = FXARGB_A(color); @@ -1201,17 +1201,17 @@ bool CGdiDisplayDriver::SetDIBits(const RetainPtr<CFX_DIBBase>& pSource, if (!background->Create(width, height, FXDIB_Rgb32) || !GetDIBits(background, left, top) || !background->CompositeMask(0, 0, width, height, pSource, color, 0, 0, - FXDIB_BLEND_NORMAL, nullptr, false, 0)) { + BlendMode::kNormal, nullptr, false, 0)) { return false; } FX_RECT src_rect(0, 0, width, height); - return SetDIBits(background, 0, &src_rect, left, top, FXDIB_BLEND_NORMAL); + return SetDIBits(background, 0, &src_rect, left, top, BlendMode::kNormal); } FX_RECT clip_rect(left, top, left + pSrcRect->Width(), top + pSrcRect->Height()); return StretchDIBits(pSource, color, left - pSrcRect->left, top - pSrcRect->top, width, height, &clip_rect, 0, - FXDIB_BLEND_NORMAL); + BlendMode::kNormal); } int width = pSrcRect->Width(), height = pSrcRect->Height(); if (pSource->HasAlpha()) { @@ -1219,12 +1219,12 @@ bool CGdiDisplayDriver::SetDIBits(const RetainPtr<CFX_DIBBase>& pSource, if (!bitmap->Create(width, height, FXDIB_Rgb) || !GetDIBits(bitmap, left, top) || !bitmap->CompositeBitmap(0, 0, width, height, pSource, pSrcRect->left, - pSrcRect->top, FXDIB_BLEND_NORMAL, nullptr, + pSrcRect->top, BlendMode::kNormal, nullptr, false)) { return false; } FX_RECT src_rect(0, 0, width, height); - return SetDIBits(bitmap, 0, &src_rect, left, top, FXDIB_BLEND_NORMAL); + return SetDIBits(bitmap, 0, &src_rect, left, top, BlendMode::kNormal); } CFX_DIBExtractor temp(pSource); RetainPtr<CFX_DIBitmap> pBitmap = temp.GetBitmap(); @@ -1257,7 +1257,7 @@ bool CGdiDisplayDriver::UseFoxitStretchEngine( FX_RECT src_rect(0, 0, pStretched->GetWidth(), pStretched->GetHeight()); return SetDIBits(pStretched, color, &src_rect, pClipRect->left, - pClipRect->top, FXDIB_BLEND_NORMAL); + pClipRect->top, BlendMode::kNormal); } bool CGdiDisplayDriver::StretchDIBits(const RetainPtr<CFX_DIBBase>& pSource, @@ -1268,7 +1268,7 @@ bool CGdiDisplayDriver::StretchDIBits(const RetainPtr<CFX_DIBBase>& pSource, int dest_height, const FX_RECT* pClipRect, uint32_t flags, - int blend_type) { + BlendMode blend_type) { ASSERT(pSource && pClipRect); if (flags || dest_width > 10000 || dest_width < -10000 || dest_height > 10000 || dest_height < -10000) { @@ -1295,14 +1295,14 @@ bool CGdiDisplayDriver::StretchDIBits(const RetainPtr<CFX_DIBBase>& pSource, !GetDIBits(background, image_rect.left + clip_rect.left, image_rect.top + clip_rect.top) || !background->CompositeMask(0, 0, clip_width, clip_height, pStretched, - color, 0, 0, FXDIB_BLEND_NORMAL, nullptr, + color, 0, 0, BlendMode::kNormal, nullptr, false, 0)) { return false; } FX_RECT src_rect(0, 0, clip_width, clip_height); return SetDIBits(background, 0, &src_rect, image_rect.left + clip_rect.left, - image_rect.top + clip_rect.top, FXDIB_BLEND_NORMAL); + image_rect.top + clip_rect.top, BlendMode::kNormal); } if (pSource->HasAlpha()) { CWin32Platform* pPlatform = @@ -1333,7 +1333,7 @@ bool CGdiDisplayDriver::StartDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, const CFX_Matrix* pMatrix, uint32_t render_flags, std::unique_ptr<CFX_ImageRenderer>* handle, - int blend_type) { + BlendMode blend_type) { return false; } |