#include "src/gpu/ganesh/effects/GrYUVtoRGBEffect.h"
#include "include/core/SkAlphaType.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkRect.h"
#include "include/core/SkSamplingOptions.h"
#include "include/core/SkYUVAInfo.h"
#include "include/private/SkSLSampleUsage.h"
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkTo.h"
#include "include/private/gpu/ganesh/GrTypesPriv.h"
#include "src/core/SkSLTypeShared.h"
#include "src/core/SkYUVAInfoLocation.h"
#include "src/core/SkYUVMath.h"
#include "src/gpu/KeyBuilder.h"
#include "src/gpu/ganesh/GrSurfaceProxyView.h"
#include "src/gpu/ganesh/GrYUVATextureProxies.h"
#include "src/gpu/ganesh/effects/GrMatrixEffect.h"
#include "src/gpu/ganesh/effects/GrTextureEffect.h"
#include "src/gpu/ganesh/glsl/GrGLSLFragmentShaderBuilder.h"
#include "src/gpu/ganesh/glsl/GrGLSLProgramDataManager.h"
#include "src/gpu/ganesh/glsl/GrGLSLUniformHandler.h"
#include <algorithm>
#include <array>
#include <cmath>
#include <cstdint>
#include <string>
#include <utility>
struct GrShaderCaps;
static void border_colors(const GrYUVATextureProxies& yuvaProxies, float planeBorders[4][4]) { … }
std::unique_ptr<GrFragmentProcessor> GrYUVtoRGBEffect::Make(const GrYUVATextureProxies& yuvaProxies,
GrSamplerState samplerState,
const GrCaps& caps,
const SkMatrix& localMatrix,
const SkRect* subset,
const SkRect* domain) { … }
static SkAlphaType alpha_type(const SkYUVAInfo::YUVALocations locations) { … }
GrYUVtoRGBEffect::GrYUVtoRGBEffect(std::unique_ptr<GrFragmentProcessor> planeFPs[4],
int numPlanes,
const SkYUVAInfo::YUVALocations& locations,
const bool snap[2],
SkYUVColorSpace yuvColorSpace)
: … { … }
#if defined(GPU_TEST_UTILS)
SkString GrYUVtoRGBEffect::onDumpInfo() const {
SkString str("(");
for (int i = 0; i < SkYUVAInfo::kYUVAChannelCount; ++i) {
str.appendf("Locations[%d]=%d %d, ",
i, fLocations[i].fPlane, static_cast<int>(fLocations[i].fChannel));
}
str.appendf("YUVColorSpace=%d, snap=(%d, %d))",
static_cast<int>(fYUVColorSpace), fSnap[0], fSnap[1]);
return str;
}
#endif
std::unique_ptr<GrFragmentProcessor::ProgramImpl> GrYUVtoRGBEffect::onMakeProgramImpl() const { … }
void GrYUVtoRGBEffect::onAddToKey(const GrShaderCaps& caps, skgpu::KeyBuilder* b) const { … }
bool GrYUVtoRGBEffect::onIsEqual(const GrFragmentProcessor& other) const { … }
GrYUVtoRGBEffect::GrYUVtoRGBEffect(const GrYUVtoRGBEffect& src)
: … { … }
std::unique_ptr<GrFragmentProcessor> GrYUVtoRGBEffect::clone() const { … }