summaryrefslogtreecommitdiff
path: root/core/fxge/dib/cfx_filtereddib.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-03-21 17:24:46 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-21 17:24:46 +0000
commit3851aff62c7ad2f9c942b4d5d095ec0e6610bb84 (patch)
treec15c662f2f9ac851c33fe1603057088d4eb319b5 /core/fxge/dib/cfx_filtereddib.cpp
parentbf85feeafdd8791f9dab7bfcd14ff850e015be26 (diff)
downloadpdfium-3851aff62c7ad2f9c942b4d5d095ec0e6610bb84.tar.xz
Add helpers to work with FXDIB_Format.
Helper functions make getting the bpp and component count more readable. Change-Id: Ie0f97d52136d11ef5251f6e22748e87aea289ae1 Reviewed-on: https://pdfium-review.googlesource.com/28572 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'core/fxge/dib/cfx_filtereddib.cpp')
-rw-r--r--core/fxge/dib/cfx_filtereddib.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/fxge/dib/cfx_filtereddib.cpp b/core/fxge/dib/cfx_filtereddib.cpp
index 96fc8062a0..1d5ed6200c 100644
--- a/core/fxge/dib/cfx_filtereddib.cpp
+++ b/core/fxge/dib/cfx_filtereddib.cpp
@@ -17,9 +17,9 @@ void CFX_FilteredDIB::LoadSrc(const RetainPtr<CFX_DIBSource>& pSrc) {
m_Width = pSrc->GetWidth();
m_Height = pSrc->GetHeight();
FXDIB_Format format = GetDestFormat();
- m_bpp = static_cast<uint8_t>(format);
+ m_bpp = GetBppFromFormat(format);
m_AlphaFlag = static_cast<uint8_t>(format >> 8);
- m_Pitch = (m_Width * (format & 0xff) + 31) / 32 * 4;
+ m_Pitch = (m_Width * m_bpp + 31) / 32 * 4;
m_pPalette.reset(GetDestPalette());
m_Scanline.resize(m_Pitch);
}