summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_color.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-12-20 15:18:26 -0800
committerChromium commit bot <commit-bot@chromium.org>2017-12-21 19:28:25 +0000
commit891aaf63b3490989a189bcc51b18647073f988d4 (patch)
treecaeb000b1bf284bd6c73b70aa2953cfd071ebae0 /core/fpdfapi/page/cpdf_color.h
parentf2af8326501d72bf3fb23f0c62ade28310836ba9 (diff)
downloadpdfium-chromium/3301.tar.xz
Clean up CPDF_Color.chromium/3301
- Add IsPatternInternal(). - Mark some method parameters const. - Explain relationship between member variables. Change-Id: I650e18012341199985a4537e08c787e46cf8fef7 Reviewed-on: https://pdfium-review.googlesource.com/21912 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_color.h')
-rw-r--r--core/fpdfapi/page/cpdf_color.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/core/fpdfapi/page/cpdf_color.h b/core/fpdfapi/page/cpdf_color.h
index cb7352806e..2eac7cfacb 100644
--- a/core/fpdfapi/page/cpdf_color.h
+++ b/core/fpdfapi/page/cpdf_color.h
@@ -23,8 +23,8 @@ class CPDF_Color {
void Copy(const CPDF_Color* pSrc);
void SetColorSpace(CPDF_ColorSpace* pCS);
- void SetValue(float* comp);
- void SetValue(CPDF_Pattern* pPattern, float* comp, uint32_t ncomps);
+ void SetValue(const float* comp);
+ void SetValue(CPDF_Pattern* pPattern, const float* comp, uint32_t ncomps);
bool GetRGB(int* R, int* G, int* B) const;
CPDF_Pattern* GetPattern() const;
@@ -33,9 +33,13 @@ class CPDF_Color {
protected:
void ReleaseBuffer();
void ReleaseColorSpace();
+ bool IsPatternInternal() const;
- CPDF_ColorSpace* m_pCS;
- float* m_pBuffer;
+ // TODO(thestig): Convert this to a smart pointer or vector.
+ // |m_pBuffer| is created by |m_pCS|, so if it is non-null, then so is
+ // |m_pCS|.
+ float* m_pBuffer = nullptr;
+ CPDF_ColorSpace* m_pCS = nullptr;
};
#endif // CORE_FPDFAPI_PAGE_CPDF_COLOR_H_