diff options
Diffstat (limited to 'core/fpdfapi/page/cpdf_colorstate.h')
-rw-r--r-- | core/fpdfapi/page/cpdf_colorstate.h | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/core/fpdfapi/page/cpdf_colorstate.h b/core/fpdfapi/page/cpdf_colorstate.h index f0f6ebdd0..ec2de6b48 100644 --- a/core/fpdfapi/page/cpdf_colorstate.h +++ b/core/fpdfapi/page/cpdf_colorstate.h @@ -1,4 +1,4 @@ -// Copyright 2016 PDFium Authors. All rights reserved. +// Copyright 2016 The PDFium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -10,12 +10,11 @@ #include <vector> #include "core/fpdfapi/page/cpdf_color.h" -#include "core/fxcrt/fx_system.h" #include "core/fxcrt/retain_ptr.h" #include "core/fxcrt/shared_copy_on_write.h" -#include "core/fxge/fx_dib.h" +#include "core/fxge/dib/fx_dib.h" +#include "third_party/base/span.h" -class CPDF_Color; class CPDF_ColorSpace; class CPDF_Pattern; @@ -42,22 +41,21 @@ class CPDF_ColorState { CPDF_Color* GetMutableStrokeColor(); bool HasStrokeColor() const; - void SetFillColor(const RetainPtr<CPDF_ColorSpace>& pCS, - const std::vector<float>& values); - void SetStrokeColor(const RetainPtr<CPDF_ColorSpace>& pCS, - const std::vector<float>& values); - void SetFillPattern(const RetainPtr<CPDF_Pattern>& pattern, - const std::vector<float>& values); - void SetStrokePattern(const RetainPtr<CPDF_Pattern>& pattern, - const std::vector<float>& values); + void SetFillColor(RetainPtr<CPDF_ColorSpace> colorspace, + std::vector<float> values); + void SetStrokeColor(RetainPtr<CPDF_ColorSpace> colorspace, + std::vector<float> values); + void SetFillPattern(RetainPtr<CPDF_Pattern> pattern, + pdfium::span<float> values); + void SetStrokePattern(RetainPtr<CPDF_Pattern> pattern, + pdfium::span<float> values); bool HasRef() const { return !!m_Ref; } private: class ColorData final : public Retainable { public: - template <typename T, typename... Args> - friend RetainPtr<T> pdfium::MakeRetain(Args&&... args); + CONSTRUCT_VIA_MAKE_RETAIN; RetainPtr<ColorData> Clone() const; @@ -74,12 +72,12 @@ class CPDF_ColorState { ~ColorData() override; }; - void SetColor(const RetainPtr<CPDF_ColorSpace>& pCS, - const std::vector<float>& values, + void SetColor(RetainPtr<CPDF_ColorSpace> colorspace, + std::vector<float> values, CPDF_Color* color, FX_COLORREF* colorref); - void SetPattern(const RetainPtr<CPDF_Pattern>& pPattern, - const std::vector<float>& values, + void SetPattern(RetainPtr<CPDF_Pattern> pattern, + pdfium::span<float> values, CPDF_Color* color, FX_COLORREF* colorref); |