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 numFragmentProcessors() const { return fFragmentProcessors.count(); } |
John Stiles | d3feb6f | 2020-07-23 18:18:12 -0400 | [diff] [blame] | 111 | bool isColorFragmentProcessor(int idx) const { return idx < fNumColorProcessors; } |
| 112 | bool isCoverageFragmentProcessor(int idx) const { return idx >= fNumColorProcessors; } |
egdaniel | 89af44a | 2014-09-26 06:15:04 -0700 | [diff] [blame] | 113 | |
Brian Salomon | d90b3d3 | 2020-07-09 12:04:31 -0400 | [diff] [blame] | 114 | void visitTextureEffects(const std::function<void(const GrTextureEffect&)>&) const; |
| 115 | |
bsalomon | 2047b78 | 2015-12-21 13:12:54 -0800 | [diff] [blame] | 116 | const GrXferProcessor& getXferProcessor() const { |
Brian Salomon | d61c9d9 | 2017-04-10 10:54:25 -0400 | [diff] [blame] | 117 | if (fXferProcessor) { |
John Stiles | a008b0f | 2020-08-16 08:48:02 -0400 | [diff] [blame] | 118 | return *fXferProcessor; |
bsalomon | 2047b78 | 2015-12-21 13:12:54 -0800 | [diff] [blame] | 119 | } else { |
| 120 | // A null xp member means the common src-over case. GrXferProcessor's ref'ing |
| 121 | // mechanism is not thread safe so we do not hold a ref on this global. |
| 122 | return GrPorterDuffXPFactory::SimpleSrcOverXP(); |
| 123 | } |
| 124 | } |
egdaniel | 378092f | 2014-12-03 10:40:13 -0800 | [diff] [blame] | 125 | |
Greg Daniel | d358cbe | 2020-09-11 09:33:54 -0400 | [diff] [blame^] | 126 | GrDstSampleType dstSampleType() const { |
| 127 | return fDstSampleType; |
| 128 | } |
| 129 | |
| 130 | // Helper functions to quickly know if this GrPipeline will access the dst as a texture or an |
| 131 | // input attachment. |
| 132 | bool usesDstTexture() const { |
| 133 | return GrDstSampleTypeUsesTexture(fDstSampleType); |
| 134 | } |
| 135 | bool usesInputAttachment() const { |
| 136 | return fDstSampleType == GrDstSampleType::kAsInputAttachment; |
| 137 | } |
| 138 | |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 139 | /** |
Greg Daniel | 524e28b | 2019-11-01 11:48:53 -0400 | [diff] [blame] | 140 | * This returns the GrSurfaceProxyView for the texture used to access the dst color. If the |
| 141 | * GrXferProcessor does not use the dst color then the proxy on the GrSurfaceProxyView will be |
| 142 | * nullptr. |
| 143 | */ |
Greg Daniel | d358cbe | 2020-09-11 09:33:54 -0400 | [diff] [blame^] | 144 | const GrSurfaceProxyView& dstProxyView() const { return fDstProxyView; } |
Greg Daniel | 524e28b | 2019-11-01 11:48:53 -0400 | [diff] [blame] | 145 | |
| 146 | /** |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 147 | * If the GrXferProcessor uses a texture to access the dst color, then this returns that |
| 148 | * texture and the offset to the dst contents within that texture. |
| 149 | */ |
Greg Daniel | 524e28b | 2019-11-01 11:48:53 -0400 | [diff] [blame] | 150 | GrTexture* peekDstTexture(SkIPoint* offset = nullptr) const { |
Greg Daniel | d358cbe | 2020-09-11 09:33:54 -0400 | [diff] [blame^] | 151 | if (!this->usesDstTexture()) { |
| 152 | return nullptr; |
| 153 | } |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 154 | if (offset) { |
| 155 | *offset = fDstTextureOffset; |
| 156 | } |
Robert Phillips | 3d4cac5 | 2019-06-11 08:08:08 -0400 | [diff] [blame] | 157 | |
Greg Daniel | 524e28b | 2019-11-01 11:48:53 -0400 | [diff] [blame] | 158 | if (GrTextureProxy* dstProxy = fDstProxyView.asTextureProxy()) { |
Brian Salomon | fd98c2c | 2018-07-31 17:25:29 -0400 | [diff] [blame] | 159 | return dstProxy->peekTexture(); |
Robert Phillips | bb581ce | 2017-05-29 15:05:15 -0400 | [diff] [blame] | 160 | } |
| 161 | |
| 162 | return nullptr; |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 163 | } |
| 164 | |
bsalomon | ac856c9 | 2015-08-27 06:30:17 -0700 | [diff] [blame] | 165 | const GrFragmentProcessor& getFragmentProcessor(int idx) const { |
John Stiles | a008b0f | 2020-08-16 08:48:02 -0400 | [diff] [blame] | 166 | return *fFragmentProcessors[idx]; |
bsalomon | ae59b77 | 2014-11-19 08:23:49 -0800 | [diff] [blame] | 167 | } |
egdaniel | 89af44a | 2014-09-26 06:15:04 -0700 | [diff] [blame] | 168 | |
| 169 | /// @} |
| 170 | |
csmartdalton | c633abb | 2016-11-01 08:55:55 -0700 | [diff] [blame] | 171 | const GrUserStencilSettings* getUserStencil() const { return fUserStencilSettings; } |
Chris Dalton | 4328e92 | 2020-01-29 13:16:14 -0700 | [diff] [blame] | 172 | void setUserStencil(const GrUserStencilSettings* stencil) { |
| 173 | fUserStencilSettings = stencil; |
| 174 | if (!fUserStencilSettings->isDisabled(fFlags & Flags::kHasStencilClip)) { |
| 175 | fFlags |= Flags::kStencilEnabled; |
| 176 | } |
| 177 | } |
egdaniel | 89af44a | 2014-09-26 06:15:04 -0700 | [diff] [blame] | 178 | |
Chris Dalton | 2e7ed26 | 2020-02-21 15:17:59 -0700 | [diff] [blame] | 179 | bool isScissorTestEnabled() const { |
| 180 | return SkToBool(fFlags & Flags::kScissorTestEnabled); |
Brian Salomon | 4934890 | 2018-06-26 09:12:38 -0400 | [diff] [blame] | 181 | } |
joshualitt | 54e0c12 | 2014-11-19 09:38:51 -0800 | [diff] [blame] | 182 | |
csmartdalton | bf4a8f9 | 2016-09-06 10:01:06 -0700 | [diff] [blame] | 183 | const GrWindowRectsState& getWindowRectsState() const { return fWindowRectsState; } |
csmartdalton | 28341fa | 2016-08-17 10:00:21 -0700 | [diff] [blame] | 184 | |
Chris Dalton | ce425af | 2019-12-16 10:39:03 -0700 | [diff] [blame] | 185 | bool isHWAntialiasState() const { return fFlags & InputFlags::kHWAntialias; } |
| 186 | bool usesConservativeRaster() const { return fFlags & InputFlags::kConservativeRaster; } |
Chris Dalton | 1215cda | 2019-12-17 21:44:04 -0700 | [diff] [blame] | 187 | bool isWireframe() const { return fFlags & InputFlags::kWireframe; } |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame] | 188 | bool snapVerticesToPixelCenters() const { |
Chris Dalton | ce425af | 2019-12-16 10:39:03 -0700 | [diff] [blame] | 189 | return fFlags & InputFlags::kSnapVerticesToPixelCenters; |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame] | 190 | } |
cdalton | 193d9cf | 2016-05-12 11:52:02 -0700 | [diff] [blame] | 191 | bool hasStencilClip() const { |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 192 | return SkToBool(fFlags & Flags::kHasStencilClip); |
cdalton | 193d9cf | 2016-05-12 11:52:02 -0700 | [diff] [blame] | 193 | } |
csmartdalton | c633abb | 2016-11-01 08:55:55 -0700 | [diff] [blame] | 194 | bool isStencilEnabled() const { |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 195 | return SkToBool(fFlags & Flags::kStencilEnabled); |
csmartdalton | c633abb | 2016-11-01 08:55:55 -0700 | [diff] [blame] | 196 | } |
Robert Phillips | 8053c97 | 2019-11-21 10:44:53 -0500 | [diff] [blame] | 197 | #ifdef SK_DEBUG |
| 198 | bool allProxiesInstantiated() const { |
| 199 | for (int i = 0; i < fFragmentProcessors.count(); ++i) { |
| 200 | if (!fFragmentProcessors[i]->isInstantiated()) { |
| 201 | return false; |
| 202 | } |
| 203 | } |
| 204 | if (fDstProxyView.proxy()) { |
| 205 | return fDstProxyView.proxy()->isInstantiated(); |
| 206 | } |
| 207 | |
| 208 | return true; |
| 209 | } |
| 210 | #endif |
bsalomon | ae59b77 | 2014-11-19 08:23:49 -0800 | [diff] [blame] | 211 | |
Greg Daniel | d358cbe | 2020-09-11 09:33:54 -0400 | [diff] [blame^] | 212 | GrXferBarrierType xferBarrierType(const GrCaps&) const; |
bsalomon | cb02b38 | 2015-08-12 11:14:50 -0700 | [diff] [blame] | 213 | |
Jim Van Verth | 1223e7f | 2019-02-28 17:38:35 -0500 | [diff] [blame] | 214 | // Used by Vulkan and Metal to cache their respective pipeline objects |
Chris Dalton | b204e4c | 2019-11-07 12:43:13 -0700 | [diff] [blame] | 215 | void genKey(GrProcessorKeyBuilder*, const GrCaps&) const; |
Jim Van Verth | 1223e7f | 2019-02-28 17:38:35 -0500 | [diff] [blame] | 216 | |
Brian Salomon | 982f546 | 2020-03-30 12:52:33 -0400 | [diff] [blame] | 217 | const GrSwizzle& writeSwizzle() const { return fWriteSwizzle; } |
Greg Daniel | 2c3398d | 2019-06-19 11:58:01 -0400 | [diff] [blame] | 218 | |
Brian Salomon | c241b58 | 2019-11-27 08:57:17 -0500 | [diff] [blame] | 219 | void visitProxies(const GrOp::VisitProxyFunc&) const; |
Robert Phillips | 8053c97 | 2019-11-21 10:44:53 -0500 | [diff] [blame] | 220 | |
bsalomon | ae59b77 | 2014-11-19 08:23:49 -0800 | [diff] [blame] | 221 | private: |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 222 | static constexpr uint8_t kLastInputFlag = (uint8_t)InputFlags::kSnapVerticesToPixelCenters; |
| 223 | |
| 224 | /** This is a continuation of the public "InputFlags" enum. */ |
| 225 | enum class Flags : uint8_t { |
| 226 | kHasStencilClip = (kLastInputFlag << 1), |
| 227 | kStencilEnabled = (kLastInputFlag << 2), |
Chris Dalton | 2e7ed26 | 2020-02-21 15:17:59 -0700 | [diff] [blame] | 228 | kScissorTestEnabled = (kLastInputFlag << 3), |
bsalomon | 04ddf89 | 2014-11-19 12:36:22 -0800 | [diff] [blame] | 229 | }; |
| 230 | |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 231 | GR_DECL_BITFIELD_CLASS_OPS_FRIENDS(Flags); |
| 232 | |
| 233 | friend bool operator&(Flags, InputFlags); |
| 234 | |
John Stiles | 59e18dc | 2020-07-22 18:18:12 -0400 | [diff] [blame] | 235 | // A pipeline can contain up to three processors: color, paint coverage, and clip coverage. |
| 236 | using FragmentProcessorArray = SkAutoSTArray<3, std::unique_ptr<const GrFragmentProcessor>>; |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 237 | |
Greg Daniel | 524e28b | 2019-11-01 11:48:53 -0400 | [diff] [blame] | 238 | GrSurfaceProxyView fDstProxyView; |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 239 | SkIPoint fDstTextureOffset; |
Greg Daniel | d358cbe | 2020-09-11 09:33:54 -0400 | [diff] [blame^] | 240 | // This is the GrDstSampleType that is used for the render pass that this GrPipeline will be |
| 241 | // used in (i.e. if this GrPipeline does read the dst, it will do so using this |
| 242 | // GrDstSampleType). |
| 243 | GrDstSampleType fDstSampleType = GrDstSampleType::kNone; |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 244 | GrWindowRectsState fWindowRectsState; |
| 245 | const GrUserStencilSettings* fUserStencilSettings; |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 246 | Flags fFlags; |
Brian Salomon | d61c9d9 | 2017-04-10 10:54:25 -0400 | [diff] [blame] | 247 | sk_sp<const GrXferProcessor> fXferProcessor; |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 248 | FragmentProcessorArray fFragmentProcessors; |
egdaniel | d9aa218 | 2014-10-09 13:47:05 -0700 | [diff] [blame] | 249 | |
bsalomon | ac856c9 | 2015-08-27 06:30:17 -0700 | [diff] [blame] | 250 | // This value is also the index in fFragmentProcessors where coverage processors begin. |
Chris Dalton | b832ce6 | 2020-01-06 19:49:37 -0700 | [diff] [blame] | 251 | int fNumColorProcessors = 0; |
Greg Daniel | 2c3398d | 2019-06-19 11:58:01 -0400 | [diff] [blame] | 252 | |
Brian Salomon | 982f546 | 2020-03-30 12:52:33 -0400 | [diff] [blame] | 253 | GrSwizzle fWriteSwizzle; |
egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 254 | }; |
| 255 | |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 256 | GR_MAKE_BITFIELD_CLASS_OPS(GrPipeline::InputFlags); |
| 257 | GR_MAKE_BITFIELD_CLASS_OPS(GrPipeline::Flags); |
| 258 | |
| 259 | inline bool operator&(GrPipeline::Flags flags, GrPipeline::InputFlags inputFlag) { |
| 260 | return (flags & (GrPipeline::Flags)inputFlag); |
| 261 | } |
| 262 | |
egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 263 | #endif |