Move user stencil settings from GrPipeline to GrProgramInfo
Bug: skia:10419
Change-Id: If11d28f6d9348ba0011825f719123c09f0103603
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319481
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrPipeline.h b/src/gpu/GrPipeline.h
index 43f278d..fcc35d2 100644
--- a/src/gpu/GrPipeline.h
+++ b/src/gpu/GrPipeline.h
@@ -67,7 +67,6 @@
struct InitArgs {
InputFlags fInputFlags = InputFlags::kNone;
- const GrUserStencilSettings* fUserStencil = &GrUserStencilSettings::kUnused;
const GrCaps* fCaps = nullptr;
GrXferProcessor::DstProxyView fDstProxyView;
GrSwizzle fWriteSwizzle;
@@ -81,19 +80,16 @@
GrPipeline(GrScissorTest scissor,
SkBlendMode blend,
const GrSwizzle& writeSwizzle,
- InputFlags flags = InputFlags::kNone,
- const GrUserStencilSettings* stencil = &GrUserStencilSettings::kUnused)
+ InputFlags flags = InputFlags::kNone)
: GrPipeline(scissor,
GrPorterDuffXPFactory::MakeNoCoverageXP(blend),
writeSwizzle,
- flags,
- stencil) {}
+ flags) {}
GrPipeline(GrScissorTest,
sk_sp<const GrXferProcessor>,
const GrSwizzle& writeSwizzle,
- InputFlags = InputFlags::kNone,
- const GrUserStencilSettings* = &GrUserStencilSettings::kUnused);
+ InputFlags = InputFlags::kNone);
GrPipeline(const InitArgs& args, sk_sp<const GrXferProcessor>, const GrAppliedHardClip&);
GrPipeline(const InitArgs&, GrProcessorSet&&, GrAppliedClip&&);
@@ -167,14 +163,6 @@
/// @}
- const GrUserStencilSettings* getUserStencil() const { return fUserStencilSettings; }
- void setUserStencil(const GrUserStencilSettings* stencil) {
- fUserStencilSettings = stencil;
- if (!fUserStencilSettings->isDisabled(fFlags & Flags::kHasStencilClip)) {
- fFlags |= Flags::kStencilEnabled;
- }
- }
-
bool isScissorTestEnabled() const {
return SkToBool(fFlags & Flags::kScissorTestEnabled);
}
@@ -190,9 +178,6 @@
bool hasStencilClip() const {
return SkToBool(fFlags & Flags::kHasStencilClip);
}
- bool isStencilEnabled() const {
- return SkToBool(fFlags & Flags::kStencilEnabled);
- }
#ifdef SK_DEBUG
bool allProxiesInstantiated() const {
for (int i = 0; i < fFragmentProcessors.count(); ++i) {
@@ -223,8 +208,7 @@
/** This is a continuation of the public "InputFlags" enum. */
enum class Flags : uint8_t {
kHasStencilClip = (kLastInputFlag << 1),
- kStencilEnabled = (kLastInputFlag << 2),
- kScissorTestEnabled = (kLastInputFlag << 3),
+ kScissorTestEnabled = (kLastInputFlag << 2),
};
GR_DECL_BITFIELD_CLASS_OPS_FRIENDS(Flags);
@@ -241,7 +225,6 @@
// GrDstSampleType).
GrDstSampleType fDstSampleType = GrDstSampleType::kNone;
GrWindowRectsState fWindowRectsState;
- const GrUserStencilSettings* fUserStencilSettings;
Flags fFlags;
sk_sp<const GrXferProcessor> fXferProcessor;
FragmentProcessorArray fFragmentProcessors;