summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-08-24 21:55:46 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-24 21:55:46 +0000
commite6ff2ebfaa19421c8d932f4d275548156ae2e13c (patch)
treea549775ce9d4e999f8a23542524adba8c5ca42ea /core/fpdfapi/page
parent16d18d935d055b74e05f615c0325318a329a7fe1 (diff)
downloadpdfium-e6ff2ebfaa19421c8d932f4d275548156ae2e13c.tar.xz
Rename CFX_DIBSource to CFX_DIBBase.
It is not a source from which you can get CFX_DIBs, but rather a base class from which all DIBs inherit. Do the same thing for the CPDF_DIBSource wrapper class. Mechanical change apart from adding a one-line comment in cfx_dibbase.h Change-Id: Id2bde87813ca301d9fafc55ce08d703dfc6a7184 Reviewed-on: https://pdfium-review.googlesource.com/41352 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi/page')
-rw-r--r--core/fpdfapi/page/cpdf_generalstate.cpp2
-rw-r--r--core/fpdfapi/page/cpdf_image.cpp52
-rw-r--r--core/fpdfapi/page/cpdf_image.h22
3 files changed, 38 insertions, 38 deletions
diff --git a/core/fpdfapi/page/cpdf_generalstate.cpp b/core/fpdfapi/page/cpdf_generalstate.cpp
index 2657578ab7..ea912736fe 100644
--- a/core/fpdfapi/page/cpdf_generalstate.cpp
+++ b/core/fpdfapi/page/cpdf_generalstate.cpp
@@ -8,7 +8,7 @@
#include "constants/transparency.h"
#include "core/fpdfapi/parser/cpdf_document.h"
-#include "core/fpdfapi/render/cpdf_dibsource.h"
+#include "core/fpdfapi/render/cpdf_dibbase.h"
#include "core/fpdfapi/render/cpdf_docrenderdata.h"
#include "core/fpdfapi/render/cpdf_transferfunc.h"
diff --git a/core/fpdfapi/page/cpdf_image.cpp b/core/fpdfapi/page/cpdf_image.cpp
index a1be407dfe..b1c2fc9e82 100644
--- a/core/fpdfapi/page/cpdf_image.cpp
+++ b/core/fpdfapi/page/cpdf_image.cpp
@@ -23,7 +23,7 @@
#include "core/fpdfapi/parser/cpdf_reference.h"
#include "core/fpdfapi/parser/cpdf_stream.h"
#include "core/fpdfapi/parser/cpdf_string.h"
-#include "core/fpdfapi/render/cpdf_dibsource.h"
+#include "core/fpdfapi/render/cpdf_dibbase.h"
#include "core/fpdfapi/render/cpdf_pagerendercache.h"
#include "core/fxcodec/codec/ccodec_jpegmodule.h"
#include "core/fxcrt/fx_stream.h"
@@ -329,43 +329,43 @@ void CPDF_Image::ResetCache(CPDF_Page* pPage,
pPage->GetRenderCache()->ResetBitmap(pHolder, pBitmap);
}
-RetainPtr<CFX_DIBSource> CPDF_Image::LoadDIBSource() const {
- auto source = pdfium::MakeRetain<CPDF_DIBSource>();
+RetainPtr<CFX_DIBBase> CPDF_Image::LoadDIBBase() const {
+ auto source = pdfium::MakeRetain<CPDF_DIBBase>();
if (!source->Load(m_pDocument.Get(), m_pStream.Get()))
return nullptr;
if (!source->IsJBigImage())
return source;
- CPDF_DIBSource::LoadState ret = CPDF_DIBSource::LoadState::kContinue;
- while (ret == CPDF_DIBSource::LoadState::kContinue)
- ret = source->ContinueLoadDIBSource(nullptr);
- return ret == CPDF_DIBSource::LoadState::kSuccess ? source : nullptr;
+ CPDF_DIBBase::LoadState ret = CPDF_DIBBase::LoadState::kContinue;
+ while (ret == CPDF_DIBBase::LoadState::kContinue)
+ ret = source->ContinueLoadDIBBase(nullptr);
+ return ret == CPDF_DIBBase::LoadState::kSuccess ? source : nullptr;
}
-RetainPtr<CFX_DIBSource> CPDF_Image::DetachBitmap() {
- return std::move(m_pDIBSource);
+RetainPtr<CFX_DIBBase> CPDF_Image::DetachBitmap() {
+ return std::move(m_pDIBBase);
}
-RetainPtr<CFX_DIBSource> CPDF_Image::DetachMask() {
+RetainPtr<CFX_DIBBase> CPDF_Image::DetachMask() {
return std::move(m_pMask);
}
-bool CPDF_Image::StartLoadDIBSource(const CPDF_Dictionary* pFormResource,
- CPDF_Dictionary* pPageResource,
- bool bStdCS,
- uint32_t GroupFamily,
- bool bLoadMask) {
- auto source = pdfium::MakeRetain<CPDF_DIBSource>();
- CPDF_DIBSource::LoadState ret = source->StartLoadDIBSource(
+bool CPDF_Image::StartLoadDIBBase(const CPDF_Dictionary* pFormResource,
+ CPDF_Dictionary* pPageResource,
+ bool bStdCS,
+ uint32_t GroupFamily,
+ bool bLoadMask) {
+ auto source = pdfium::MakeRetain<CPDF_DIBBase>();
+ CPDF_DIBBase::LoadState ret = source->StartLoadDIBBase(
m_pDocument.Get(), m_pStream.Get(), true, pFormResource, pPageResource,
bStdCS, GroupFamily, bLoadMask);
- if (ret == CPDF_DIBSource::LoadState::kFail) {
- m_pDIBSource.Reset();
+ if (ret == CPDF_DIBBase::LoadState::kFail) {
+ m_pDIBBase.Reset();
return false;
}
- m_pDIBSource = source;
- if (ret == CPDF_DIBSource::LoadState::kContinue)
+ m_pDIBBase = source;
+ if (ret == CPDF_DIBBase::LoadState::kContinue)
return true;
m_pMask = source->DetachMask();
@@ -374,16 +374,16 @@ bool CPDF_Image::StartLoadDIBSource(const CPDF_Dictionary* pFormResource,
}
bool CPDF_Image::Continue(PauseIndicatorIface* pPause) {
- RetainPtr<CPDF_DIBSource> pSource = m_pDIBSource.As<CPDF_DIBSource>();
- CPDF_DIBSource::LoadState ret = pSource->ContinueLoadDIBSource(pPause);
- if (ret == CPDF_DIBSource::LoadState::kContinue)
+ RetainPtr<CPDF_DIBBase> pSource = m_pDIBBase.As<CPDF_DIBBase>();
+ CPDF_DIBBase::LoadState ret = pSource->ContinueLoadDIBBase(pPause);
+ if (ret == CPDF_DIBBase::LoadState::kContinue)
return true;
- if (ret == CPDF_DIBSource::LoadState::kSuccess) {
+ if (ret == CPDF_DIBBase::LoadState::kSuccess) {
m_pMask = pSource->DetachMask();
m_MatteColor = pSource->GetMatteColor();
} else {
- m_pDIBSource.Reset();
+ m_pDIBBase.Reset();
}
return false;
}
diff --git a/core/fpdfapi/page/cpdf_image.h b/core/fpdfapi/page/cpdf_image.h
index e6c6d18986..4306109199 100644
--- a/core/fpdfapi/page/cpdf_image.h
+++ b/core/fpdfapi/page/cpdf_image.h
@@ -15,7 +15,7 @@
#include "core/fxcrt/retain_ptr.h"
#include "core/fxcrt/unowned_ptr.h"
-class CFX_DIBSource;
+class CFX_DIBBase;
class CFX_DIBitmap;
class CPDF_Document;
class CPDF_Page;
@@ -41,7 +41,7 @@ class CPDF_Image : public Retainable {
bool IsMask() const { return m_bIsMask; }
bool IsInterpol() const { return m_bInterpolate; }
- RetainPtr<CFX_DIBSource> LoadDIBSource() const;
+ RetainPtr<CFX_DIBBase> LoadDIBBase() const;
void SetImage(const RetainPtr<CFX_DIBitmap>& pDIBitmap);
void SetJpegImage(const RetainPtr<IFX_SeekableReadStream>& pFile);
@@ -50,20 +50,20 @@ class CPDF_Image : public Retainable {
void ResetCache(CPDF_Page* pPage, const RetainPtr<CFX_DIBitmap>& pDIBitmap);
// Returns whether to Continue() or not.
- bool StartLoadDIBSource(const CPDF_Dictionary* pFormResource,
- CPDF_Dictionary* pPageResource,
- bool bStdCS,
- uint32_t GroupFamily,
- bool bLoadMask);
+ bool StartLoadDIBBase(const CPDF_Dictionary* pFormResource,
+ CPDF_Dictionary* pPageResource,
+ bool bStdCS,
+ uint32_t GroupFamily,
+ bool bLoadMask);
// Returns whether to Continue() or not.
bool Continue(PauseIndicatorIface* pPause);
- RetainPtr<CFX_DIBSource> DetachBitmap();
- RetainPtr<CFX_DIBSource> DetachMask();
+ RetainPtr<CFX_DIBBase> DetachBitmap();
+ RetainPtr<CFX_DIBBase> DetachMask();
- RetainPtr<CFX_DIBSource> m_pDIBSource;
- RetainPtr<CFX_DIBSource> m_pMask;
+ RetainPtr<CFX_DIBBase> m_pDIBBase;
+ RetainPtr<CFX_DIBBase> m_pMask;
uint32_t m_MatteColor = 0;
private: