41#include <initializer_list>
62 SK_ABORT(
"Null context does not support dual source blending.");
75#define TEST_ASSERT(...) REPORTER_ASSERT(reporter, __VA_ARGS__)
92 paint.setXPFactory(xpf);
145 GrPorterDuffXPFactory::TestGetXPOutputTypes(xp, outPrimary, outSecondary);
1088 opts.fSuppressDualSourceBlending =
true;
1092 SK_ABORT(
"Failed to create mock context without ARB_blend_func_extended.");
1096 const GrCaps& caps = *ctx->priv().caps();
1098 SK_ABORT(
"Mock context failed to honor request for no ARB_blend_func_extended.");
1101 auto mbet = sk_gpu_test::ManagedBackendTexture::MakeWithoutData(
1111 mbet->refCountedCallback());
1122 for (
const auto& colorInput : colorInputs) {
1132 ERRORF(
reporter,
"Failed to create an XP without dual source blending.");
static GrColor GrColorPackRGBA(unsigned r, unsigned g, unsigned b, unsigned a)
@ kISAModulate_OutputType
@ kISCModulate_OutputType
static void test_color_not_opaque_no_coverage(skiatest::Reporter *reporter, const GrCaps &caps)
DEF_GANESH_TEST(GrPorterDuff, reporter,, CtsEnforcement::kApiLevel_T)
static void test_color_opaque_no_coverage(skiatest::Reporter *reporter, const GrCaps &caps)
static void test_color_opaque_with_coverage(skiatest::Reporter *reporter, const GrCaps &caps)
static void test_color_unknown_with_coverage(skiatest::Reporter *reporter, const GrCaps &caps)
static void test_lcd_coverage_fallback_case(skiatest::Reporter *reporter, const GrCaps &caps)
static GrProcessorSet::Analysis do_analysis(const GrXPFactory *xpf, const GrProcessorAnalysisColor &colorInput, GrProcessorAnalysisCoverage coverageInput, const GrCaps &caps)
static const int kInvalid_OutputType
static void test_lcd_coverage(skiatest::Reporter *reporter, const GrCaps &caps)
GrProcessorAnalysisCoverage
@ kBorrow_GrWrapOwnership
@ kTopLeft_GrSurfaceOrigin
#define SK_ABORT(message,...)
@ kLastCoeffMode
last porter duff blend mode
@ kSrcOver
r = s + (1-sa)*d
@ kXor
r = s*(1-da) + d*(1-sa)
@ kSrcATop
r = s*da + d*(1-sa)
@ kDstATop
r = d*sa + s*(1-da)
@ kDstOver
r = d + (1-da)*s
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
static bool isLCD(const SkScalerContextRec &rec)
const GrShaderCaps * shaderCaps() const
bool shouldCollapseSrcOverToSrcWhenAble() const
skgpu::Swizzle getReadSwizzle(const GrBackendFormat &format, GrColorType colorType) const
static sk_sp< GrDirectContext > MakeMock(const GrMockOptions *, const GrContextOptions &)
GrDirectContextPriv priv()
void setProxyView(GrSurfaceProxyView view)
const GrCaps * caps() const
static void GetXPOutputTypes(const GrXferProcessor *xp, int *outPrimary, int *outSecondary)
static const GrXPFactory * Get(SkBlendMode blendMode)
bool inputColorIsIgnored() const
bool requiresNonOverlappingDraws() const
bool unaffectedByDstValue() const
bool requiresDstTexture() const
bool isCompatibleWithCoverageAsAlpha() const
Analysis finalize(const GrProcessorAnalysisColor &, const GrProcessorAnalysisCoverage, const GrAppliedClip *, const GrUserStencilSettings *, const GrCaps &, GrClampType, SkPMColor4f *inputColorOverride)
sk_sp< GrTextureProxy > wrapBackendTexture(const GrBackendTexture &, GrWrapOwnership, GrWrapCacheable, GrIOType, sk_sp< skgpu::RefCntedCallback >=nullptr)
static sk_sp< const GrXferProcessor > MakeXferProcessor(const GrXPFactory *, const GrProcessorAnalysisColor &, GrProcessorAnalysisCoverage, const GrCaps &caps, GrClampType)
static AnalysisProperties GetAnalysisProperties(const GrXPFactory *, const GrProcessorAnalysisColor &, const GrProcessorAnalysisCoverage &, const GrCaps &, GrClampType)
bool hasSecondaryOutput() const
skgpu::BlendInfo getBlendInfo() const
bool willReadDstColor() const
GrDirectContext * get(ContextType type, ContextOverrides overrides=ContextOverrides::kNone)
@ kMock
Dawn on OpenGL ES.
static constexpr bool BlendCoeffRefsSrc2(const BlendCoeff coeff)
bool fDualSourceBlendingSupport
XPInfo(skiatest::Reporter *reporter, SkBlendMode xfermode, const GrCaps &caps, GrProcessorAnalysisColor inputColor, GrProcessorAnalysisCoverage inputCoverage)
bool fUnaffectedByDstValue
skgpu::BlendInfo fBlendInfo
bool fCompatibleWithCoverageAsAlpha
bool fDstReadInShaderSupport
static const GrUserStencilSettings & kUnused
static SkRGBA4f FromBytes_RGBA(uint32_t color)
bool fDualSourceBlendingSupport
skgpu::BlendCoeff fDstBlend
skgpu::BlendCoeff fSrcBlend