summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render/cpdf_dibsource.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-05-11 16:57:06 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-11 16:57:06 +0000
commitddfa5177021f76b4d84c6fbdce964ab3ca17e046 (patch)
tree22b410528ebe79cd00c50bd20669a8326c61a7d7 /core/fpdfapi/render/cpdf_dibsource.h
parent5e0b271b69355b5692b6afd1cd2c04d08c3b380c (diff)
downloadpdfium-ddfa5177021f76b4d84c6fbdce964ab3ca17e046.tar.xz
Use more smart pointer types in CPDF_DIBSource.
Use one std::vector<>, too. As a result, make GetDecodeAndMaskArray() update that member directly rather than forcing callers to assign to it each time. Change-Id: I51a039b9e8cce7ff885edf395622eaf6a5c4816a Reviewed-on: https://pdfium-review.googlesource.com/32313 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/render/cpdf_dibsource.h')
-rw-r--r--core/fpdfapi/render/cpdf_dibsource.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/fpdfapi/render/cpdf_dibsource.h b/core/fpdfapi/render/cpdf_dibsource.h
index 452c347ac3..4646bf2fe9 100644
--- a/core/fpdfapi/render/cpdf_dibsource.h
+++ b/core/fpdfapi/render/cpdf_dibsource.h
@@ -62,7 +62,7 @@ class CPDF_DIBSource : public CFX_DIBSource {
int clip_left,
int clip_width) const override;
- const CPDF_ColorSpace* GetColorSpace() const { return m_pColorSpace; }
+ const CPDF_ColorSpace* GetColorSpace() const { return m_pColorSpace.Get(); }
uint32_t GetMatteColor() const { return m_MatteColor; }
LoadState StartLoadDIBSource(CPDF_Document* pDoc,
@@ -87,7 +87,7 @@ class CPDF_DIBSource : public CFX_DIBSource {
LoadState ContinueLoadMaskDIB(PauseIndicatorIface* pPause);
bool LoadColorInfo(const CPDF_Dictionary* pFormResources,
const CPDF_Dictionary* pPageResources);
- DIB_COMP_DATA* GetDecodeAndMaskArray(bool* bDefaultDecode, bool* bColorKey);
+ bool GetDecodeAndMaskArray(bool* bDefaultDecode, bool* bColorKey);
RetainPtr<CFX_DIBitmap> LoadJpxBitmap();
void LoadPalette();
LoadState CreateDecoder();
@@ -132,7 +132,7 @@ class CPDF_DIBSource : public CFX_DIBSource {
UnownedPtr<const CPDF_Stream> m_pStream;
UnownedPtr<const CPDF_Dictionary> m_pDict;
RetainPtr<CPDF_StreamAcc> m_pStreamAcc;
- CPDF_ColorSpace* m_pColorSpace = nullptr;
+ UnownedPtr<CPDF_ColorSpace> m_pColorSpace;
uint32_t m_Family = 0;
uint32_t m_bpc = 0;
uint32_t m_bpc_orig = 0;
@@ -146,9 +146,9 @@ class CPDF_DIBSource : public CFX_DIBSource {
bool m_bColorKey = false;
bool m_bHasMask = false;
bool m_bStdCS = false;
- DIB_COMP_DATA* m_pCompData = nullptr;
- uint8_t* m_pLineBuf = nullptr;
- uint8_t* m_pMaskedLine = nullptr;
+ std::vector<DIB_COMP_DATA> m_CompData;
+ std::unique_ptr<uint8_t, FxFreeDeleter> m_pLineBuf;
+ std::unique_ptr<uint8_t, FxFreeDeleter> m_pMaskedLine;
RetainPtr<CFX_DIBitmap> m_pCachedBitmap;
RetainPtr<CPDF_DIBSource> m_pMask;
RetainPtr<CPDF_StreamAcc> m_pGlobalStream;