blob: d92dce78209978e060518b67da3601f0b5b263db [file] [log] [blame]
* Copyright 2018 Google Inc.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
#ifndef GrYUVtoRGBEffect_DEFINED
#define GrYUVtoRGBEffect_DEFINED
#include "include/core/SkTypes.h"
#include "include/core/SkYUVAIndex.h"
#include "src/gpu/GrFragmentProcessor.h"
class GrYUVtoRGBEffect : public GrFragmentProcessor {
static std::unique_ptr<GrFragmentProcessor> Make(GrSurfaceProxyView views[],
const SkYUVAIndex indices[4],
SkYUVColorSpace yuvColorSpace,
GrSamplerState samplerState,
const GrCaps&,
const SkMatrix& localMatrix = SkMatrix::I(),
const SkRect* subset = nullptr);
#ifdef SK_DEBUG
SkString dumpInfo() const override;
std::unique_ptr<GrFragmentProcessor> clone() const override;
const char* name() const override { return "YUVtoRGBEffect"; }
GrYUVtoRGBEffect(std::unique_ptr<GrFragmentProcessor> planeFPs[4],
int numPlanes,
const SkYUVAIndex yuvaIndices[4],
const bool snap[2],
SkYUVColorSpace yuvColorSpace);
GrYUVtoRGBEffect(const GrYUVtoRGBEffect& src);
GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
SkYUVAIndex fYUVAIndices[4];
SkYUVColorSpace fYUVColorSpace;
bool fSnap[2];