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/fpdfapi/render/cpdf_type3cache.cpp | |
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/fpdfapi/render/cpdf_type3cache.cpp')
-rw-r--r-- | core/fpdfapi/render/cpdf_type3cache.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/fpdfapi/render/cpdf_type3cache.cpp b/core/fpdfapi/render/cpdf_type3cache.cpp index 11e5946e05..4638fccb92 100644 --- a/core/fpdfapi/render/cpdf_type3cache.cpp +++ b/core/fpdfapi/render/cpdf_type3cache.cpp @@ -146,7 +146,8 @@ std::unique_ptr<CFX_GlyphBitmap> CPDF_Type3Cache::RenderGlyph( return nullptr; pResBitmap = pBitmap->StretchTo(static_cast<int>(image_matrix.a), - safe_height.ValueOrDie(), 0, nullptr); + safe_height.ValueOrDie(), + FXDIB_ResampleOptions(), nullptr); top = top_line; if (image_matrix.a < 0) left = FXSYS_round(image_matrix.e + image_matrix.a); |