Revert "Revert "Add a new non-AA rect op that does not inherit from GrLegacyMeshDrawOp.""
This reverts commit 0f353327968530506dd3dd15fca79ef59fe013f1.
Bug: skia:
Change-Id: I8def56fa55bfc70de4386bf0b7a7867f6e91c173
Reviewed-on: https://skia-review.googlesource.com/15251
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrProcessorSet.h b/src/gpu/GrProcessorSet.h
index 6ebb00b..56cbee1 100644
--- a/src/gpu/GrProcessorSet.h
+++ b/src/gpu/GrProcessorSet.h
@@ -18,6 +18,10 @@
class GrXPFactory;
class GrProcessorSet : private SkNoncopyable {
+private:
+ // Arbitrary constructor arg for empty set and analysis
+ enum class Empty { kEmpty };
+
public:
GrProcessorSet(GrPaint&& paint);
@@ -80,6 +84,14 @@
}
private:
+ constexpr Analysis(Empty)
+ : fUsesLocalCoords(false)
+ , fCompatibleWithCoverageAsAlpha(true)
+ , fRequiresDstTexture(false)
+ , fCanCombineOverlappedStencilAndCover(true)
+ , fRequiresBarrierBetweenOverlappingDraws(false)
+ , fIsInitialized(true)
+ , fInputColorType(kOriginal_InputColorType) {}
enum InputColorType : uint32_t {
kOriginal_InputColorType,
kOverridden_InputColorType,
@@ -122,7 +134,13 @@
bool isFinalized() const { return SkToBool(kFinalized_Flag & fFlags); }
+ static const GrProcessorSet& EmptySet() { return gEmpty; }
+ static constexpr const Analysis EmptySetAnalysis() { return Analysis(Empty::kEmpty); }
+
private:
+ GrProcessorSet(Empty) : fXP((const GrXferProcessor*)nullptr), fFlags(kFinalized_Flag) {}
+ static const GrProcessorSet gEmpty;
+
// This absurdly large limit allows Analysis and this to pack fields together.
static constexpr int kMaxColorProcessors = UINT8_MAX;
@@ -130,6 +148,7 @@
union XP {
XP(const GrXPFactory* factory) : fFactory(factory) {}
+ XP(const GrXferProcessor* processor) : fProcessor(processor) {}
const GrXPFactory* fFactory;
const GrXferProcessor* fProcessor;
};
@@ -141,7 +160,7 @@
SkAutoSTArray<4, const GrFragmentProcessor*> fFragmentProcessors;
XP fXP;
- uint8_t fColorFragmentProcessorCnt;
+ uint8_t fColorFragmentProcessorCnt = 0;
uint8_t fFragmentProcessorOffset = 0;
uint8_t fFlags;
};