#include "src/gpu/ganesh/effects/GrBlendFragmentProcessor.h"
#include "include/core/SkBlendMode.h"
#include "include/core/SkString.h"
#include "include/private/SkColorData.h"
#include "src/base/SkRandom.h"
#include "src/core/SkBlendModePriv.h"
#include "src/gpu/Blend.h"
#include "src/gpu/KeyBuilder.h"
#include "src/gpu/ganesh/GrFragmentProcessor.h"
#include "src/gpu/ganesh/GrProcessorUnitTest.h"
#include "src/gpu/ganesh/glsl/GrGLSLBlend.h"
#include "src/gpu/ganesh/glsl/GrGLSLFragmentShaderBuilder.h"
#include <string>
class GrGLSLProgramDataManager;
struct GrShaderCaps;
static inline bool does_cpu_blend_impl_match_gpu(SkBlendMode mode) { … }
class BlendFragmentProcessor : public GrFragmentProcessor { … };
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(…)
#if defined(GPU_TEST_UTILS)
std::unique_ptr<GrFragmentProcessor> BlendFragmentProcessor::TestCreate(GrProcessorTestData* d) {
std::unique_ptr<GrFragmentProcessor> src(GrProcessorUnitTest::MakeOptionalChildFP(d));
std::unique_ptr<GrFragmentProcessor> dst(GrProcessorUnitTest::MakeChildFP(d));
if (d->fRandom->nextBool()) {
std::swap(src, dst);
}
bool shareLogic = d->fRandom->nextBool();
SkBlendMode mode =
static_cast<SkBlendMode>(d->fRandom->nextRangeU(0, (int)SkBlendMode::kLastMode));
return std::unique_ptr<GrFragmentProcessor>(
new BlendFragmentProcessor(std::move(src), std::move(dst), mode, shareLogic));
}
#endif
std::unique_ptr<GrFragmentProcessor> BlendFragmentProcessor::clone() const { … }
std::unique_ptr<GrFragmentProcessor::ProgramImpl> BlendFragmentProcessor::onMakeProgramImpl()
const { … }
std::unique_ptr<GrFragmentProcessor> GrBlendFragmentProcessor::Make(
std::unique_ptr<GrFragmentProcessor> src,
std::unique_ptr<GrFragmentProcessor> dst,
SkBlendMode mode,
bool shareBlendLogic) { … }