From 5883300439287ab46559231ce8aed11e92bbc97c Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 26 Oct 2018 22:52:48 +0000 Subject: 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 Reviewed-by: Tom Sepez --- core/fxge/win32/cfx_psrenderer.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/fxge/win32/cfx_psrenderer.h') diff --git a/core/fxge/win32/cfx_psrenderer.h b/core/fxge/win32/cfx_psrenderer.h index b5107d9ab1..9b1d86b8fc 100644 --- a/core/fxge/win32/cfx_psrenderer.h +++ b/core/fxge/win32/cfx_psrenderer.h @@ -24,6 +24,7 @@ class CFX_Matrix; class CFX_PathData; class CPSFont; class FXTEXT_CHARPOS; +struct FXDIB_ResampleOptions; class CFX_PSRenderer { public: @@ -62,11 +63,11 @@ class CFX_PSRenderer { int dest_top, int dest_width, int dest_height, - uint32_t flags); + const FXDIB_ResampleOptions& options); bool DrawDIBits(const RetainPtr& pBitmap, uint32_t color, const CFX_Matrix& matrix, - uint32_t flags); + const FXDIB_ResampleOptions& options); bool DrawText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont, -- cgit v1.2.3