summaryrefslogtreecommitdiff
path: root/core/fxge/dib/cstretchengine.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-03-15 14:58:07 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-15 14:58:07 +0000
commitd1ffda2acaee90a7b8a6dd36e0605dce826058e9 (patch)
tree27875f01b348bc350258cbe351b367bd4b84a27b /core/fxge/dib/cstretchengine.h
parent40c223e4ed41e991f81281ca08b3085e218c52dc (diff)
downloadpdfium-d1ffda2acaee90a7b8a6dd36e0605dce826058e9.tar.xz
Cleanup CStretchEngine.
- Make members const. - Change some ints to enum classes. - Add helper function to calculate pitch. Change-Id: I32f94e1189d54a2c365530166fb5c9c0857b7c97 Reviewed-on: https://pdfium-review.googlesource.com/28571 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fxge/dib/cstretchengine.h')
-rw-r--r--core/fxge/dib/cstretchengine.h48
1 files changed, 30 insertions, 18 deletions
diff --git a/core/fxge/dib/cstretchengine.h b/core/fxge/dib/cstretchengine.h
index 91530cc01f..fa298f5376 100644
--- a/core/fxge/dib/cstretchengine.h
+++ b/core/fxge/dib/cstretchengine.h
@@ -57,31 +57,43 @@ class CStretchEngine {
size_t m_dwWeightTablesSize;
};
- FXDIB_Format m_DestFormat;
- int m_DestBpp;
- int m_SrcBpp;
- int m_bHasAlpha;
- UnownedPtr<ScanlineComposerIface> m_pDestBitmap;
- int m_DestWidth;
- int m_DestHeight;
- FX_RECT m_DestClip;
+ enum class State : uint8_t { kInitial, kHorizontal, kVertical };
+
+ enum class TransformMethod : uint8_t {
+ k1BppTo8Bpp,
+ k1BppToManyBpp,
+ k8BppTo8Bpp,
+ k8BppTo8BppWithAlpha,
+ k8BppToManyBpp,
+ k8BppToManyBppWithAlpha,
+ kManyBpptoManyBpp,
+ kManyBpptoManyBppWithAlpha
+ };
+
+ const FXDIB_Format m_DestFormat;
+ const int m_DestBpp;
+ const int m_SrcBpp;
+ const int m_bHasAlpha;
+ RetainPtr<CFX_DIBSource> const m_pSource;
+ const uint32_t* m_pSrcPalette;
+ const int m_SrcWidth;
+ const int m_SrcHeight;
+ UnownedPtr<ScanlineComposerIface> const m_pDestBitmap;
+ const int m_DestWidth;
+ const int m_DestHeight;
+ const FX_RECT m_DestClip;
std::vector<uint8_t> m_DestScanline;
std::vector<uint8_t> m_DestMaskScanline;
+ std::vector<uint8_t> m_InterBuf;
+ std::vector<uint8_t> m_ExtraAlphaBuf;
FX_RECT m_SrcClip;
- RetainPtr<CFX_DIBSource> m_pSource;
- uint32_t* m_pSrcPalette;
- int m_SrcWidth;
- int m_SrcHeight;
- int m_SrcPitch;
int m_InterPitch;
int m_ExtraMaskPitch;
- std::vector<uint8_t> m_InterBuf;
- std::vector<uint8_t> m_ExtraAlphaBuf;
- int m_TransMethod;
int m_Flags;
- CWeightTable m_WeightTable;
+ TransformMethod m_TransMethod;
+ State m_State = State::kInitial;
int m_CurRow;
- int m_State;
+ CWeightTable m_WeightTable;
};
#endif // CORE_FXGE_DIB_CSTRETCHENGINE_H_