summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render/cpdf_transferfunc.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-04-03 14:05:17 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-03 21:47:59 +0000
commit3a1d9b48cb5485cdb93f1cc9857e5d829868629c (patch)
tree9f49629c7bb9a73357821841da549ac9149d7b12 /core/fpdfapi/render/cpdf_transferfunc.h
parentac35589d5d1a593497cf28d91ab6a236f25833c3 (diff)
downloadpdfium-3a1d9b48cb5485cdb93f1cc9857e5d829868629c.tar.xz
RefCount CPDF_TransferFunc all the time.
Prefer internal reference counts over ad-hoc schemes. Change-Id: I8d420e9e9827ac39fdc0bc8146a532caeee10f26 Reviewed-on: https://pdfium-review.googlesource.com/3615 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi/render/cpdf_transferfunc.h')
-rw-r--r--core/fpdfapi/render/cpdf_transferfunc.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/fpdfapi/render/cpdf_transferfunc.h b/core/fpdfapi/render/cpdf_transferfunc.h
index 05219d49db..8f94d9605d 100644
--- a/core/fpdfapi/render/cpdf_transferfunc.h
+++ b/core/fpdfapi/render/cpdf_transferfunc.h
@@ -7,13 +7,15 @@
#ifndef CORE_FPDFAPI_RENDER_CPDF_TRANSFERFUNC_H_
#define CORE_FPDFAPI_RENDER_CPDF_TRANSFERFUNC_H_
+#include "core/fxcrt/cfx_retain_ptr.h"
#include "core/fxge/fx_dib.h"
class CPDF_Document;
-class CPDF_TransferFunc {
+class CPDF_TransferFunc : public CFX_Retainable {
public:
- explicit CPDF_TransferFunc(CPDF_Document* pDoc);
+ template <typename T, typename... Args>
+ friend CFX_RetainPtr<T> pdfium::MakeRetain(Args&&... args);
FX_COLORREF TranslateColor(FX_COLORREF src) const;
CFX_RetainPtr<CFX_DIBSource> TranslateImage(
@@ -22,6 +24,10 @@ class CPDF_TransferFunc {
CPDF_Document* const m_pPDFDoc;
bool m_bIdentity;
uint8_t m_Samples[256 * 3];
+
+ private:
+ explicit CPDF_TransferFunc(CPDF_Document* pDoc);
+ ~CPDF_TransferFunc() override;
};
#endif // CORE_FPDFAPI_RENDER_CPDF_TRANSFERFUNC_H_