egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 1 | /* |
egdaniel | 8dd688b | 2015-01-22 10:16:09 -0800 | [diff] [blame] | 2 | * Copyright 2015 Google Inc. |
egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
egdaniel | 8dd688b | 2015-01-22 10:16:09 -0800 | [diff] [blame] | 8 | #ifndef GrPipeline_DEFINED |
| 9 | #define GrPipeline_DEFINED |
egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 10 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 11 | #include "include/core/SkMatrix.h" |
| 12 | #include "include/core/SkRefCnt.h" |
Greg Daniel | f91aeb2 | 2019-06-18 09:58:02 -0400 | [diff] [blame] | 13 | #include "src/gpu/GrColor.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 14 | #include "src/gpu/GrFragmentProcessor.h" |
| 15 | #include "src/gpu/GrNonAtomicRef.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 16 | #include "src/gpu/GrProcessorSet.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 17 | #include "src/gpu/GrScissorState.h" |
Greg Daniel | 524e28b | 2019-11-01 11:48:53 -0400 | [diff] [blame] | 18 | #include "src/gpu/GrSurfaceProxyView.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 19 | #include "src/gpu/GrUserStencilSettings.h" |
| 20 | #include "src/gpu/GrWindowRectsState.h" |
| 21 | #include "src/gpu/effects/GrCoverageSetOpXP.h" |
| 22 | #include "src/gpu/effects/GrDisableColorXP.h" |
| 23 | #include "src/gpu/effects/GrPorterDuffXferProcessor.h" |
Brian Salomon | b8f098d | 2020-01-07 11:15:44 -0500 | [diff] [blame] | 24 | #include "src/gpu/effects/GrTextureEffect.h" |
Michael Ludwig | 663afe5 | 2019-06-03 16:46:19 -0400 | [diff] [blame] | 25 | #include "src/gpu/geometry/GrRect.h" |
robertphillips | 5fa7f30 | 2016-07-21 09:21:04 -0700 | [diff] [blame] | 26 | |
Brian Salomon | 652ecb5 | 2017-01-17 12:39:53 -0500 | [diff] [blame] | 27 | class GrAppliedClip; |
Chris Dalton | b832ce6 | 2020-01-06 19:49:37 -0700 | [diff] [blame] | 28 | class GrAppliedHardClip; |
Brian Salomon | 25a8809 | 2016-12-01 09:36:50 -0500 | [diff] [blame] | 29 | class GrOp; |
Brian Salomon | 25a8809 | 2016-12-01 09:36:50 -0500 | [diff] [blame] | 30 | class GrRenderTargetContext; |
egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 31 | |
Brian Salomon | 92aee3d | 2016-12-21 09:20:25 -0500 | [diff] [blame] | 32 | /** |
Brian Salomon | e5b399e | 2017-07-19 13:50:54 -0400 | [diff] [blame] | 33 | * This immutable object contains information needed to set build a shader program and set API |
| 34 | * state for a draw. It is used along with a GrPrimitiveProcessor and a source of geometric |
Chris Dalton | eb694b7 | 2020-03-16 09:25:50 -0600 | [diff] [blame] | 35 | * data to draw. |
egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 36 | */ |
Brian Salomon | 1635146 | 2017-07-19 16:35:31 -0400 | [diff] [blame] | 37 | class GrPipeline { |
egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 38 | public: |
bsalomon | cb02b38 | 2015-08-12 11:14:50 -0700 | [diff] [blame] | 39 | /////////////////////////////////////////////////////////////////////////// |
| 40 | /// @name Creation |
| 41 | |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 42 | // Pipeline options that the caller may enable. |
| 43 | // NOTE: This enum is extended later by GrPipeline::Flags. |
| 44 | enum class InputFlags : uint8_t { |
| 45 | kNone = 0, |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame] | 46 | /** |
| 47 | * Perform HW anti-aliasing. This means either HW FSAA, if supported by the render target, |
| 48 | * or smooth-line rendering if a line primitive is drawn and line smoothing is supported by |
| 49 | * the 3D API. |
| 50 | */ |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 51 | kHWAntialias = (1 << 0), |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame] | 52 | /** |
Chris Dalton | ce425af | 2019-12-16 10:39:03 -0700 | [diff] [blame] | 53 | * Cause every pixel to be rasterized that is touched by the triangle anywhere (not just at |
| 54 | * pixel center). Additionally, if using MSAA, the sample mask will always have 100% |
| 55 | * coverage. |
| 56 | * NOTE: The primitive type must be a triangle type. |
| 57 | */ |
| 58 | kConservativeRaster = (1 << 1), |
| 59 | /** |
Chris Dalton | 1215cda | 2019-12-17 21:44:04 -0700 | [diff] [blame] | 60 | * Draws triangles as outlines. |
| 61 | */ |
| 62 | kWireframe = (1 << 2), |
| 63 | /** |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame] | 64 | * Modifies the vertex shader so that vertices will be positioned at pixel centers. |
| 65 | */ |
Chris Dalton | 1215cda | 2019-12-17 21:44:04 -0700 | [diff] [blame] | 66 | kSnapVerticesToPixelCenters = (1 << 3), // This value must be last. (See kLastInputFlag.) |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame] | 67 | }; |
| 68 | |
Brian Salomon | b5cb683 | 2017-02-24 11:01:15 -0500 | [diff] [blame] | 69 | struct InitArgs { |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 70 | InputFlags fInputFlags = InputFlags::kNone; |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame] | 71 | const GrUserStencilSettings* fUserStencil = &GrUserStencilSettings::kUnused; |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame] | 72 | const GrCaps* fCaps = nullptr; |
Greg Daniel | 524e28b | 2019-11-01 11:48:53 -0400 | [diff] [blame] | 73 | GrXferProcessor::DstProxyView fDstProxyView; |
Brian Salomon | 982f546 | 2020-03-30 12:52:33 -0400 | [diff] [blame] | 74 | GrSwizzle fWriteSwizzle; |
bsalomon | a387a11 | 2015-08-11 14:47:42 -0700 | [diff] [blame] | 75 | }; |
| 76 | |
Brian Salomon | b5cb683 | 2017-02-24 11:01:15 -0500 | [diff] [blame] | 77 | /** |
csmartdalton | 119fb2b | 2017-02-08 14:41:05 -0500 | [diff] [blame] | 78 | * Creates a simple pipeline with default settings and no processors. The provided blend mode |
Chris Dalton | 916c498 | 2018-08-15 00:53:25 -0600 | [diff] [blame] | 79 | * must be "Porter Duff" (<= kLastCoeffMode). If using GrScissorTest::kEnabled, the caller must |
Chris Dalton | 46983b7 | 2017-06-06 12:27:16 -0600 | [diff] [blame] | 80 | * specify a scissor rectangle through the DynamicState struct. |
csmartdalton | 119fb2b | 2017-02-08 14:41:05 -0500 | [diff] [blame] | 81 | **/ |
Brian Salomon | 982f546 | 2020-03-30 12:52:33 -0400 | [diff] [blame] | 82 | GrPipeline(GrScissorTest scissor, |
| 83 | SkBlendMode blend, |
| 84 | const GrSwizzle& writeSwizzle, |
Chris Dalton | c3318f0 | 2019-07-19 14:20:53 -0600 | [diff] [blame] | 85 | InputFlags flags = InputFlags::kNone, |
| 86 | const GrUserStencilSettings* stencil = &GrUserStencilSettings::kUnused) |
Brian Salomon | 982f546 | 2020-03-30 12:52:33 -0400 | [diff] [blame] | 87 | : GrPipeline(scissor, |
| 88 | GrPorterDuffXPFactory::MakeNoCoverageXP(blend), |
| 89 | writeSwizzle, |
| 90 | flags, |
| 91 | stencil) {} |
Chris Dalton | c3318f0 | 2019-07-19 14:20:53 -0600 | [diff] [blame] | 92 | |
Brian Salomon | 982f546 | 2020-03-30 12:52:33 -0400 | [diff] [blame] | 93 | GrPipeline(GrScissorTest, |
| 94 | sk_sp<const GrXferProcessor>, |
| 95 | const GrSwizzle& writeSwizzle, |
Greg Daniel | 2c3398d | 2019-06-19 11:58:01 -0400 | [diff] [blame] | 96 | InputFlags = InputFlags::kNone, |
Chris Dalton | d7291ba | 2019-03-07 14:17:03 -0700 | [diff] [blame] | 97 | const GrUserStencilSettings* = &GrUserStencilSettings::kUnused); |
csmartdalton | 119fb2b | 2017-02-08 14:41:05 -0500 | [diff] [blame] | 98 | |
Chris Dalton | b832ce6 | 2020-01-06 19:49:37 -0700 | [diff] [blame] | 99 | GrPipeline(const InitArgs& args, sk_sp<const GrXferProcessor>, const GrAppliedHardClip&); |
Brian Salomon | bfd18cd | 2017-08-09 16:27:09 -0400 | [diff] [blame] | 100 | GrPipeline(const InitArgs&, GrProcessorSet&&, GrAppliedClip&&); |
Brian Salomon | 6d4b65e | 2017-05-03 17:06:09 -0400 | [diff] [blame] | 101 | |
Brian Salomon | 1635146 | 2017-07-19 16:35:31 -0400 | [diff] [blame] | 102 | GrPipeline(const GrPipeline&) = delete; |
| 103 | GrPipeline& operator=(const GrPipeline&) = delete; |
| 104 | |
egdaniel | 89af44a | 2014-09-26 06:15:04 -0700 | [diff] [blame] | 105 | /// @} |
| 106 | |
| 107 | /////////////////////////////////////////////////////////////////////////// |
bsalomon | 6be6f7c | 2015-02-26 13:05:21 -0800 | [diff] [blame] | 108 | /// @name GrFragmentProcessors |
egdaniel | 89af44a | 2014-09-26 06:15:04 -0700 | [diff] [blame] | 109 | |
bsalomon | ac856c9 | 2015-08-27 06:30:17 -0700 | [diff] [blame] | 110 | int numColorFragmentProcessors() const { return fNumColorProcessors; } |
| 111 | int numCoverageFragmentProcessors() const { |
| 112 | return fFragmentProcessors.count() - fNumColorProcessors; |
| 113 | } |
| 114 | int numFragmentProcessors() const { return fFragmentProcessors.count(); } |
egdaniel | 89af44a | 2014-09-26 06:15:04 -0700 | [diff] [blame] | 115 | |
Brian Salomon | d90b3d3 | 2020-07-09 12:04:31 -0400 | [diff] [blame] | 116 | void visitTextureEffects(const std::function<void(const GrTextureEffect&)>&) const; |
| 117 | |
bsalomon | 2047b78 | 2015-12-21 13:12:54 -0800 | [diff] [blame] | 118 | const GrXferProcessor& getXferProcessor() const { |
Brian Salomon | d61c9d9 | 2017-04-10 10:54:25 -0400 | [diff] [blame] | 119 | if (fXferProcessor) { |
bsalomon | 2047b78 | 2015-12-21 13:12:54 -0800 | [diff] [blame] | 120 | return *fXferProcessor.get(); |
| 121 | } else { |
| 122 | // A null xp member means the common src-over case. GrXferProcessor's ref'ing |
| 123 | // mechanism is not thread safe so we do not hold a ref on this global. |
| 124 | return GrPorterDuffXPFactory::SimpleSrcOverXP(); |
| 125 | } |
| 126 | } |
egdaniel | 378092f | 2014-12-03 10:40:13 -0800 | [diff] [blame] | 127 | |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 128 | /** |
Greg Daniel | 524e28b | 2019-11-01 11:48:53 -0400 | [diff] [blame] | 129 | * This returns the GrSurfaceProxyView for the texture used to access the dst color. If the |
| 130 | * GrXferProcessor does not use the dst color then the proxy on the GrSurfaceProxyView will be |
| 131 | * nullptr. |
| 132 | */ |
| 133 | const GrSurfaceProxyView& dstProxyView() const { |
| 134 | return fDstProxyView; |
| 135 | } |
| 136 | |
| 137 | /** |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 138 | * If the GrXferProcessor uses a texture to access the dst color, then this returns that |
| 139 | * texture and the offset to the dst contents within that texture. |
| 140 | */ |
Greg Daniel | 524e28b | 2019-11-01 11:48:53 -0400 | [diff] [blame] | 141 | GrTexture* peekDstTexture(SkIPoint* offset = nullptr) const { |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 142 | if (offset) { |
| 143 | *offset = fDstTextureOffset; |
| 144 | } |
Robert Phillips | 3d4cac5 | 2019-06-11 08:08:08 -0400 | [diff] [blame] | 145 | |
Greg Daniel | 524e28b | 2019-11-01 11:48:53 -0400 | [diff] [blame] | 146 | if (GrTextureProxy* dstProxy = fDstProxyView.asTextureProxy()) { |
Brian Salomon | fd98c2c | 2018-07-31 17:25:29 -0400 | [diff] [blame] | 147 | return dstProxy->peekTexture(); |
Robert Phillips | bb581ce | 2017-05-29 15:05:15 -0400 | [diff] [blame] | 148 | } |
| 149 | |
| 150 | return nullptr; |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 151 | } |
| 152 | |
bsalomon | ac856c9 | 2015-08-27 06:30:17 -0700 | [diff] [blame] | 153 | const GrFragmentProcessor& getColorFragmentProcessor(int idx) const { |
| 154 | SkASSERT(idx < this->numColorFragmentProcessors()); |
| 155 | return *fFragmentProcessors[idx].get(); |
egdaniel | d9aa218 | 2014-10-09 13:47:05 -0700 | [diff] [blame] | 156 | } |
bsalomon | ac856c9 | 2015-08-27 06:30:17 -0700 | [diff] [blame] | 157 | |
| 158 | const GrFragmentProcessor& getCoverageFragmentProcessor(int idx) const { |
| 159 | SkASSERT(idx < this->numCoverageFragmentProcessors()); |
| 160 | return *fFragmentProcessors[fNumColorProcessors + idx].get(); |
egdaniel | d9aa218 | 2014-10-09 13:47:05 -0700 | [diff] [blame] | 161 | } |
bsalomon | ac856c9 | 2015-08-27 06:30:17 -0700 | [diff] [blame] | 162 | |
| 163 | const GrFragmentProcessor& getFragmentProcessor(int idx) const { |
| 164 | return *fFragmentProcessors[idx].get(); |
bsalomon | ae59b77 | 2014-11-19 08:23:49 -0800 | [diff] [blame] | 165 | } |
egdaniel | 89af44a | 2014-09-26 06:15:04 -0700 | [diff] [blame] | 166 | |
| 167 | /// @} |
| 168 | |
csmartdalton | c633abb | 2016-11-01 08:55:55 -0700 | [diff] [blame] | 169 | const GrUserStencilSettings* getUserStencil() const { return fUserStencilSettings; } |
Chris Dalton | 4328e92 | 2020-01-29 13:16:14 -0700 | [diff] [blame] | 170 | void setUserStencil(const GrUserStencilSettings* stencil) { |
| 171 | fUserStencilSettings = stencil; |
| 172 | if (!fUserStencilSettings->isDisabled(fFlags & Flags::kHasStencilClip)) { |
| 173 | fFlags |= Flags::kStencilEnabled; |
| 174 | } |
| 175 | } |
egdaniel | 89af44a | 2014-09-26 06:15:04 -0700 | [diff] [blame] | 176 | |
Chris Dalton | 2e7ed26 | 2020-02-21 15:17:59 -0700 | [diff] [blame] | 177 | bool isScissorTestEnabled() const { |
| 178 | return SkToBool(fFlags & Flags::kScissorTestEnabled); |
Brian Salomon | 4934890 | 2018-06-26 09:12:38 -0400 | [diff] [blame] | 179 | } |
joshualitt | 54e0c12 | 2014-11-19 09:38:51 -0800 | [diff] [blame] | 180 | |
csmartdalton | bf4a8f9 | 2016-09-06 10:01:06 -0700 | [diff] [blame] | 181 | const GrWindowRectsState& getWindowRectsState() const { return fWindowRectsState; } |
csmartdalton | 28341fa | 2016-08-17 10:00:21 -0700 | [diff] [blame] | 182 | |
Chris Dalton | ce425af | 2019-12-16 10:39:03 -0700 | [diff] [blame] | 183 | bool isHWAntialiasState() const { return fFlags & InputFlags::kHWAntialias; } |
| 184 | bool usesConservativeRaster() const { return fFlags & InputFlags::kConservativeRaster; } |
Chris Dalton | 1215cda | 2019-12-17 21:44:04 -0700 | [diff] [blame] | 185 | bool isWireframe() const { return fFlags & InputFlags::kWireframe; } |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame] | 186 | bool snapVerticesToPixelCenters() const { |
Chris Dalton | ce425af | 2019-12-16 10:39:03 -0700 | [diff] [blame] | 187 | return fFlags & InputFlags::kSnapVerticesToPixelCenters; |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame] | 188 | } |
cdalton | 193d9cf | 2016-05-12 11:52:02 -0700 | [diff] [blame] | 189 | bool hasStencilClip() const { |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 190 | return SkToBool(fFlags & Flags::kHasStencilClip); |
cdalton | 193d9cf | 2016-05-12 11:52:02 -0700 | [diff] [blame] | 191 | } |
csmartdalton | c633abb | 2016-11-01 08:55:55 -0700 | [diff] [blame] | 192 | bool isStencilEnabled() const { |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 193 | return SkToBool(fFlags & Flags::kStencilEnabled); |
csmartdalton | c633abb | 2016-11-01 08:55:55 -0700 | [diff] [blame] | 194 | } |
Robert Phillips | 8053c97 | 2019-11-21 10:44:53 -0500 | [diff] [blame] | 195 | #ifdef SK_DEBUG |
| 196 | bool allProxiesInstantiated() const { |
| 197 | for (int i = 0; i < fFragmentProcessors.count(); ++i) { |
| 198 | if (!fFragmentProcessors[i]->isInstantiated()) { |
| 199 | return false; |
| 200 | } |
| 201 | } |
| 202 | if (fDstProxyView.proxy()) { |
| 203 | return fDstProxyView.proxy()->isInstantiated(); |
| 204 | } |
| 205 | |
| 206 | return true; |
| 207 | } |
| 208 | #endif |
bsalomon | ae59b77 | 2014-11-19 08:23:49 -0800 | [diff] [blame] | 209 | |
Robert Phillips | d0fe875 | 2019-01-31 14:13:59 -0500 | [diff] [blame] | 210 | GrXferBarrierType xferBarrierType(GrTexture*, const GrCaps&) const; |
bsalomon | cb02b38 | 2015-08-12 11:14:50 -0700 | [diff] [blame] | 211 | |
Jim Van Verth | 1223e7f | 2019-02-28 17:38:35 -0500 | [diff] [blame] | 212 | // Used by Vulkan and Metal to cache their respective pipeline objects |
Chris Dalton | b204e4c | 2019-11-07 12:43:13 -0700 | [diff] [blame] | 213 | void genKey(GrProcessorKeyBuilder*, const GrCaps&) const; |
Jim Van Verth | 1223e7f | 2019-02-28 17:38:35 -0500 | [diff] [blame] | 214 | |
Brian Salomon | 982f546 | 2020-03-30 12:52:33 -0400 | [diff] [blame] | 215 | const GrSwizzle& writeSwizzle() const { return fWriteSwizzle; } |
Greg Daniel | 2c3398d | 2019-06-19 11:58:01 -0400 | [diff] [blame] | 216 | |
Brian Salomon | c241b58 | 2019-11-27 08:57:17 -0500 | [diff] [blame] | 217 | void visitProxies(const GrOp::VisitProxyFunc&) const; |
Robert Phillips | 8053c97 | 2019-11-21 10:44:53 -0500 | [diff] [blame] | 218 | |
bsalomon | ae59b77 | 2014-11-19 08:23:49 -0800 | [diff] [blame] | 219 | private: |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 220 | static constexpr uint8_t kLastInputFlag = (uint8_t)InputFlags::kSnapVerticesToPixelCenters; |
| 221 | |
| 222 | /** This is a continuation of the public "InputFlags" enum. */ |
| 223 | enum class Flags : uint8_t { |
| 224 | kHasStencilClip = (kLastInputFlag << 1), |
| 225 | kStencilEnabled = (kLastInputFlag << 2), |
Chris Dalton | 2e7ed26 | 2020-02-21 15:17:59 -0700 | [diff] [blame] | 226 | kScissorTestEnabled = (kLastInputFlag << 3), |
bsalomon | 04ddf89 | 2014-11-19 12:36:22 -0800 | [diff] [blame] | 227 | }; |
| 228 | |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 229 | GR_DECL_BITFIELD_CLASS_OPS_FRIENDS(Flags); |
| 230 | |
| 231 | friend bool operator&(Flags, InputFlags); |
| 232 | |
John Stiles | 59e18dc | 2020-07-22 18:18:12 -0400 | [diff] [blame^] | 233 | // A pipeline can contain up to three processors: color, paint coverage, and clip coverage. |
| 234 | using FragmentProcessorArray = SkAutoSTArray<3, std::unique_ptr<const GrFragmentProcessor>>; |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 235 | |
Greg Daniel | 524e28b | 2019-11-01 11:48:53 -0400 | [diff] [blame] | 236 | GrSurfaceProxyView fDstProxyView; |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 237 | SkIPoint fDstTextureOffset; |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 238 | GrWindowRectsState fWindowRectsState; |
| 239 | const GrUserStencilSettings* fUserStencilSettings; |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 240 | Flags fFlags; |
Brian Salomon | d61c9d9 | 2017-04-10 10:54:25 -0400 | [diff] [blame] | 241 | sk_sp<const GrXferProcessor> fXferProcessor; |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 242 | FragmentProcessorArray fFragmentProcessors; |
egdaniel | d9aa218 | 2014-10-09 13:47:05 -0700 | [diff] [blame] | 243 | |
bsalomon | ac856c9 | 2015-08-27 06:30:17 -0700 | [diff] [blame] | 244 | // This value is also the index in fFragmentProcessors where coverage processors begin. |
Chris Dalton | b832ce6 | 2020-01-06 19:49:37 -0700 | [diff] [blame] | 245 | int fNumColorProcessors = 0; |
Greg Daniel | 2c3398d | 2019-06-19 11:58:01 -0400 | [diff] [blame] | 246 | |
Brian Salomon | 982f546 | 2020-03-30 12:52:33 -0400 | [diff] [blame] | 247 | GrSwizzle fWriteSwizzle; |
egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 248 | }; |
| 249 | |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 250 | GR_MAKE_BITFIELD_CLASS_OPS(GrPipeline::InputFlags); |
| 251 | GR_MAKE_BITFIELD_CLASS_OPS(GrPipeline::Flags); |
| 252 | |
| 253 | inline bool operator&(GrPipeline::Flags flags, GrPipeline::InputFlags inputFlag) { |
| 254 | return (flags & (GrPipeline::Flags)inputFlag); |
| 255 | } |
| 256 | |
egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 257 | #endif |