summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_iccprofile.h
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-07-12 11:04:12 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-07-12 18:26:43 +0000
commit58bf3de718e510648ee136c887be5b2d577644a7 (patch)
treefceba4f29df5fc6ecf4da1cf41d6bae0cdda05d2 /core/fpdfapi/page/cpdf_iccprofile.h
parent071f5eda0399d6f260cc1b67beffcdaa315a9af7 (diff)
downloadpdfium-58bf3de718e510648ee136c887be5b2d577644a7.tar.xz
Cleanup ICC code part 1
This CL switches void* to CLcmsCmm*, simplifies the ownership and destruction of CLcmsCmm, and reduces unnecessary function calling in fx_codec_icc.cpp. Change-Id: Ifdbf59dcdaede497d1684b161dd066726cf08ee3 Reviewed-on: https://pdfium-review.googlesource.com/7590 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_iccprofile.h')
-rw-r--r--core/fpdfapi/page/cpdf_iccprofile.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/fpdfapi/page/cpdf_iccprofile.h b/core/fpdfapi/page/cpdf_iccprofile.h
index a0cf744b9c..156fb595dc 100644
--- a/core/fpdfapi/page/cpdf_iccprofile.h
+++ b/core/fpdfapi/page/cpdf_iccprofile.h
@@ -7,6 +7,9 @@
#ifndef CORE_FPDFAPI_PAGE_CPDF_ICCPROFILE_H_
#define CORE_FPDFAPI_PAGE_CPDF_ICCPROFILE_H_
+#include <memory>
+
+#include "core/fxcodec/codec/ccodec_iccmodule.h"
#include "core/fxcrt/cfx_retain_ptr.h"
#include "core/fxcrt/cfx_unowned_ptr.h"
@@ -20,8 +23,8 @@ class CPDF_IccProfile : public CFX_Retainable {
CPDF_Stream* GetStream() const { return m_pStream.Get(); }
bool IsValid() const { return IsSRGB() || IsSupported(); }
bool IsSRGB() const { return m_bsRGB; }
- bool IsSupported() const { return !!m_pTransform; }
- void* transform() { return m_pTransform; }
+ bool IsSupported() const { return !!m_Transform; }
+ CLcmsCmm* transform() { return m_Transform.get(); }
uint32_t GetComponents() const { return m_nSrcComponents; }
private:
@@ -30,7 +33,7 @@ class CPDF_IccProfile : public CFX_Retainable {
const bool m_bsRGB;
CFX_UnownedPtr<CPDF_Stream> const m_pStream;
- void* m_pTransform = nullptr;
+ std::unique_ptr<CLcmsCmm> m_Transform;
uint32_t m_nSrcComponents = 0;
};