Add skgpu::BlendInfo
This unifies GrXferProcessor::BlendInfo and SkPipelineDataGatherer::BlendInfo. The motivation for this is that I want to store a blend info on the SkPaintParamsBuilder and having the BlendInfo in SkPipelineDataGatherer made that difficult. Once moved to Blend.h it didn't make sense to have the GrXferProcessor version. Change-Id: I8c36feeef0bfe85dfc3f53b6bbb0193b29136bfd Reviewed-on: https://skia-review.googlesource.com/c/skia/+/547816 Reviewed-by: Michael Ludwig <michaelludwig@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
This commit is contained in:
parent
9245ecb239
commit
9c5063271a
@ -553,8 +553,8 @@ void AddToKey(const SkKeyContext& keyContext,
|
||||
#ifdef SK_GRAPHITE_ENABLED
|
||||
namespace {
|
||||
|
||||
constexpr SkPipelineDataGatherer::BlendInfo make_simple_blendInfo(skgpu::BlendCoeff srcCoeff,
|
||||
skgpu::BlendCoeff dstCoeff) {
|
||||
constexpr skgpu::BlendInfo make_simple_blendInfo(skgpu::BlendCoeff srcCoeff,
|
||||
skgpu::BlendCoeff dstCoeff) {
|
||||
return { skgpu::BlendEquation::kAdd,
|
||||
srcCoeff,
|
||||
dstCoeff,
|
||||
@ -564,7 +564,7 @@ constexpr SkPipelineDataGatherer::BlendInfo make_simple_blendInfo(skgpu::BlendCo
|
||||
|
||||
static constexpr int kNumCoeffModes = (int)SkBlendMode::kLastCoeffMode + 1;
|
||||
/*>> No coverage, input color unknown <<*/
|
||||
static constexpr SkPipelineDataGatherer::BlendInfo gBlendTable[kNumCoeffModes] = {
|
||||
static constexpr skgpu::BlendInfo gBlendTable[kNumCoeffModes] = {
|
||||
/* clear */ make_simple_blendInfo(skgpu::BlendCoeff::kZero, skgpu::BlendCoeff::kZero),
|
||||
/* src */ make_simple_blendInfo(skgpu::BlendCoeff::kOne, skgpu::BlendCoeff::kZero),
|
||||
/* dst */ make_simple_blendInfo(skgpu::BlendCoeff::kZero, skgpu::BlendCoeff::kOne),
|
||||
@ -582,7 +582,7 @@ static constexpr SkPipelineDataGatherer::BlendInfo gBlendTable[kNumCoeffModes] =
|
||||
/* screen */ make_simple_blendInfo(skgpu::BlendCoeff::kOne, skgpu::BlendCoeff::kISC)
|
||||
};
|
||||
|
||||
const SkPipelineDataGatherer::BlendInfo& get_blend_info(SkBlendMode bm) {
|
||||
const skgpu::BlendInfo& get_blend_info(SkBlendMode bm) {
|
||||
if (bm <= SkBlendMode::kLastCoeffMode) {
|
||||
return gBlendTable[(int) bm];
|
||||
}
|
||||
@ -649,7 +649,7 @@ void AddToKey(const SkKeyContext& keyContext,
|
||||
if (gatherer) {
|
||||
add_shaderbasedblender_uniform_data(dict, bm, gatherer);
|
||||
// TODO: set up the correct blend info
|
||||
gatherer->setBlendInfo(SkPipelineDataGatherer::BlendInfo());
|
||||
gatherer->setBlendInfo({});
|
||||
}
|
||||
}
|
||||
return;
|
||||
@ -723,7 +723,7 @@ SkUniquePaintParamsID CreateKey(const SkKeyContext& keyContext,
|
||||
|
||||
// TODO: the blendInfo should be filled in by BlendModeBlock::AddToKey
|
||||
#ifdef SK_GRAPHITE_ENABLED
|
||||
SkPipelineDataGatherer::BlendInfo blendInfo = get_blend_info(bm);
|
||||
skgpu::BlendInfo blendInfo = get_blend_info(bm);
|
||||
#endif
|
||||
|
||||
BlendModeBlock::AddToKey(keyContext, builder, /* pipelineData*/ nullptr, bm); // 'bm' is used
|
||||
|
@ -19,7 +19,7 @@ SkPipelineDataGatherer::SkPipelineDataGatherer(skgpu::graphite::Layout layout)
|
||||
void SkPipelineDataGatherer::reset() {
|
||||
#ifdef SK_GRAPHITE_ENABLED
|
||||
fTextureDataBlock.reset();
|
||||
fBlendInfo = BlendInfo();
|
||||
fBlendInfo = {};
|
||||
fUniformManager.reset();
|
||||
#endif
|
||||
fSnippetRequirementFlags = SnippetRequirementFlags::kNone;
|
||||
@ -29,7 +29,7 @@ void SkPipelineDataGatherer::reset() {
|
||||
void SkPipelineDataGatherer::checkReset() {
|
||||
#ifdef SK_GRAPHITE_ENABLED
|
||||
SkASSERT(fTextureDataBlock.empty());
|
||||
SkASSERT(fBlendInfo == BlendInfo());
|
||||
SkASSERT(fBlendInfo == skgpu::BlendInfo());
|
||||
SkDEBUGCODE(fUniformManager.checkReset());
|
||||
#endif
|
||||
SkASSERT(fSnippetRequirementFlags == SnippetRequirementFlags::kNone);
|
||||
|
@ -118,24 +118,6 @@ private:
|
||||
// obviously, vastly complicate uniform accumulation.
|
||||
class SkPipelineDataGatherer {
|
||||
public:
|
||||
#ifdef SK_GRAPHITE_ENABLED
|
||||
struct BlendInfo {
|
||||
bool operator==(const BlendInfo& other) const {
|
||||
return fEquation == other.fEquation &&
|
||||
fSrcBlend == other.fSrcBlend &&
|
||||
fDstBlend == other.fDstBlend &&
|
||||
fBlendConstant == other.fBlendConstant &&
|
||||
fWritesColor == other.fWritesColor;
|
||||
}
|
||||
|
||||
skgpu::BlendEquation fEquation = skgpu::BlendEquation::kAdd;
|
||||
skgpu::BlendCoeff fSrcBlend = skgpu::BlendCoeff::kOne;
|
||||
skgpu::BlendCoeff fDstBlend = skgpu::BlendCoeff::kZero;
|
||||
SkPMColor4f fBlendConstant = SK_PMColor4fTRANSPARENT;
|
||||
bool fWritesColor = true;
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef SK_GRAPHITE_ENABLED
|
||||
SkPipelineDataGatherer(skgpu::graphite::Layout layout);
|
||||
#endif
|
||||
@ -145,10 +127,10 @@ public:
|
||||
SkDEBUGCODE(void checkReset();)
|
||||
|
||||
#ifdef SK_GRAPHITE_ENABLED
|
||||
void setBlendInfo(const SkPipelineDataGatherer::BlendInfo& blendInfo) {
|
||||
void setBlendInfo(const skgpu::BlendInfo& blendInfo) {
|
||||
fBlendInfo = blendInfo;
|
||||
}
|
||||
const BlendInfo& blendInfo() const { return fBlendInfo; }
|
||||
const skgpu::BlendInfo& blendInfo() const { return fBlendInfo; }
|
||||
|
||||
void add(const SkSamplingOptions& sampling,
|
||||
const SkTileMode tileModes[2],
|
||||
@ -190,7 +172,7 @@ private:
|
||||
#endif // SK_DEBUG
|
||||
|
||||
SkTextureDataBlock fTextureDataBlock;
|
||||
BlendInfo fBlendInfo;
|
||||
skgpu::BlendInfo fBlendInfo;
|
||||
skgpu::graphite::UniformManager fUniformManager;
|
||||
#endif // SK_GRAPHITE_ENABLED
|
||||
SkEnumBitMask<SnippetRequirementFlags> fSnippetRequirementFlags;
|
||||
|
@ -188,7 +188,7 @@ std::string SkShaderInfo::toSkSL() const {
|
||||
SkShaderCodeDictionary::Entry* SkShaderCodeDictionary::makeEntry(
|
||||
const SkPaintParamsKey& key
|
||||
#ifdef SK_GRAPHITE_ENABLED
|
||||
, const SkPipelineDataGatherer::BlendInfo& blendInfo
|
||||
, const skgpu::BlendInfo& blendInfo
|
||||
#endif
|
||||
) {
|
||||
uint8_t* newKeyData = fArena.makeArray<uint8_t>(key.sizeInBytes());
|
||||
@ -209,7 +209,7 @@ size_t SkShaderCodeDictionary::Hash::operator()(const SkPaintParamsKey* key) con
|
||||
const SkShaderCodeDictionary::Entry* SkShaderCodeDictionary::findOrCreate(
|
||||
const SkPaintParamsKey& key
|
||||
#ifdef SK_GRAPHITE_ENABLED
|
||||
, const SkPipelineDataGatherer::BlendInfo& blendInfo
|
||||
, const skgpu::BlendInfo& blendInfo
|
||||
#endif
|
||||
) {
|
||||
SkAutoSpinlock lock{fSpinLock};
|
||||
|
@ -105,10 +105,10 @@ public:
|
||||
}
|
||||
|
||||
#ifdef SK_GRAPHITE_ENABLED
|
||||
void setBlendInfo(const SkPipelineDataGatherer::BlendInfo& blendInfo) {
|
||||
void setBlendInfo(const skgpu::BlendInfo& blendInfo) {
|
||||
fBlendInfo = blendInfo;
|
||||
}
|
||||
const SkPipelineDataGatherer::BlendInfo& blendInfo() const { return fBlendInfo; }
|
||||
const skgpu::BlendInfo& blendInfo() const { return fBlendInfo; }
|
||||
#endif
|
||||
|
||||
#if SK_SUPPORT_GPU && defined(SK_GRAPHITE_ENABLED) && defined(SK_METAL)
|
||||
@ -129,7 +129,7 @@ private:
|
||||
|
||||
// The blendInfo doesn't actually contribute to the program's creation but, it contains the
|
||||
// matching fixed-function settings that the program's caller needs to set up.
|
||||
SkPipelineDataGatherer::BlendInfo fBlendInfo;
|
||||
skgpu::BlendInfo fBlendInfo;
|
||||
#endif
|
||||
};
|
||||
|
||||
@ -145,14 +145,14 @@ public:
|
||||
}
|
||||
const SkPaintParamsKey& paintParamsKey() const { return fKey; }
|
||||
#ifdef SK_GRAPHITE_ENABLED
|
||||
const SkPipelineDataGatherer::BlendInfo& blendInfo() const { return fBlendInfo; }
|
||||
const skgpu::BlendInfo& blendInfo() const { return fBlendInfo; }
|
||||
#endif
|
||||
|
||||
private:
|
||||
friend class SkShaderCodeDictionary;
|
||||
|
||||
#ifdef SK_GRAPHITE_ENABLED
|
||||
Entry(const SkPaintParamsKey& key, const SkPipelineDataGatherer::BlendInfo& blendInfo)
|
||||
Entry(const SkPaintParamsKey& key, const skgpu::BlendInfo& blendInfo)
|
||||
: fKey(key.asSpan())
|
||||
, fBlendInfo(blendInfo) {
|
||||
}
|
||||
@ -172,13 +172,13 @@ public:
|
||||
// The BlendInfo isn't used in the hash (that is the key's job) but it does directly vary
|
||||
// with the key. It could, theoretically, be recreated from the key but that would add
|
||||
// extra complexity.
|
||||
SkPipelineDataGatherer::BlendInfo fBlendInfo;
|
||||
skgpu::BlendInfo fBlendInfo;
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef SK_GRAPHITE_ENABLED
|
||||
const Entry* findOrCreate(const SkPaintParamsKey&,
|
||||
const SkPipelineDataGatherer::BlendInfo&) SK_EXCLUDES(fSpinLock);
|
||||
const skgpu::BlendInfo&) SK_EXCLUDES(fSpinLock);
|
||||
#else
|
||||
const Entry* findOrCreate(const SkPaintParamsKey&) SK_EXCLUDES(fSpinLock);
|
||||
#endif
|
||||
@ -213,7 +213,7 @@ public:
|
||||
|
||||
private:
|
||||
#ifdef SK_GRAPHITE_ENABLED
|
||||
Entry* makeEntry(const SkPaintParamsKey&, const SkPipelineDataGatherer::BlendInfo&);
|
||||
Entry* makeEntry(const SkPaintParamsKey&, const skgpu::BlendInfo&);
|
||||
#else
|
||||
Entry* makeEntry(const SkPaintParamsKey&);
|
||||
#endif
|
||||
|
@ -9,6 +9,10 @@
|
||||
|
||||
#include "include/core/SkBlendMode.h"
|
||||
|
||||
#ifdef SK_DEBUG
|
||||
#include "include/core/SkString.h"
|
||||
#endif
|
||||
|
||||
namespace skgpu {
|
||||
|
||||
const char* BlendFuncName(SkBlendMode mode) {
|
||||
@ -96,4 +100,74 @@ ReducedBlendModeInfo GetReducedBlendModeInfo(SkBlendMode mode) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef SK_DEBUG
|
||||
|
||||
namespace {
|
||||
|
||||
const char *equation_string(skgpu::BlendEquation eq) {
|
||||
switch (eq) {
|
||||
case skgpu::BlendEquation::kAdd: return "add";
|
||||
case skgpu::BlendEquation::kSubtract: return "subtract";
|
||||
case skgpu::BlendEquation::kReverseSubtract: return "reverse_subtract";
|
||||
case skgpu::BlendEquation::kScreen: return "screen";
|
||||
case skgpu::BlendEquation::kOverlay: return "overlay";
|
||||
case skgpu::BlendEquation::kDarken: return "darken";
|
||||
case skgpu::BlendEquation::kLighten: return "lighten";
|
||||
case skgpu::BlendEquation::kColorDodge: return "color_dodge";
|
||||
case skgpu::BlendEquation::kColorBurn: return "color_burn";
|
||||
case skgpu::BlendEquation::kHardLight: return "hard_light";
|
||||
case skgpu::BlendEquation::kSoftLight: return "soft_light";
|
||||
case skgpu::BlendEquation::kDifference: return "difference";
|
||||
case skgpu::BlendEquation::kExclusion: return "exclusion";
|
||||
case skgpu::BlendEquation::kMultiply: return "multiply";
|
||||
case skgpu::BlendEquation::kHSLHue: return "hsl_hue";
|
||||
case skgpu::BlendEquation::kHSLSaturation: return "hsl_saturation";
|
||||
case skgpu::BlendEquation::kHSLColor: return "hsl_color";
|
||||
case skgpu::BlendEquation::kHSLLuminosity: return "hsl_luminosity";
|
||||
case skgpu::BlendEquation::kIllegal:
|
||||
SkASSERT(false);
|
||||
return "<illegal>";
|
||||
}
|
||||
|
||||
SkUNREACHABLE;
|
||||
}
|
||||
|
||||
const char *coeff_string(skgpu::BlendCoeff coeff) {
|
||||
switch (coeff) {
|
||||
case skgpu::BlendCoeff::kZero: return "zero";
|
||||
case skgpu::BlendCoeff::kOne: return "one";
|
||||
case skgpu::BlendCoeff::kSC: return "src_color";
|
||||
case skgpu::BlendCoeff::kISC: return "inv_src_color";
|
||||
case skgpu::BlendCoeff::kDC: return "dst_color";
|
||||
case skgpu::BlendCoeff::kIDC: return "inv_dst_color";
|
||||
case skgpu::BlendCoeff::kSA: return "src_alpha";
|
||||
case skgpu::BlendCoeff::kISA: return "inv_src_alpha";
|
||||
case skgpu::BlendCoeff::kDA: return "dst_alpha";
|
||||
case skgpu::BlendCoeff::kIDA: return "inv_dst_alpha";
|
||||
case skgpu::BlendCoeff::kConstC: return "const_color";
|
||||
case skgpu::BlendCoeff::kIConstC: return "inv_const_color";
|
||||
case skgpu::BlendCoeff::kS2C: return "src2_color";
|
||||
case skgpu::BlendCoeff::kIS2C: return "inv_src2_color";
|
||||
case skgpu::BlendCoeff::kS2A: return "src2_alpha";
|
||||
case skgpu::BlendCoeff::kIS2A: return "inv_src2_alpha";
|
||||
case skgpu::BlendCoeff::kIllegal:
|
||||
SkASSERT(false);
|
||||
return "<illegal>";
|
||||
}
|
||||
|
||||
SkUNREACHABLE;
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
SkString BlendInfo::dump() const {
|
||||
SkString out;
|
||||
out.printf("writes_color(%d) equation(%s) src_coeff(%s) dst_coeff:(%s) const(0x%08x)",
|
||||
fWritesColor, equation_string(fEquation), coeff_string(fSrcBlend),
|
||||
coeff_string(fDstBlend), fBlendConstant.toBytes_RGBA());
|
||||
return out;
|
||||
}
|
||||
|
||||
#endif // SK_DEBUG
|
||||
|
||||
} // namespace skgpu
|
||||
|
@ -10,8 +10,10 @@
|
||||
|
||||
#include "include/core/SkSpan.h"
|
||||
#include "include/core/SkTypes.h"
|
||||
#include "include/private/SkColorData.h"
|
||||
|
||||
enum class SkBlendMode;
|
||||
class SkString;
|
||||
|
||||
namespace skgpu {
|
||||
|
||||
@ -75,6 +77,24 @@ enum class BlendCoeff : uint8_t {
|
||||
kLast = kIllegal,
|
||||
};
|
||||
|
||||
struct BlendInfo {
|
||||
SkDEBUGCODE(SkString dump() const;)
|
||||
|
||||
bool operator==(const BlendInfo& other) const {
|
||||
return fEquation == other.fEquation &&
|
||||
fSrcBlend == other.fSrcBlend &&
|
||||
fDstBlend == other.fDstBlend &&
|
||||
fBlendConstant == other.fBlendConstant &&
|
||||
fWritesColor == other.fWritesColor;
|
||||
}
|
||||
|
||||
skgpu::BlendEquation fEquation = skgpu::BlendEquation::kAdd;
|
||||
skgpu::BlendCoeff fSrcBlend = skgpu::BlendCoeff::kOne;
|
||||
skgpu::BlendCoeff fDstBlend = skgpu::BlendCoeff::kZero;
|
||||
SkPMColor4f fBlendConstant = SK_PMColor4fTRANSPARENT;
|
||||
bool fWritesColor = true;
|
||||
};
|
||||
|
||||
static const int kBlendCoeffCnt = static_cast<int>(BlendCoeff::kLast) + 1;
|
||||
|
||||
static constexpr bool BlendCoeffRefsSrc(const BlendCoeff coeff) {
|
||||
|
@ -80,14 +80,14 @@ void GrPipeline::genKey(skgpu::KeyBuilder* b, const GrCaps& caps) const {
|
||||
InputFlags ignoredFlags = InputFlags::kSnapVerticesToPixelCenters;
|
||||
b->add32((uint32_t)fFlags & ~(uint32_t)ignoredFlags, "flags");
|
||||
|
||||
const GrXferProcessor::BlendInfo& blendInfo = this->getXferProcessor().getBlendInfo();
|
||||
const skgpu::BlendInfo& blendInfo = this->getXferProcessor().getBlendInfo();
|
||||
|
||||
static constexpr uint32_t kBlendCoeffSize = 5;
|
||||
static constexpr uint32_t kBlendEquationSize = 5;
|
||||
static_assert(static_cast<int>(skgpu::BlendCoeff::kLast) < (1 << kBlendCoeffSize));
|
||||
static_assert(static_cast<int>(skgpu::BlendEquation::kLast) < (1 << kBlendEquationSize));
|
||||
|
||||
b->addBool(blendInfo.fWriteColor, "writeColor");
|
||||
b->addBool(blendInfo.fWritesColor, "writesColor");
|
||||
b->addBits(kBlendCoeffSize, static_cast<int>(blendInfo.fSrcBlend), "srcBlend");
|
||||
b->addBits(kBlendCoeffSize, static_cast<int>(blendInfo.fDstBlend), "dstBlend");
|
||||
b->addBits(kBlendEquationSize, static_cast<int>(blendInfo.fEquation), "equation");
|
||||
|
@ -54,102 +54,6 @@ void GrXferProcessor::addToKey(const GrShaderCaps& caps,
|
||||
this->onAddToKey(caps, b);
|
||||
}
|
||||
|
||||
#ifdef SK_DEBUG
|
||||
static const char* equation_string(skgpu::BlendEquation eq) {
|
||||
switch (eq) {
|
||||
case skgpu::BlendEquation::kAdd:
|
||||
return "add";
|
||||
case skgpu::BlendEquation::kSubtract:
|
||||
return "subtract";
|
||||
case skgpu::BlendEquation::kReverseSubtract:
|
||||
return "reverse_subtract";
|
||||
case skgpu::BlendEquation::kScreen:
|
||||
return "screen";
|
||||
case skgpu::BlendEquation::kOverlay:
|
||||
return "overlay";
|
||||
case skgpu::BlendEquation::kDarken:
|
||||
return "darken";
|
||||
case skgpu::BlendEquation::kLighten:
|
||||
return "lighten";
|
||||
case skgpu::BlendEquation::kColorDodge:
|
||||
return "color_dodge";
|
||||
case skgpu::BlendEquation::kColorBurn:
|
||||
return "color_burn";
|
||||
case skgpu::BlendEquation::kHardLight:
|
||||
return "hard_light";
|
||||
case skgpu::BlendEquation::kSoftLight:
|
||||
return "soft_light";
|
||||
case skgpu::BlendEquation::kDifference:
|
||||
return "difference";
|
||||
case skgpu::BlendEquation::kExclusion:
|
||||
return "exclusion";
|
||||
case skgpu::BlendEquation::kMultiply:
|
||||
return "multiply";
|
||||
case skgpu::BlendEquation::kHSLHue:
|
||||
return "hsl_hue";
|
||||
case skgpu::BlendEquation::kHSLSaturation:
|
||||
return "hsl_saturation";
|
||||
case skgpu::BlendEquation::kHSLColor:
|
||||
return "hsl_color";
|
||||
case skgpu::BlendEquation::kHSLLuminosity:
|
||||
return "hsl_luminosity";
|
||||
case skgpu::BlendEquation::kIllegal:
|
||||
SkASSERT(false);
|
||||
return "<illegal>";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
static const char* coeff_string(skgpu::BlendCoeff coeff) {
|
||||
switch (coeff) {
|
||||
case skgpu::BlendCoeff::kZero:
|
||||
return "zero";
|
||||
case skgpu::BlendCoeff::kOne:
|
||||
return "one";
|
||||
case skgpu::BlendCoeff::kSC:
|
||||
return "src_color";
|
||||
case skgpu::BlendCoeff::kISC:
|
||||
return "inv_src_color";
|
||||
case skgpu::BlendCoeff::kDC:
|
||||
return "dst_color";
|
||||
case skgpu::BlendCoeff::kIDC:
|
||||
return "inv_dst_color";
|
||||
case skgpu::BlendCoeff::kSA:
|
||||
return "src_alpha";
|
||||
case skgpu::BlendCoeff::kISA:
|
||||
return "inv_src_alpha";
|
||||
case skgpu::BlendCoeff::kDA:
|
||||
return "dst_alpha";
|
||||
case skgpu::BlendCoeff::kIDA:
|
||||
return "inv_dst_alpha";
|
||||
case skgpu::BlendCoeff::kConstC:
|
||||
return "const_color";
|
||||
case skgpu::BlendCoeff::kIConstC:
|
||||
return "inv_const_color";
|
||||
case skgpu::BlendCoeff::kS2C:
|
||||
return "src2_color";
|
||||
case skgpu::BlendCoeff::kIS2C:
|
||||
return "inv_src2_color";
|
||||
case skgpu::BlendCoeff::kS2A:
|
||||
return "src2_alpha";
|
||||
case skgpu::BlendCoeff::kIS2A:
|
||||
return "inv_src2_alpha";
|
||||
case skgpu::BlendCoeff::kIllegal:
|
||||
SkASSERT(false);
|
||||
return "<illegal>";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
SkString GrXferProcessor::BlendInfo::dump() const {
|
||||
SkString out;
|
||||
out.printf("write_color(%d) equation(%s) src_coeff(%s) dst_coeff:(%s) const(0x%08x)",
|
||||
fWriteColor, equation_string(fEquation), coeff_string(fSrcBlend),
|
||||
coeff_string(fDstBlend), fBlendConstant.toBytes_RGBA());
|
||||
return out;
|
||||
}
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
GrXPFactory::AnalysisProperties GrXPFactory::GetAnalysisProperties(
|
||||
|
@ -89,18 +89,8 @@ public:
|
||||
return kNone_GrXferBarrierType;
|
||||
}
|
||||
|
||||
struct BlendInfo {
|
||||
SkDEBUGCODE(SkString dump() const;)
|
||||
|
||||
skgpu::BlendEquation fEquation = skgpu::BlendEquation::kAdd;
|
||||
skgpu::BlendCoeff fSrcBlend = skgpu::BlendCoeff::kOne;
|
||||
skgpu::BlendCoeff fDstBlend = skgpu::BlendCoeff::kZero;
|
||||
SkPMColor4f fBlendConstant = SK_PMColor4fTRANSPARENT;
|
||||
bool fWriteColor = true;
|
||||
};
|
||||
|
||||
inline BlendInfo getBlendInfo() const {
|
||||
BlendInfo blendInfo;
|
||||
inline skgpu::BlendInfo getBlendInfo() const {
|
||||
skgpu::BlendInfo blendInfo;
|
||||
if (!this->willReadDstColor()) {
|
||||
this->onGetBlendInfo(&blendInfo);
|
||||
}
|
||||
@ -161,7 +151,7 @@ private:
|
||||
* subclass. When using dst reads, the base class controls the fixed-function blend state and
|
||||
* this method will not be called. The BlendInfo struct comes initialized to "no blending".
|
||||
*/
|
||||
virtual void onGetBlendInfo(BlendInfo*) const {}
|
||||
virtual void onGetBlendInfo(skgpu::BlendInfo*) const {}
|
||||
|
||||
virtual bool onIsEqual(const GrXferProcessor&) const = 0;
|
||||
|
||||
|
@ -94,7 +94,7 @@ void set_stencil_ref(GrD3DGpu* gpu, const GrProgramInfo& info) {
|
||||
void set_blend_factor(GrD3DGpu* gpu, const GrProgramInfo& info) {
|
||||
const GrXferProcessor& xferProcessor = info.pipeline().getXferProcessor();
|
||||
const skgpu::Swizzle& swizzle = info.pipeline().writeSwizzle();
|
||||
const GrXferProcessor::BlendInfo& blendInfo = xferProcessor.getBlendInfo();
|
||||
const skgpu::BlendInfo& blendInfo = xferProcessor.getBlendInfo();
|
||||
skgpu::BlendCoeff srcCoeff = blendInfo.fSrcBlend;
|
||||
skgpu::BlendCoeff dstCoeff = blendInfo.fDstBlend;
|
||||
float floatColors[4];
|
||||
|
@ -346,7 +346,7 @@ static void fill_in_blend_state(const GrPipeline& pipeline, D3D12_BLEND_DESC* bl
|
||||
blendDesc->AlphaToCoverageEnable = false;
|
||||
blendDesc->IndependentBlendEnable = false;
|
||||
|
||||
const GrXferProcessor::BlendInfo& blendInfo = pipeline.getXferProcessor().getBlendInfo();
|
||||
const skgpu::BlendInfo& blendInfo = pipeline.getXferProcessor().getBlendInfo();
|
||||
|
||||
skgpu::BlendEquation equation = blendInfo.fEquation;
|
||||
skgpu::BlendCoeff srcCoeff = blendInfo.fSrcBlend;
|
||||
@ -364,7 +364,7 @@ static void fill_in_blend_state(const GrPipeline& pipeline, D3D12_BLEND_DESC* bl
|
||||
rtBlend.BlendOpAlpha = blend_equation_to_d3d_op(equation);
|
||||
}
|
||||
|
||||
if (!blendInfo.fWriteColor) {
|
||||
if (!blendInfo.fWritesColor) {
|
||||
rtBlend.RenderTargetWriteMask = 0;
|
||||
} else {
|
||||
rtBlend.RenderTargetWriteMask = D3D12_COLOR_WRITE_ENABLE_ALL;
|
||||
|
@ -153,14 +153,14 @@ bool GrDawnCaps::onAreColorTypeAndFormatCompatible(GrColorType ct,
|
||||
|
||||
// FIXME: taken from GrVkPipelineState; refactor.
|
||||
static uint32_t get_blend_info_key(const GrPipeline& pipeline) {
|
||||
GrXferProcessor::BlendInfo blendInfo = pipeline.getXferProcessor().getBlendInfo();
|
||||
skgpu::BlendInfo blendInfo = pipeline.getXferProcessor().getBlendInfo();
|
||||
|
||||
static const uint32_t kBlendWriteShift = 1;
|
||||
static const uint32_t kBlendCoeffShift = 5;
|
||||
static_assert((int)skgpu::BlendCoeff::kLast < (1 << kBlendCoeffShift));
|
||||
static_assert((int)skgpu::BlendEquation::kFirstAdvanced - 1 < 4);
|
||||
|
||||
uint32_t key = blendInfo.fWriteColor;
|
||||
uint32_t key = blendInfo.fWritesColor;
|
||||
key |= ((int)blendInfo.fSrcBlend << kBlendWriteShift);
|
||||
key |= ((int)blendInfo.fDstBlend << (kBlendWriteShift + kBlendCoeffShift));
|
||||
key |= ((int)blendInfo.fEquation << (kBlendWriteShift + 2 * kBlendCoeffShift));
|
||||
|
@ -141,7 +141,7 @@ void GrDawnOpsRenderPass::applyState(GrDawnProgram* program, const GrProgramInfo
|
||||
fPassEncoder.SetStencilReference(get_stencil_ref(programInfo));
|
||||
}
|
||||
const GrPipeline& pipeline = programInfo.pipeline();
|
||||
GrXferProcessor::BlendInfo blendInfo = pipeline.getXferProcessor().getBlendInfo();
|
||||
skgpu::BlendInfo blendInfo = pipeline.getXferProcessor().getBlendInfo();
|
||||
const float* c = blendInfo.fBlendConstant.vec();
|
||||
wgpu::Color color{c[0], c[1], c[2], c[3]};
|
||||
fPassEncoder.SetBlendConstant(&color);
|
||||
|
@ -171,7 +171,7 @@ static wgpu::VertexFormat to_dawn_vertex_format(GrVertexAttribType type) {
|
||||
}
|
||||
|
||||
static wgpu::BlendState create_blend_state(const GrDawnGpu* gpu, const GrPipeline& pipeline) {
|
||||
GrXferProcessor::BlendInfo blendInfo = pipeline.getXferProcessor().getBlendInfo();
|
||||
skgpu::BlendInfo blendInfo = pipeline.getXferProcessor().getBlendInfo();
|
||||
skgpu::BlendEquation equation = blendInfo.fEquation;
|
||||
skgpu::BlendCoeff srcCoeff = blendInfo.fSrcBlend;
|
||||
skgpu::BlendCoeff dstCoeff = blendInfo.fDstBlend;
|
||||
@ -379,9 +379,9 @@ sk_sp<GrDawnProgram> GrDawnProgramBuilder::Build(GrDawnGpu* gpu,
|
||||
colorTargetState.format = colorFormat;
|
||||
colorTargetState.blend = &blendState;
|
||||
|
||||
bool writeColor = pipeline.getXferProcessor().getBlendInfo().fWriteColor;
|
||||
colorTargetState.writeMask = writeColor ? wgpu::ColorWriteMask::All
|
||||
: wgpu::ColorWriteMask::None;
|
||||
bool writesColor = pipeline.getXferProcessor().getBlendInfo().fWritesColor;
|
||||
colorTargetState.writeMask = writesColor ? wgpu::ColorWriteMask::All
|
||||
: wgpu::ColorWriteMask::None;
|
||||
|
||||
wgpu::FragmentState fragmentState;
|
||||
fragmentState.module = fsModule;
|
||||
|
@ -30,7 +30,7 @@ public:
|
||||
private:
|
||||
void onAddToKey(const GrShaderCaps&, skgpu::KeyBuilder*) const override;
|
||||
|
||||
void onGetBlendInfo(GrXferProcessor::BlendInfo* blendInfo) const override;
|
||||
void onGetBlendInfo(skgpu::BlendInfo* blendInfo) const override;
|
||||
|
||||
bool onIsEqual(const GrXferProcessor& xpBase) const override {
|
||||
const CoverageSetOpXP& xp = xpBase.cast<CoverageSetOpXP>();
|
||||
@ -64,7 +64,7 @@ std::unique_ptr<GrXferProcessor::ProgramImpl> CoverageSetOpXP::makeProgramImpl()
|
||||
return std::make_unique<Impl>();
|
||||
}
|
||||
|
||||
void CoverageSetOpXP::onGetBlendInfo(GrXferProcessor::BlendInfo* blendInfo) const {
|
||||
void CoverageSetOpXP::onGetBlendInfo(skgpu::BlendInfo* blendInfo) const {
|
||||
switch (fRegionOp) {
|
||||
case SkRegion::kReplace_Op:
|
||||
blendInfo->fSrcBlend = skgpu::BlendCoeff::kOne;
|
||||
|
@ -94,7 +94,7 @@ private:
|
||||
|
||||
void onAddToKey(const GrShaderCaps&, skgpu::KeyBuilder*) const override;
|
||||
|
||||
void onGetBlendInfo(BlendInfo*) const override;
|
||||
void onGetBlendInfo(skgpu::BlendInfo*) const override;
|
||||
|
||||
bool onIsEqual(const GrXferProcessor& xpBase) const override;
|
||||
|
||||
@ -185,7 +185,7 @@ GrXferBarrierType CustomXP::xferBarrierType(const GrCaps& caps) const {
|
||||
return kNone_GrXferBarrierType;
|
||||
}
|
||||
|
||||
void CustomXP::onGetBlendInfo(BlendInfo* blendInfo) const {
|
||||
void CustomXP::onGetBlendInfo(skgpu::BlendInfo* blendInfo) const {
|
||||
if (this->hasHWBlendEquation()) {
|
||||
blendInfo->fEquation = fHWBlendEquation;
|
||||
}
|
||||
|
@ -26,8 +26,8 @@ private:
|
||||
const char* name() const override { return "Disable Color"; }
|
||||
bool onIsEqual(const GrXferProcessor& xpBase) const override { return true; }
|
||||
void onAddToKey(const GrShaderCaps&, skgpu::KeyBuilder*) const override {}
|
||||
void onGetBlendInfo(GrXferProcessor::BlendInfo* blendInfo) const override {
|
||||
blendInfo->fWriteColor = false;
|
||||
void onGetBlendInfo(skgpu::BlendInfo* blendInfo) const override {
|
||||
blendInfo->fWritesColor = false;
|
||||
}
|
||||
std::unique_ptr<ProgramImpl> makeProgramImpl() const override;
|
||||
|
||||
|
@ -414,11 +414,11 @@ private:
|
||||
|
||||
bool onHasSecondaryOutput() const override { return fBlendFormula.hasSecondaryOutput(); }
|
||||
|
||||
void onGetBlendInfo(GrXferProcessor::BlendInfo* blendInfo) const override {
|
||||
void onGetBlendInfo(skgpu::BlendInfo* blendInfo) const override {
|
||||
blendInfo->fEquation = fBlendFormula.equation();
|
||||
blendInfo->fSrcBlend = fBlendFormula.srcCoeff();
|
||||
blendInfo->fDstBlend = fBlendFormula.dstCoeff();
|
||||
blendInfo->fWriteColor = fBlendFormula.modifiesDst();
|
||||
blendInfo->fWritesColor = fBlendFormula.modifiesDst();
|
||||
}
|
||||
|
||||
bool onIsEqual(const GrXferProcessor& xpBase) const override {
|
||||
@ -586,7 +586,7 @@ private:
|
||||
|
||||
void onAddToKey(const GrShaderCaps&, skgpu::KeyBuilder*) const override {}
|
||||
|
||||
void onGetBlendInfo(GrXferProcessor::BlendInfo* blendInfo) const override {
|
||||
void onGetBlendInfo(skgpu::BlendInfo* blendInfo) const override {
|
||||
blendInfo->fSrcBlend = skgpu::BlendCoeff::kConstC;
|
||||
blendInfo->fDstBlend = skgpu::BlendCoeff::kISC;
|
||||
blendInfo->fBlendConstant = fBlendConstant;
|
||||
|
@ -2583,12 +2583,12 @@ void GrGLGpu::flushWireframeState(bool enabled) {
|
||||
}
|
||||
}
|
||||
|
||||
void GrGLGpu::flushBlendAndColorWrite(
|
||||
const GrXferProcessor::BlendInfo& blendInfo, const skgpu::Swizzle& swizzle) {
|
||||
if (this->glCaps().neverDisableColorWrites() && !blendInfo.fWriteColor) {
|
||||
void GrGLGpu::flushBlendAndColorWrite(const skgpu::BlendInfo& blendInfo,
|
||||
const skgpu::Swizzle& swizzle) {
|
||||
if (this->glCaps().neverDisableColorWrites() && !blendInfo.fWritesColor) {
|
||||
// We need to work around a driver bug by using a blend state that preserves the dst color,
|
||||
// rather than disabling color writes.
|
||||
GrXferProcessor::BlendInfo preserveDstBlend;
|
||||
skgpu::BlendInfo preserveDstBlend;
|
||||
preserveDstBlend.fSrcBlend = skgpu::BlendCoeff::kZero;
|
||||
preserveDstBlend.fDstBlend = skgpu::BlendCoeff::kOne;
|
||||
this->flushBlendAndColorWrite(preserveDstBlend, swizzle);
|
||||
@ -2602,7 +2602,7 @@ void GrGLGpu::flushBlendAndColorWrite(
|
||||
// Any optimization to disable blending should have already been applied and
|
||||
// tweaked the equation to "add" or "subtract", and the coeffs to (1, 0).
|
||||
bool blendOff = skgpu::BlendShouldDisable(equation, srcCoeff, dstCoeff) ||
|
||||
!blendInfo.fWriteColor;
|
||||
!blendInfo.fWritesColor;
|
||||
|
||||
if (blendOff) {
|
||||
if (kNo_TriState != fHWBlendState.fEnabled) {
|
||||
@ -2671,7 +2671,7 @@ void GrGLGpu::flushBlendAndColorWrite(
|
||||
}
|
||||
}
|
||||
|
||||
this->flushColorWrite(blendInfo.fWriteColor);
|
||||
this->flushColorWrite(blendInfo.fWritesColor);
|
||||
}
|
||||
|
||||
void GrGLGpu::bindTexture(int unitIdx, GrSamplerState samplerState, const skgpu::Swizzle& swizzle,
|
||||
@ -3444,7 +3444,7 @@ bool GrGLGpu::copySurfaceAsDraw(GrSurface* dst, bool drawToMultisampleFBO, GrSur
|
||||
GL_CALL(Uniform4f(fCopyPrograms[progIdx].fTexCoordXformUniform,
|
||||
sx1 - sx0, sy1 - sy0, sx0, sy0));
|
||||
GL_CALL(Uniform1i(fCopyPrograms[progIdx].fTextureUniform, 0));
|
||||
this->flushBlendAndColorWrite(GrXferProcessor::BlendInfo(), skgpu::Swizzle::RGBA());
|
||||
this->flushBlendAndColorWrite(skgpu::BlendInfo(), skgpu::Swizzle::RGBA());
|
||||
this->flushConservativeRasterState(false);
|
||||
this->flushWireframeState(false);
|
||||
this->flushScissorTest(GrScissorTest::kDisabled);
|
||||
@ -3581,7 +3581,7 @@ bool GrGLGpu::onRegenerateMipMapLevels(GrTexture* texture) {
|
||||
SkSLType::kFloat2, 2 * sizeof(GrGLfloat), 0);
|
||||
|
||||
// Set "simple" state once:
|
||||
this->flushBlendAndColorWrite(GrXferProcessor::BlendInfo(), skgpu::Swizzle::RGBA());
|
||||
this->flushBlendAndColorWrite(skgpu::BlendInfo(), skgpu::Swizzle::RGBA());
|
||||
this->flushScissorTest(GrScissorTest::kDisabled);
|
||||
this->disableWindowRectangles();
|
||||
this->disableStencil();
|
||||
|
@ -361,8 +361,7 @@ private:
|
||||
// binds texture unit in GL
|
||||
void setTextureUnit(int unitIdx);
|
||||
|
||||
void flushBlendAndColorWrite(const GrXferProcessor::BlendInfo& blendInfo,
|
||||
const skgpu::Swizzle&);
|
||||
void flushBlendAndColorWrite(const skgpu::BlendInfo&, const skgpu::Swizzle&);
|
||||
|
||||
void addFinishedProc(GrGpuFinishedProc finishedProc,
|
||||
GrGpuFinishedContext finishedContext) override;
|
||||
|
@ -164,7 +164,7 @@ void GrMtlPipelineState::setBlendConstants(GrMtlRenderCommandEncoder* renderCmdE
|
||||
return;
|
||||
}
|
||||
|
||||
const GrXferProcessor::BlendInfo& blendInfo = xferProcessor.getBlendInfo();
|
||||
const skgpu::BlendInfo& blendInfo = xferProcessor.getBlendInfo();
|
||||
skgpu::BlendCoeff srcCoeff = blendInfo.fSrcBlend;
|
||||
skgpu::BlendCoeff dstCoeff = blendInfo.fDstBlend;
|
||||
if (skgpu::BlendCoeffRefsConstant(srcCoeff) || skgpu::BlendCoeffRefsConstant(dstCoeff)) {
|
||||
|
@ -342,7 +342,7 @@ static MTLRenderPipelineColorAttachmentDescriptor* create_color_attachment(
|
||||
}
|
||||
|
||||
// blending
|
||||
const GrXferProcessor::BlendInfo& blendInfo = pipeline.getXferProcessor().getBlendInfo();
|
||||
const skgpu::BlendInfo& blendInfo = pipeline.getXferProcessor().getBlendInfo();
|
||||
|
||||
skgpu::BlendEquation equation = blendInfo.fEquation;
|
||||
skgpu::BlendCoeff srcCoeff = blendInfo.fSrcBlend;
|
||||
@ -370,13 +370,13 @@ static MTLRenderPipelineColorAttachmentDescriptor* create_color_attachment(
|
||||
}
|
||||
}
|
||||
|
||||
if (blendInfo.fWriteColor) {
|
||||
if (blendInfo.fWritesColor) {
|
||||
mtlColorAttachment.writeMask = MTLColorWriteMaskAll;
|
||||
} else {
|
||||
mtlColorAttachment.writeMask = MTLColorWriteMaskNone;
|
||||
}
|
||||
if (writer) {
|
||||
writer->writeBool(blendInfo.fWriteColor);
|
||||
writer->writeBool(blendInfo.fWritesColor);
|
||||
}
|
||||
return mtlColorAttachment;
|
||||
}
|
||||
|
@ -377,7 +377,7 @@ static VkBlendOp blend_equation_to_vk_blend_op(skgpu::BlendEquation equation) {
|
||||
return gTable[(int)equation];
|
||||
}
|
||||
|
||||
static void setup_color_blend_state(const GrXferProcessor::BlendInfo& blendInfo,
|
||||
static void setup_color_blend_state(const skgpu::BlendInfo& blendInfo,
|
||||
VkPipelineColorBlendStateCreateInfo* colorBlendInfo,
|
||||
VkPipelineColorBlendAttachmentState* attachmentState) {
|
||||
skgpu::BlendEquation equation = blendInfo.fEquation;
|
||||
@ -396,7 +396,7 @@ static void setup_color_blend_state(const GrXferProcessor::BlendInfo& blendInfo,
|
||||
attachmentState->alphaBlendOp = blend_equation_to_vk_blend_op(equation);
|
||||
}
|
||||
|
||||
if (!blendInfo.fWriteColor) {
|
||||
if (!blendInfo.fWritesColor) {
|
||||
attachmentState->colorWriteMask = 0;
|
||||
} else {
|
||||
attachmentState->colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT |
|
||||
@ -467,7 +467,7 @@ sk_sp<GrVkPipeline> GrVkPipeline::Make(GrVkGpu* gpu,
|
||||
const GrStencilSettings& stencilSettings,
|
||||
int numSamples,
|
||||
bool isHWAntialiasState,
|
||||
const GrXferProcessor::BlendInfo& blendInfo,
|
||||
const skgpu::BlendInfo& blendInfo,
|
||||
bool isWireframe,
|
||||
bool useConservativeRaster,
|
||||
uint32_t subpass,
|
||||
@ -644,7 +644,7 @@ void GrVkPipeline::SetDynamicBlendConstantState(GrVkGpu* gpu,
|
||||
GrVkCommandBuffer* cmdBuffer,
|
||||
const skgpu::Swizzle& swizzle,
|
||||
const GrXferProcessor& xferProcessor) {
|
||||
const GrXferProcessor::BlendInfo& blendInfo = xferProcessor.getBlendInfo();
|
||||
const skgpu::BlendInfo& blendInfo = xferProcessor.getBlendInfo();
|
||||
skgpu::BlendCoeff srcCoeff = blendInfo.fSrcBlend;
|
||||
skgpu::BlendCoeff dstCoeff = blendInfo.fDstBlend;
|
||||
float floatColors[4];
|
||||
|
@ -10,8 +10,8 @@
|
||||
|
||||
#include "include/gpu/vk/GrVkTypes.h"
|
||||
#include "include/private/gpu/ganesh/GrTypesPriv.h"
|
||||
#include "src/gpu/Blend.h"
|
||||
#include "src/gpu/ganesh/GrGeometryProcessor.h"
|
||||
#include "src/gpu/ganesh/GrXferProcessor.h"
|
||||
#include "src/gpu/ganesh/vk/GrVkManagedResource.h"
|
||||
|
||||
#include <cinttypes>
|
||||
@ -23,6 +23,7 @@ class GrStencilSettings;
|
||||
class GrVkCommandBuffer;
|
||||
class GrVkGpu;
|
||||
class GrVkRenderPass;
|
||||
class GrXferProcessor;
|
||||
struct SkIRect;
|
||||
|
||||
namespace skgpu {
|
||||
@ -39,7 +40,7 @@ public:
|
||||
const GrStencilSettings&,
|
||||
int numSamples,
|
||||
bool isHWAntialiasState,
|
||||
const GrXferProcessor::BlendInfo&,
|
||||
const skgpu::BlendInfo&,
|
||||
bool isWireframe,
|
||||
bool useConservativeRaster,
|
||||
uint32_t subpass,
|
||||
|
@ -301,7 +301,7 @@ sk_sp<const GrVkPipeline> GrVkResourceProvider::findOrCreateMSAALoadPipeline(
|
||||
GrStencilSettings(),
|
||||
numSamples,
|
||||
/*isHWantialiasState=*/false,
|
||||
GrXferProcessor::BlendInfo(),
|
||||
skgpu::BlendInfo(),
|
||||
/*isWireframe=*/false,
|
||||
/*useConservativeRaster=*/false,
|
||||
/*subpass=*/0,
|
||||
|
@ -182,7 +182,7 @@ std::string get_sksl_vs(const GraphicsPipelineDesc& desc) {
|
||||
|
||||
std::string get_sksl_fs(SkShaderCodeDictionary* dict,
|
||||
const GraphicsPipelineDesc& desc,
|
||||
SkPipelineDataGatherer::BlendInfo* blendInfo) {
|
||||
BlendInfo* blendInfo) {
|
||||
if (!desc.paintParamsID().isValid()) {
|
||||
// TODO: we should return the error shader code here
|
||||
return {};
|
||||
@ -406,7 +406,7 @@ static MTLBlendOperation blend_equation_to_mtl_blend_op(skgpu::BlendEquation equ
|
||||
|
||||
static MTLRenderPipelineColorAttachmentDescriptor* create_color_attachment(
|
||||
MTLPixelFormat format,
|
||||
const SkPipelineDataGatherer::BlendInfo& blendInfo) {
|
||||
const BlendInfo& blendInfo) {
|
||||
|
||||
skgpu::BlendEquation equation = blendInfo.fEquation;
|
||||
skgpu::BlendCoeff srcCoeff = blendInfo.fSrcBlend;
|
||||
@ -520,7 +520,7 @@ sk_sp<MtlGraphicsPipeline> MtlGraphicsPipeline::Make(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SkPipelineDataGatherer::BlendInfo blendInfo;
|
||||
BlendInfo blendInfo;
|
||||
auto dict = resourceProvider->shaderCodeDictionary();
|
||||
if (!SkSLToMSL(gpu,
|
||||
get_sksl_fs(dict, pipelineDesc, &blendInfo),
|
||||
|
@ -113,7 +113,7 @@ public:
|
||||
bool fIgnoresInputColor;
|
||||
int fPrimaryOutputType;
|
||||
int fSecondaryOutputType;
|
||||
GrXferProcessor::BlendInfo fBlendInfo;
|
||||
skgpu::BlendInfo fBlendInfo;
|
||||
};
|
||||
|
||||
static void GetXPOutputTypes(const GrXferProcessor* xp, int* outPrimary, int* outSecondary) {
|
||||
@ -138,7 +138,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps)
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrc:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -149,7 +149,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps)
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDst:
|
||||
TEST_ASSERT(xpi.fIgnoresInputColor);
|
||||
@ -160,7 +160,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps)
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrcOver:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -171,7 +171,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps)
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kIS2C == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDstOver:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -182,7 +182,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps)
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrcIn:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -193,7 +193,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps)
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDstIn:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -204,7 +204,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps)
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrcOut:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -215,7 +215,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps)
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDstOut:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -226,7 +226,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps)
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrcATop:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -237,7 +237,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps)
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDstATop:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -248,7 +248,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps)
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kXor:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -259,7 +259,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps)
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kPlus:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -270,7 +270,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps)
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kModulate:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -281,7 +281,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps)
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kScreen:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -292,7 +292,7 @@ static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps)
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
default:
|
||||
ERRORF(reporter, "Invalid xfermode.");
|
||||
@ -317,7 +317,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kReverseSubtract == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kDC == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrc:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -328,7 +328,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kIS2A == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDst:
|
||||
TEST_ASSERT(xpi.fIgnoresInputColor);
|
||||
@ -339,7 +339,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(!xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(!xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrcOver:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -350,7 +350,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kISA == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDstOver:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -361,7 +361,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kIDA == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrcIn:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -372,7 +372,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kDA == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kIS2A == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDstIn:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -383,7 +383,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kReverseSubtract == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kDC == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrcOut:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -394,7 +394,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kIDA == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kIS2A == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDstOut:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -405,7 +405,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kISA == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrcATop:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -416,7 +416,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kDA == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kISA == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDstATop:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -427,7 +427,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kIDA == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kIS2C == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kXor:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -438,7 +438,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kIDA == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kISA == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kPlus:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -449,7 +449,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kModulate:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -460,7 +460,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kReverseSubtract == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kDC == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kScreen:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -471,7 +471,7 @@ static void test_color_unknown_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kISC == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
default:
|
||||
ERRORF(reporter, "Invalid xfermode.");
|
||||
@ -498,7 +498,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrc:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -509,7 +509,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDst:
|
||||
TEST_ASSERT(xpi.fIgnoresInputColor);
|
||||
@ -520,7 +520,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(!xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(!xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrcOver:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -531,7 +531,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kISA == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDstOver:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -542,7 +542,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kIDA == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrcIn:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -553,7 +553,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kDA == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDstIn:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -564,7 +564,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kSA == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrcOut:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -575,7 +575,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kIDA == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDstOut:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -586,7 +586,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kISA == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrcATop:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -597,7 +597,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kDA == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kISA == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDstATop:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -608,7 +608,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kIDA == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kSA == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kXor:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -619,7 +619,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kIDA == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kISA == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kPlus:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -630,7 +630,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kModulate:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -641,7 +641,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kSC == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kScreen:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -652,7 +652,7 @@ static void test_color_not_opaque_no_coverage(skiatest::Reporter* reporter, cons
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kISC == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
default:
|
||||
ERRORF(reporter, "Invalid xfermode.");
|
||||
@ -678,7 +678,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kReverseSubtract == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kDC == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrc:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -689,7 +689,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kISA == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDst:
|
||||
TEST_ASSERT(xpi.fIgnoresInputColor);
|
||||
@ -700,7 +700,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(!xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(!xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrcOver:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -711,7 +711,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kISA == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDstOver:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -722,7 +722,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kIDA == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrcIn:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -733,7 +733,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kDA == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kISA == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDstIn:
|
||||
TEST_ASSERT(xpi.fIgnoresInputColor);
|
||||
@ -744,7 +744,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(!xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(!xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrcOut:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -755,7 +755,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kIDA == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kISA == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDstOut:
|
||||
TEST_ASSERT(xpi.fIgnoresInputColor);
|
||||
@ -766,7 +766,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kReverseSubtract == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kDC == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrcATop:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -777,7 +777,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kDA == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kISA == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDstATop:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -788,7 +788,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kIDA == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kXor:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -799,7 +799,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kIDA == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kISA == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kPlus:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -810,7 +810,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kModulate:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -819,7 +819,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kReverseSubtract == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kDC == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kScreen:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -830,7 +830,7 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kISC == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
default:
|
||||
ERRORF(reporter, "Invalid xfermode.");
|
||||
@ -857,7 +857,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrc:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -868,7 +868,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDst:
|
||||
TEST_ASSERT(xpi.fIgnoresInputColor);
|
||||
@ -879,7 +879,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(!xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(!xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrcOver:
|
||||
// We don't specialize opaque src-over. See note in GrPorterDuffXferProcessor.cpp
|
||||
@ -895,7 +895,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr
|
||||
} else {
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kISA == xpi.fBlendInfo.fDstBlend);
|
||||
}
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDstOver:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -906,7 +906,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kIDA == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrcIn:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -917,7 +917,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kDA == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDstIn:
|
||||
TEST_ASSERT(xpi.fIgnoresInputColor);
|
||||
@ -928,7 +928,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(!xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(!xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrcOut:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -939,7 +939,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kIDA == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDstOut:
|
||||
TEST_ASSERT(xpi.fIgnoresInputColor);
|
||||
@ -950,7 +950,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kSrcATop:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -961,7 +961,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kDA == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kDstATop:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -972,7 +972,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kIDA == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kXor:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -983,7 +983,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kIDA == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kPlus:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -994,7 +994,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kModulate:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -1005,7 +1005,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kZero == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kSC == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
case SkBlendMode::kScreen:
|
||||
TEST_ASSERT(!xpi.fIgnoresInputColor);
|
||||
@ -1016,7 +1016,7 @@ static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const Gr
|
||||
TEST_ASSERT(skgpu::BlendEquation::kAdd == xpi.fBlendInfo.fEquation);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kOne == xpi.fBlendInfo.fSrcBlend);
|
||||
TEST_ASSERT(skgpu::BlendCoeff::kISC == xpi.fBlendInfo.fDstBlend);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWriteColor);
|
||||
TEST_ASSERT(xpi.fBlendInfo.fWritesColor);
|
||||
break;
|
||||
default:
|
||||
ERRORF(reporter, "Invalid xfermode.");
|
||||
@ -1039,8 +1039,8 @@ static void test_lcd_coverage_fallback_case(skiatest::Reporter* reporter, const
|
||||
return;
|
||||
}
|
||||
|
||||
GrXferProcessor::BlendInfo blendInfo = xp_opaque->getBlendInfo();
|
||||
TEST_ASSERT(blendInfo.fWriteColor);
|
||||
skgpu::BlendInfo blendInfo = xp_opaque->getBlendInfo();
|
||||
TEST_ASSERT(blendInfo.fWritesColor);
|
||||
|
||||
// Test with non-opaque alpha
|
||||
color = SkPMColor4f::FromBytes_RGBA(GrColorPackRGBA(123, 45, 67, 221));
|
||||
@ -1055,7 +1055,7 @@ static void test_lcd_coverage_fallback_case(skiatest::Reporter* reporter, const
|
||||
}
|
||||
|
||||
blendInfo = xp->getBlendInfo();
|
||||
TEST_ASSERT(blendInfo.fWriteColor);
|
||||
TEST_ASSERT(blendInfo.fWritesColor);
|
||||
}
|
||||
|
||||
DEF_GPUTEST(PorterDuffNoDualSourceBlending, reporter, options) {
|
||||
|
Loading…
Reference in New Issue
Block a user