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