diff options
author | Brian Salomon <bsalomon@google.com> | 2017-05-03 17:06:09 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-03 21:41:38 +0000 |
commit | 6d4b65e9dad972a09aa1928d28a1739ab6c77d4c (patch) | |
tree | ac3423d10f2b22b821db98e9a3f8c6e445e2d871 /src/gpu/GrProcessorSet.h | |
parent | cc413b0cf1ea22e8ca80b7289b8c0a0278dbc083 (diff) |
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>
Diffstat (limited to 'src/gpu/GrProcessorSet.h')
-rw-r--r-- | src/gpu/GrProcessorSet.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/gpu/GrProcessorSet.h b/src/gpu/GrProcessorSet.h index 6ebb00bee2..56cbee1cac 100644 --- a/src/gpu/GrProcessorSet.h +++ b/src/gpu/GrProcessorSet.h @@ -18,6 +18,10 @@ class GrXferProcessor; 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 @@ public: } 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 @@ public: 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 @@ private: union XP { XP(const GrXPFactory* factory) : fFactory(factory) {} + XP(const GrXferProcessor* processor) : fProcessor(processor) {} const GrXPFactory* fFactory; const GrXferProcessor* fProcessor; }; @@ -141,7 +160,7 @@ private: SkAutoSTArray<4, const GrFragmentProcessor*> fFragmentProcessors; XP fXP; - uint8_t fColorFragmentProcessorCnt; + uint8_t fColorFragmentProcessorCnt = 0; uint8_t fFragmentProcessorOffset = 0; uint8_t fFlags; }; |