diff options
author | Lei Zhang <thestig@chromium.org> | 2018-10-26 22:52:48 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-26 22:52:48 +0000 |
commit | 5883300439287ab46559231ce8aed11e92bbc97c (patch) | |
tree | 2c3499da9df5a2c4e2fb9d13f99bde13b7bebb42 /core/fxge/dib/cstretchengine.h | |
parent | 9590dee526c514d87dc1f47569d1136ffcf539ad (diff) | |
download | pdfium-5883300439287ab46559231ce8aed11e92bbc97c.tar.xz |
Replace int flags with struct FXDIB_ResampleOptions.
Using bit values in an int may not be reliable, since different parts of
the code can interpret the bits differently. e.g. FXDIB_DOWNSAMPLE and
RENDER_FORCE_DOWNSAMPLE are defined in different places, but can be used
interchangeably because they just happen to have the same value. It
works but is rather fragile.
Instead, use a struct of bools to explicitly define what different bits
mean. Remove FXDIB_DOWNSAMPLE and friends.
Change-Id: I9cf0c8f94d1ed27edf8dba22b0ab0ee67f2722cc
Reviewed-on: https://pdfium-review.googlesource.com/c/44650
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxge/dib/cstretchengine.h')
-rw-r--r-- | core/fxge/dib/cstretchengine.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/fxge/dib/cstretchengine.h b/core/fxge/dib/cstretchengine.h index 6bb07c662c..c2aaca687f 100644 --- a/core/fxge/dib/cstretchengine.h +++ b/core/fxge/dib/cstretchengine.h @@ -26,7 +26,7 @@ class CStretchEngine { int dest_height, const FX_RECT& clip_rect, const RetainPtr<CFX_DIBBase>& pSrcBitmap, - int flags); + const FXDIB_ResampleOptions& options); ~CStretchEngine(); bool Continue(PauseIndicatorIface* pPause); @@ -46,7 +46,7 @@ class CStretchEngine { int src_len, int src_min, int src_max, - int flags); + const FXDIB_ResampleOptions& options); const PixelWeight* GetPixelWeight(int pixel) const; PixelWeight* GetPixelWeight(int pixel) { @@ -96,7 +96,7 @@ class CStretchEngine { FX_RECT m_SrcClip; int m_InterPitch; int m_ExtraMaskPitch; - int m_Flags; + FXDIB_ResampleOptions m_ResampleOptions; TransformMethod m_TransMethod; State m_State = State::kInitial; int m_CurRow; |