#include "cc/paint/color_filter.h"
#include <algorithm>
#include <utility>
#include "base/check_op.h"
#include "base/memory/values_equivalent.h"
#include "cc/paint/paint_op_reader.h"
#include "cc/paint/paint_op_writer.h"
#include "third_party/skia/include/core/SkColorFilter.h"
#include "third_party/skia/include/core/SkColorTable.h"
#include "third_party/skia/include/effects/SkHighContrastFilter.h"
#include "third_party/skia/include/effects/SkLumaColorFilter.h"
namespace cc {
namespace {
class MatrixColorFilter final : public ColorFilter { … };
class BlendColorFilter final : public ColorFilter { … };
class SRGBToLinearGammaColorFilter final : public ColorFilter { … };
class LinearToSRGBGammaColorFilter final : public ColorFilter { … };
class LumaColorFilter final : public ColorFilter { … };
class TableColorFilter : public ColorFilter { … };
class HighContrastColorFilter final : public ColorFilter { … };
}
ColorFilter::~ColorFilter() = default;
ColorFilter::ColorFilter(Type type, sk_sp<SkColorFilter> sk_color_filter)
: … { … }
sk_sp<ColorFilter> ColorFilter::MakeMatrix(const float matrix[20]) { … }
sk_sp<ColorFilter> ColorFilter::MakeBlend(const SkColor4f& color,
SkBlendMode blend_mode) { … }
sk_sp<ColorFilter> ColorFilter::MakeSRGBToLinearGamma() { … }
sk_sp<ColorFilter> ColorFilter::MakeLinearToSRGBGamma() { … }
sk_sp<ColorFilter> ColorFilter::MakeTableARGB(const uint8_t a_table[256],
const uint8_t r_table[256],
const uint8_t g_table[256],
const uint8_t b_table[256]) { … }
sk_sp<ColorFilter> ColorFilter::MakeTable(sk_sp<SkColorTable> table) { … }
sk_sp<ColorFilter> ColorFilter::MakeLuma() { … }
sk_sp<ColorFilter> ColorFilter::MakeHighContrast(
const SkHighContrastConfig& config) { … }
SkColor4f ColorFilter::FilterColor(const SkColor4f& color) const { … }
bool ColorFilter::EqualsForTesting(const ColorFilter& other) const { … }
size_t ColorFilter::SerializedDataSize() const { … }
void ColorFilter::SerializeData(PaintOpWriter& writer) const { … }
sk_sp<ColorFilter> ColorFilter::Deserialize(PaintOpReader& reader, Type type) { … }
}