blob: 762bf124b0c6b599cca127ef808a9b2a5ff5a482 [file] [log] [blame]
* Copyright 2016 Google Inc.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
#ifndef SkColorFilter_Matrix_DEFINED
#define SkColorFilter_Matrix_DEFINED
#include "src/core/SkColorFilterBase.h"
class SkColorFilter_Matrix : public SkColorFilterBase {
enum class Domain : uint8_t { kRGBA, kHSLA };
explicit SkColorFilter_Matrix(const float array[20], Domain);
bool onIsAlphaUnchanged() const override { return fAlphaIsUnchanged; }
GrFPResult asFragmentProcessor(std::unique_ptr<GrFragmentProcessor> inputFP,
GrRecordingContext*, const GrColorInfo&) const override;
static void RegisterFlattenables();
void flatten(SkWriteBuffer&) const override;
bool onAsAColorMatrix(float matrix[20]) const override;
bool onAppendStages(const SkStageRec& rec, bool shaderIsOpaque) const override;
skvm::Color onProgram(skvm::Builder*, skvm::Color,
SkColorSpace* dstCS,
skvm::Uniforms* uniforms, SkArenaAlloc*) const override;
float fMatrix[20];
bool fAlphaIsUnchanged;
Domain fDomain;
using INHERITED = SkColorFilterBase;