diff options
author | Lei Zhang <thestig@chromium.org> | 2018-09-19 17:26:54 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-09-19 17:26:54 +0000 |
commit | 174de19776de251aed79220742ecde3e2e435fed (patch) | |
tree | 370894c812460b9f45fca904503eadc0322c6089 /core/fpdfapi/render/cpdf_imageloader.cpp | |
parent | 5f2ea0f6ef587f9f7a2fec9f80dbc82b94c97400 (diff) | |
download | pdfium-174de19776de251aed79220742ecde3e2e435fed.tar.xz |
Encapsulate CPDF_ImageLoader.
Change-Id: Iee7ce04630fed86f651cd382a19e46b2f7ab6d61
Reviewed-on: https://pdfium-review.googlesource.com/42672
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/render/cpdf_imageloader.cpp')
-rw-r--r-- | core/fpdfapi/render/cpdf_imageloader.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/core/fpdfapi/render/cpdf_imageloader.cpp b/core/fpdfapi/render/cpdf_imageloader.cpp index 157bc48d1b..d7b7bb8354 100644 --- a/core/fpdfapi/render/cpdf_imageloader.cpp +++ b/core/fpdfapi/render/cpdf_imageloader.cpp @@ -12,14 +12,12 @@ #include "core/fpdfapi/render/cpdf_imagecacheentry.h" #include "core/fpdfapi/render/cpdf_pagerendercache.h" #include "core/fpdfapi/render/cpdf_renderstatus.h" +#include "core/fpdfapi/render/cpdf_transferfunc.h" +#include "core/fxge/dib/cfx_dibitmap.h" -CPDF_ImageLoader::CPDF_ImageLoader() - : m_MatteColor(0), - m_bCached(false), - m_pCache(nullptr), - m_pImageObject(nullptr) {} +CPDF_ImageLoader::CPDF_ImageLoader() = default; -CPDF_ImageLoader::~CPDF_ImageLoader() {} +CPDF_ImageLoader::~CPDF_ImageLoader() = default; bool CPDF_ImageLoader::Start(CPDF_ImageObject* pImage, CPDF_PageRenderCache* pCache, @@ -52,6 +50,18 @@ bool CPDF_ImageLoader::Continue(PauseIndicatorIface* pPause, return ret; } +RetainPtr<CFX_DIBBase> CPDF_ImageLoader::TranslateImage( + const RetainPtr<CPDF_TransferFunc>& pTransferFunc) { + ASSERT(pTransferFunc); + ASSERT(!pTransferFunc->GetIdentity()); + + m_pBitmap = pTransferFunc->TranslateImage(m_pBitmap); + if (m_bCached && m_pMask) + m_pMask = m_pMask->Clone(nullptr); + m_bCached = false; + return m_pBitmap; +} + void CPDF_ImageLoader::HandleFailure() { if (m_pCache) { CPDF_ImageCacheEntry* entry = m_pCache->GetCurImageCacheEntry(); |