blob: efc19448f2f9f50a61a47afbfa1fa2c6396c0911 [file] [log] [blame]
Ethan Nicholas7461a4a2017-12-21 14:18:01 -05001/*
Ethan Nicholas130fb3f2018-02-01 12:14:34 -05002 * Copyright 2018 Google Inc.
Ethan Nicholas7461a4a2017-12-21 14:18:01 -05003 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
Ethan Nicholas130fb3f2018-02-01 12:14:34 -05008/**************************************************************************************************
9 *** This file was autogenerated from GrYUVtoRGBEffect.fp; do not modify.
10 **************************************************************************************************/
Ethan Nicholas7461a4a2017-12-21 14:18:01 -050011#ifndef GrYUVtoRGBEffect_DEFINED
12#define GrYUVtoRGBEffect_DEFINED
13#include "SkTypes.h"
Ethan Nicholas7461a4a2017-12-21 14:18:01 -050014#include "GrFragmentProcessor.h"
15#include "GrCoordTransform.h"
16class GrYUVtoRGBEffect : public GrFragmentProcessor {
17public:
18 static std::unique_ptr<GrFragmentProcessor> Make(sk_sp<GrTextureProxy> yProxy,
19 sk_sp<GrTextureProxy> uProxy,
20 sk_sp<GrTextureProxy> vProxy,
Ethan Nicholas7461a4a2017-12-21 14:18:01 -050021 SkYUVColorSpace colorSpace, bool nv12);
Robert Phillipsba5c4392018-07-25 12:37:14 -040022 SkString dumpInfo() const override;
Michael Ludwiga4275592018-08-31 10:52:47 -040023 const SkMatrix44& ySamplerTransform() const { return fYSamplerTransform; }
24 const SkMatrix44& uSamplerTransform() const { return fUSamplerTransform; }
25 const SkMatrix44& vSamplerTransform() const { return fVSamplerTransform; }
26 const SkMatrix44& colorSpaceMatrix() const { return fColorSpaceMatrix; }
27 const bool& nv12() const { return fNv12; }
Ethan Nicholas7461a4a2017-12-21 14:18:01 -050028 static std::unique_ptr<GrFragmentProcessor> Make(
29 sk_sp<GrTextureProxy> ySampler, SkMatrix44 ySamplerTransform,
30 sk_sp<GrTextureProxy> uSampler, SkMatrix44 uSamplerTransform,
31 sk_sp<GrTextureProxy> vSampler, SkMatrix44 vSamplerTransform,
32 SkMatrix44 colorSpaceMatrix, bool nv12, GrSamplerState uvSamplerParams) {
33 return std::unique_ptr<GrFragmentProcessor>(new GrYUVtoRGBEffect(
34 ySampler, ySamplerTransform, uSampler, uSamplerTransform, vSampler,
35 vSamplerTransform, colorSpaceMatrix, nv12, uvSamplerParams));
36 }
37 GrYUVtoRGBEffect(const GrYUVtoRGBEffect& src);
38 std::unique_ptr<GrFragmentProcessor> clone() const override;
39 const char* name() const override { return "YUVtoRGBEffect"; }
40
41private:
42 GrYUVtoRGBEffect(sk_sp<GrTextureProxy> ySampler, SkMatrix44 ySamplerTransform,
43 sk_sp<GrTextureProxy> uSampler, SkMatrix44 uSamplerTransform,
44 sk_sp<GrTextureProxy> vSampler, SkMatrix44 vSamplerTransform,
45 SkMatrix44 colorSpaceMatrix, bool nv12, GrSamplerState uvSamplerParams)
46 : INHERITED(kGrYUVtoRGBEffect_ClassID, kNone_OptimizationFlags)
47 , fYSampler(std::move(ySampler))
48 , fYSamplerTransform(ySamplerTransform)
49 , fUSampler(std::move(uSampler), uvSamplerParams)
50 , fUSamplerTransform(uSamplerTransform)
51 , fVSampler(std::move(vSampler), uvSamplerParams)
52 , fVSamplerTransform(vSamplerTransform)
53 , fColorSpaceMatrix(colorSpaceMatrix)
54 , fNv12(nv12)
55 , fYSamplerCoordTransform(ySamplerTransform, fYSampler.proxy())
56 , fUSamplerCoordTransform(uSamplerTransform, fUSampler.proxy())
57 , fVSamplerCoordTransform(vSamplerTransform, fVSampler.proxy()) {
Brian Salomonf7dcd762018-07-30 14:48:15 -040058 this->setTextureSamplerCnt(3);
Ethan Nicholas7461a4a2017-12-21 14:18:01 -050059 this->addCoordTransform(&fYSamplerCoordTransform);
60 this->addCoordTransform(&fUSamplerCoordTransform);
61 this->addCoordTransform(&fVSamplerCoordTransform);
62 }
63 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
64 void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
65 bool onIsEqual(const GrFragmentProcessor&) const override;
Brian Salomonf7dcd762018-07-30 14:48:15 -040066 const TextureSampler& onTextureSampler(int) const override;
Ethan Nicholas7461a4a2017-12-21 14:18:01 -050067 GR_DECLARE_FRAGMENT_PROCESSOR_TEST
68 TextureSampler fYSampler;
69 SkMatrix44 fYSamplerTransform;
70 TextureSampler fUSampler;
71 SkMatrix44 fUSamplerTransform;
72 TextureSampler fVSampler;
73 SkMatrix44 fVSamplerTransform;
74 SkMatrix44 fColorSpaceMatrix;
75 bool fNv12;
76 GrCoordTransform fYSamplerCoordTransform;
77 GrCoordTransform fUSamplerCoordTransform;
78 GrCoordTransform fVSamplerCoordTransform;
79 typedef GrFragmentProcessor INHERITED;
80};
81#endif