diff options
author | Nicolas Pena <npm@chromium.org> | 2017-05-04 10:06:54 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-05-04 14:20:12 +0000 |
commit | 8384757b2b00f11971d588f6fbe3a8c9aa755151 (patch) | |
tree | 0de66a70edc5321669a871783765274d7a20095d /core/fxge/dib/cfx_scanlinecompositor.h | |
parent | e4f8fda9e75609b1b23882eca288aa4ea62bc433 (diff) | |
download | pdfium-8384757b2b00f11971d588f6fbe3a8c9aa755151.tar.xz |
More cleanup in CFX_ScanlineCompositor
This CL does more cleanup in CFX_ScanlineCompositor:
- Use private initization methods instead of passing member refs to namespace.
- Own the m_pSrcPalette properly by getting rid of the raw pointer.
- Remove members that are unused.
- Fix some nits.
Change-Id: I2447032f8f92614dc026f62bd0cdcd2204ab37de
Reviewed-on: https://pdfium-review.googlesource.com/4851
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxge/dib/cfx_scanlinecompositor.h')
-rw-r--r-- | core/fxge/dib/cfx_scanlinecompositor.h | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/core/fxge/dib/cfx_scanlinecompositor.h b/core/fxge/dib/cfx_scanlinecompositor.h index a933a89b46..bc20cc97ab 100644 --- a/core/fxge/dib/cfx_scanlinecompositor.h +++ b/core/fxge/dib/cfx_scanlinecompositor.h @@ -7,6 +7,8 @@ #ifndef CORE_FXGE_DIB_CFX_SCANLINECOMPOSITOR_H_ #define CORE_FXGE_DIB_CFX_SCANLINECOMPOSITOR_H_ +#include <memory> + #include "core/fxge/dib/cfx_dibsource.h" class CFX_ScanlineCompositor { @@ -22,50 +24,53 @@ class CFX_ScanlineCompositor { uint32_t mask_color, int blend_type, bool bClip, - bool bRgbByteOrder = false, - int alpha_flag = 0); + bool bRgbByteOrder, + int alpha_flag); void CompositeRgbBitmapLine(uint8_t* dest_scan, const uint8_t* src_scan, int width, const uint8_t* clip_scan, - const uint8_t* src_extra_alpha = nullptr, - uint8_t* dst_extra_alpha = nullptr); + const uint8_t* src_extra_alpha, + uint8_t* dst_extra_alpha); void CompositePalBitmapLine(uint8_t* dest_scan, const uint8_t* src_scan, int src_left, int width, const uint8_t* clip_scan, - const uint8_t* src_extra_alpha = nullptr, - uint8_t* dst_extra_alpha = nullptr); + const uint8_t* src_extra_alpha, + uint8_t* dst_extra_alpha); void CompositeByteMaskLine(uint8_t* dest_scan, const uint8_t* src_scan, int width, const uint8_t* clip_scan, - uint8_t* dst_extra_alpha = nullptr); + uint8_t* dst_extra_alpha); void CompositeBitMaskLine(uint8_t* dest_scan, const uint8_t* src_scan, int src_left, int width, const uint8_t* clip_scan, - uint8_t* dst_extra_alpha = nullptr); + uint8_t* dst_extra_alpha); private: + void InitSourcePalette(FXDIB_Format src_format, + FXDIB_Format dest_format, + const uint32_t* pSrcPalette); + + void InitSourceMask(int alpha_flag, uint32_t mask_color); + int m_Transparency; FXDIB_Format m_SrcFormat; FXDIB_Format m_DestFormat; - uint32_t* m_pSrcPalette; + std::unique_ptr<uint32_t, FxFreeDeleter> m_pSrcPalette; int m_MaskAlpha; int m_MaskRed; int m_MaskGreen; int m_MaskBlue; - int m_MaskBlack; int m_BlendType; - uint8_t* m_pCacheScanline; - int m_CacheSize; bool m_bRgbByteOrder; }; |