Flutter Engine
The Flutter Engine
GrYUVtoRGBEffect.h
Go to the documentation of this file.
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#ifndef GrYUVtoRGBEffect_DEFINED
9#define GrYUVtoRGBEffect_DEFINED
10
14#include "src/core/SkYUVAInfoLocation.h" // IWYU pragma: keep
19
20#include <memory>
21
23enum SkYUVColorSpace : int;
24namespace skgpu { class KeyBuilder; }
25struct GrShaderCaps;
26struct SkRect;
27
29public:
30 static std::unique_ptr<GrFragmentProcessor> Make(const GrYUVATextureProxies& yuvaProxies,
31 GrSamplerState samplerState,
32 const GrCaps&,
33 const SkMatrix& localMatrix = SkMatrix::I(),
34 const SkRect* subset = nullptr,
35 const SkRect* domain = nullptr);
36 std::unique_ptr<GrFragmentProcessor> clone() const override;
37
38 const char* name() const override { return "YUVtoRGBEffect"; }
39
40private:
41 GrYUVtoRGBEffect(std::unique_ptr<GrFragmentProcessor> planeFPs[4],
42 int numPlanes,
44 const bool snap[2],
45 SkYUVColorSpace yuvColorSpace);
46
48
49#if defined(GR_TEST_UTILS)
50 SkString onDumpInfo() const override;
51#endif
52
53 std::unique_ptr<ProgramImpl> onMakeProgramImpl() const override;
54
55 void onAddToKey(const GrShaderCaps&, skgpu::KeyBuilder*) const override;
56
57 bool onIsEqual(const GrFragmentProcessor&) const override;
58
60
62 SkYUVColorSpace fYUVColorSpace;
63 bool fSnap[2];
64};
65#endif
#define GR_DECLARE_FRAGMENT_PROCESSOR_TEST
SkYUVColorSpace
Definition: SkImageInfo.h:68
Definition: GrCaps.h:57
static std::unique_ptr< GrFragmentProcessor > Make(const GrYUVATextureProxies &yuvaProxies, GrSamplerState samplerState, const GrCaps &, const SkMatrix &localMatrix=SkMatrix::I(), const SkRect *subset=nullptr, const SkRect *domain=nullptr)
const char * name() const override
std::unique_ptr< GrFragmentProcessor > clone() const override
static const SkMatrix & I()
Definition: SkMatrix.cpp:1544
std::array< YUVALocation, kYUVAChannelCount > YUVALocations
Definition: SkYUVAInfo.h:32
Definition: GpuTools.h:21