[graphite] Remove DepthStencilOnly handling
I believe this was only needed during the sprint, before we had RenderSteps. Bug: skia:12701 Change-Id: I4945fc69f9c1cd419b8c3143b6638e4769761ff9 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/541976 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
This commit is contained in:
parent
effd0aeccd
commit
16f1505498
@ -37,7 +37,6 @@ class TextureInfo;
|
||||
|
||||
struct ShaderCombo {
|
||||
enum class ShaderType {
|
||||
kNone, // does not modify color buffer, e.g. depth and/or stencil only
|
||||
kSolidColor,
|
||||
kLinearGradient,
|
||||
kRadialGradient,
|
||||
|
@ -12,10 +12,6 @@
|
||||
|
||||
// TODO: this needs to be expanded into a more flexible dictionary (esp. for user-supplied SkSL)
|
||||
enum class SkBuiltInCodeSnippetID : uint8_t {
|
||||
// TODO: It seems like this requires some refinement. Fundamentally this doesn't seem like a
|
||||
// draw that originated from a PaintParams.
|
||||
kDepthStencilOnlyDraw,
|
||||
|
||||
// This isn't just a signal for a failure during paintparams key creation. It also actually
|
||||
// implements the default behavior for an erroneous draw. Currently it just draws solid
|
||||
// magenta.
|
||||
|
@ -29,6 +29,7 @@ constexpr SkPMColor4f kErrorColor = { 1, 0, 0, 1 };
|
||||
|
||||
namespace {
|
||||
|
||||
#ifdef SK_GRAPHITE_ENABLED
|
||||
// This can be used to catch errors in blocks that have a fixed, known block data size
|
||||
void validate_block_header(const SkPaintParamsKeyBuilder* builder,
|
||||
SkBuiltInCodeSnippetID codeSnippetID,
|
||||
@ -39,26 +40,10 @@ void validate_block_header(const SkPaintParamsKeyBuilder* builder,
|
||||
SkASSERT(builder->byte(headerOffset+SkPaintParamsKey::kBlockSizeOffsetInBytes) ==
|
||||
fullBlockSize);
|
||||
}
|
||||
#endif
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
namespace DepthStencilOnlyBlock {
|
||||
|
||||
static const int kBlockDataSize = 0;
|
||||
|
||||
void AddToKey(const SkKeyContext& /* keyContext */,
|
||||
SkPaintParamsKeyBuilder* builder,
|
||||
SkPipelineDataGatherer* /* gatherer */) {
|
||||
builder->beginBlock(SkBuiltInCodeSnippetID::kDepthStencilOnlyDraw);
|
||||
builder->endBlock();
|
||||
|
||||
validate_block_header(builder,
|
||||
SkBuiltInCodeSnippetID::kDepthStencilOnlyDraw,
|
||||
kBlockDataSize);
|
||||
}
|
||||
|
||||
} // namespace DepthStencilOnlyBlock
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
namespace SolidColorShaderBlock {
|
||||
@ -689,9 +674,6 @@ SkUniquePaintParamsID CreateKey(const SkKeyContext& keyContext,
|
||||
SkDEBUGCODE(builder->checkReset());
|
||||
|
||||
switch (s) {
|
||||
case skgpu::graphite::ShaderCombo::ShaderType::kNone:
|
||||
DepthStencilOnlyBlock::AddToKey(keyContext, builder, nullptr);
|
||||
break;
|
||||
case skgpu::graphite::ShaderCombo::ShaderType::kSolidColor:
|
||||
SolidColorShaderBlock::AddToKey(keyContext, builder, nullptr, kErrorColor);
|
||||
break;
|
||||
|
@ -711,16 +711,6 @@ SkShaderCodeDictionary::SkShaderCodeDictionary() {
|
||||
// The 0th index is reserved as invalid
|
||||
fEntryVector.push_back(nullptr);
|
||||
|
||||
fBuiltInCodeSnippets[(int) SkBuiltInCodeSnippetID::kDepthStencilOnlyDraw] = {
|
||||
"DepthStencil",
|
||||
{ }, // no uniforms
|
||||
SnippetRequirementFlags::kNone,
|
||||
{ }, // no samplers
|
||||
kErrorName,
|
||||
GenerateDefaultGlueCode,
|
||||
kNoChildren,
|
||||
{}
|
||||
};
|
||||
fBuiltInCodeSnippets[(int) SkBuiltInCodeSnippetID::kError] = {
|
||||
"Error",
|
||||
{ }, // no uniforms
|
||||
|
@ -37,9 +37,6 @@ std::tuple<SkPaint, int> create_paint(ShaderCombo::ShaderType shaderType,
|
||||
sk_sp<SkShader> s;
|
||||
int numTextures = 0;
|
||||
switch (shaderType) {
|
||||
case ShaderCombo::ShaderType::kNone:
|
||||
SkDEBUGFAIL("kNone cannot be represented as an SkPaint");
|
||||
break;
|
||||
case ShaderCombo::ShaderType::kSolidColor:
|
||||
break;
|
||||
case ShaderCombo::ShaderType::kLinearGradient:
|
||||
|
Loading…
Reference in New Issue
Block a user