blob: 8cc8a0b92b4d7325375f8fde74c8a1d5475ec726 [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 SkColorFilterShader_DEFINED
#define SkColorFilterShader_DEFINED
#include "include/core/SkColorFilter.h"
#include "src/shaders/SkShaderBase.h"
class SkArenaAlloc;
class SkColorFilterShader : public SkShaderBase {
SkColorFilterShader(sk_sp<SkShader> shader, float alpha, sk_sp<SkColorFilter> filter);
std::unique_ptr<GrFragmentProcessor> asFragmentProcessor(const GrFPArgs&) const override;
bool isOpaque() const override;
void flatten(SkWriteBuffer&) const override;
bool onAppendStages(const SkStageRec&) const override;
bool onProgram(skvm::Builder*,
SkColorSpace* dstCS,
skvm::Uniforms* uniforms,
skvm::F32 x, skvm::F32 y,
skvm::F32* r, skvm::F32* g, skvm::F32* b, skvm::F32* a) const override;
sk_sp<SkShader> fShader;
sk_sp<SkColorFilter> fFilter;
float fAlpha;
typedef SkShaderBase INHERITED;