• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2018 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 /**************************************************************************************************
9  *** This file was autogenerated from GrYUVtoRGBEffect.fp; do not modify.
10  **************************************************************************************************/
11 #ifndef GrYUVtoRGBEffect_DEFINED
12 #define GrYUVtoRGBEffect_DEFINED
13 #include "SkTypes.h"
14 #if SK_SUPPORT_GPU
15 #include "GrFragmentProcessor.h"
16 #include "GrCoordTransform.h"
17 class GrYUVtoRGBEffect : public GrFragmentProcessor {
18 public:
19     static std::unique_ptr<GrFragmentProcessor> Make(sk_sp<GrTextureProxy> yProxy,
20                                                      sk_sp<GrTextureProxy> uProxy,
21                                                      sk_sp<GrTextureProxy> vProxy,
22                                                      const SkISize sizes[3],
23                                                      SkYUVColorSpace colorSpace, bool nv12);
ySamplerTransform()24     SkMatrix44 ySamplerTransform() const { return fYSamplerTransform; }
uSamplerTransform()25     SkMatrix44 uSamplerTransform() const { return fUSamplerTransform; }
vSamplerTransform()26     SkMatrix44 vSamplerTransform() const { return fVSamplerTransform; }
colorSpaceMatrix()27     SkMatrix44 colorSpaceMatrix() const { return fColorSpaceMatrix; }
nv12()28     bool nv12() const { return fNv12; }
Make(sk_sp<GrTextureProxy> ySampler,SkMatrix44 ySamplerTransform,sk_sp<GrTextureProxy> uSampler,SkMatrix44 uSamplerTransform,sk_sp<GrTextureProxy> vSampler,SkMatrix44 vSamplerTransform,SkMatrix44 colorSpaceMatrix,bool nv12,GrSamplerState uvSamplerParams)29     static std::unique_ptr<GrFragmentProcessor> Make(
30             sk_sp<GrTextureProxy> ySampler, SkMatrix44 ySamplerTransform,
31             sk_sp<GrTextureProxy> uSampler, SkMatrix44 uSamplerTransform,
32             sk_sp<GrTextureProxy> vSampler, SkMatrix44 vSamplerTransform,
33             SkMatrix44 colorSpaceMatrix, bool nv12, GrSamplerState uvSamplerParams) {
34         return std::unique_ptr<GrFragmentProcessor>(new GrYUVtoRGBEffect(
35                 ySampler, ySamplerTransform, uSampler, uSamplerTransform, vSampler,
36                 vSamplerTransform, colorSpaceMatrix, nv12, uvSamplerParams));
37     }
38     GrYUVtoRGBEffect(const GrYUVtoRGBEffect& src);
39     std::unique_ptr<GrFragmentProcessor> clone() const override;
name()40     const char* name() const override { return "YUVtoRGBEffect"; }
41 
42 private:
GrYUVtoRGBEffect(sk_sp<GrTextureProxy> ySampler,SkMatrix44 ySamplerTransform,sk_sp<GrTextureProxy> uSampler,SkMatrix44 uSamplerTransform,sk_sp<GrTextureProxy> vSampler,SkMatrix44 vSamplerTransform,SkMatrix44 colorSpaceMatrix,bool nv12,GrSamplerState uvSamplerParams)43     GrYUVtoRGBEffect(sk_sp<GrTextureProxy> ySampler, SkMatrix44 ySamplerTransform,
44                      sk_sp<GrTextureProxy> uSampler, SkMatrix44 uSamplerTransform,
45                      sk_sp<GrTextureProxy> vSampler, SkMatrix44 vSamplerTransform,
46                      SkMatrix44 colorSpaceMatrix, bool nv12, GrSamplerState uvSamplerParams)
47             : INHERITED(kGrYUVtoRGBEffect_ClassID, kNone_OptimizationFlags)
48             , fYSampler(std::move(ySampler))
49             , fYSamplerTransform(ySamplerTransform)
50             , fUSampler(std::move(uSampler), uvSamplerParams)
51             , fUSamplerTransform(uSamplerTransform)
52             , fVSampler(std::move(vSampler), uvSamplerParams)
53             , fVSamplerTransform(vSamplerTransform)
54             , fColorSpaceMatrix(colorSpaceMatrix)
55             , fNv12(nv12)
56             , fYSamplerCoordTransform(ySamplerTransform, fYSampler.proxy())
57             , fUSamplerCoordTransform(uSamplerTransform, fUSampler.proxy())
58             , fVSamplerCoordTransform(vSamplerTransform, fVSampler.proxy()) {
59         this->addTextureSampler(&fYSampler);
60         this->addTextureSampler(&fUSampler);
61         this->addTextureSampler(&fVSampler);
62         this->addCoordTransform(&fYSamplerCoordTransform);
63         this->addCoordTransform(&fUSamplerCoordTransform);
64         this->addCoordTransform(&fVSamplerCoordTransform);
65     }
66     GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
67     void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
68     bool onIsEqual(const GrFragmentProcessor&) const override;
69     GR_DECLARE_FRAGMENT_PROCESSOR_TEST
70     TextureSampler fYSampler;
71     SkMatrix44 fYSamplerTransform;
72     TextureSampler fUSampler;
73     SkMatrix44 fUSamplerTransform;
74     TextureSampler fVSampler;
75     SkMatrix44 fVSamplerTransform;
76     SkMatrix44 fColorSpaceMatrix;
77     bool fNv12;
78     GrCoordTransform fYSamplerCoordTransform;
79     GrCoordTransform fUSamplerCoordTransform;
80     GrCoordTransform fVSamplerCoordTransform;
81     typedef GrFragmentProcessor INHERITED;
82 };
83 #endif
84 #endif
85