#include "src/gpu/ganesh/effects/GrCoverageSetOpXP.h"
#include "include/private/SkColorData.h"
#include "include/private/base/SkAssert.h"
#include "src/base/SkRandom.h"
#include "src/gpu/Blend.h"
#include "src/gpu/KeyBuilder.h"
#include "src/gpu/ganesh/GrXferProcessor.h"
#include "src/gpu/ganesh/glsl/GrGLSLFragmentShaderBuilder.h"
#include <memory>
enum class GrClampType;
struct GrShaderCaps;
class CoverageSetOpXP : public GrXferProcessor { … };
void CoverageSetOpXP::onAddToKey(const GrShaderCaps& caps, skgpu::KeyBuilder* b) const { … }
std::unique_ptr<GrXferProcessor::ProgramImpl> CoverageSetOpXP::makeProgramImpl() const { … }
void CoverageSetOpXP::onGetBlendInfo(skgpu::BlendInfo* blendInfo) const { … }
constexpr GrCoverageSetOpXPFactory::GrCoverageSetOpXPFactory(SkRegion::Op regionOp,
bool invertCoverage)
: … { … }
const GrXPFactory* GrCoverageSetOpXPFactory::Get(SkRegion::Op regionOp, bool invertCoverage) { … }
sk_sp<const GrXferProcessor> GrCoverageSetOpXPFactory::makeXferProcessor(
const GrProcessorAnalysisColor&,
GrProcessorAnalysisCoverage,
const GrCaps& caps,
GrClampType) const { … }
GR_DEFINE_XP_FACTORY_TEST(…)
#if defined(GPU_TEST_UTILS)
const GrXPFactory* GrCoverageSetOpXPFactory::TestGet(GrProcessorTestData* d) {
SkRegion::Op regionOp = SkRegion::Op(d->fRandom->nextULessThan(SkRegion::kLastOp + 1));
bool invertCoverage = d->fRandom->nextBool();
return GrCoverageSetOpXPFactory::Get(regionOp, invertCoverage);
}
#endif