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" |
| 17 | #include "src/gpu/GrProgramDesc.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 18 | #include "src/gpu/GrScissorState.h" |
| 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" |
| 24 | #include "src/gpu/effects/generated/GrSimpleTextureEffect.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; |
Brian Salomon | 25a8809 | 2016-12-01 09:36:50 -0500 | [diff] [blame] | 28 | class GrOp; |
Brian Salomon | 25a8809 | 2016-12-01 09:36:50 -0500 | [diff] [blame] | 29 | class GrRenderTargetContext; |
egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 30 | |
Brian Salomon | 92aee3d | 2016-12-21 09:20:25 -0500 | [diff] [blame] | 31 | /** |
Brian Salomon | e5b399e | 2017-07-19 13:50:54 -0400 | [diff] [blame] | 32 | * This immutable object contains information needed to set build a shader program and set API |
| 33 | * state for a draw. It is used along with a GrPrimitiveProcessor and a source of geometric |
| 34 | * data (GrMesh or GrPath) to draw. |
egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 35 | */ |
Brian Salomon | 1635146 | 2017-07-19 16:35:31 -0400 | [diff] [blame] | 36 | class GrPipeline { |
egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 37 | public: |
bsalomon | cb02b38 | 2015-08-12 11:14:50 -0700 | [diff] [blame] | 38 | /////////////////////////////////////////////////////////////////////////// |
| 39 | /// @name Creation |
| 40 | |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 41 | // Pipeline options that the caller may enable. |
| 42 | // NOTE: This enum is extended later by GrPipeline::Flags. |
| 43 | enum class InputFlags : uint8_t { |
| 44 | kNone = 0, |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame] | 45 | /** |
| 46 | * Perform HW anti-aliasing. This means either HW FSAA, if supported by the render target, |
| 47 | * or smooth-line rendering if a line primitive is drawn and line smoothing is supported by |
| 48 | * the 3D API. |
| 49 | */ |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 50 | kHWAntialias = (1 << 0), |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame] | 51 | /** |
| 52 | * Modifies the vertex shader so that vertices will be positioned at pixel centers. |
| 53 | */ |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 54 | kSnapVerticesToPixelCenters = (1 << 1), // This value must be last. (See kLastInputFlag.) |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame] | 55 | }; |
| 56 | |
Brian Salomon | b5cb683 | 2017-02-24 11:01:15 -0500 | [diff] [blame] | 57 | struct InitArgs { |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 58 | InputFlags fInputFlags = InputFlags::kNone; |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame] | 59 | const GrUserStencilSettings* fUserStencil = &GrUserStencilSettings::kUnused; |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame] | 60 | const GrCaps* fCaps = nullptr; |
Robert Phillips | bb581ce | 2017-05-29 15:05:15 -0400 | [diff] [blame] | 61 | GrXferProcessor::DstProxy fDstProxy; |
Greg Daniel | 2c3398d | 2019-06-19 11:58:01 -0400 | [diff] [blame] | 62 | GrSwizzle fOutputSwizzle; |
bsalomon | a387a11 | 2015-08-11 14:47:42 -0700 | [diff] [blame] | 63 | }; |
| 64 | |
Brian Salomon | b5cb683 | 2017-02-24 11:01:15 -0500 | [diff] [blame] | 65 | /** |
Brian Salomon | 4934890 | 2018-06-26 09:12:38 -0400 | [diff] [blame] | 66 | * Some state can be changed between GrMeshes without changing GrPipelines. This is generally |
| 67 | * less expensive then using multiple pipelines. Such state is called "dynamic state". It can |
| 68 | * be specified in two ways: |
| 69 | * 1) FixedDynamicState - use this to specify state that does not vary between GrMeshes. |
| 70 | * 2) DynamicStateArrays - use this to specify per mesh values for dynamic state. |
Chris Dalton | 46983b7 | 2017-06-06 12:27:16 -0600 | [diff] [blame] | 71 | **/ |
Brian Salomon | 4934890 | 2018-06-26 09:12:38 -0400 | [diff] [blame] | 72 | struct FixedDynamicState { |
Brian Salomon | 7eae3e0 | 2018-08-07 14:02:38 +0000 | [diff] [blame] | 73 | explicit FixedDynamicState(const SkIRect& scissorRect) : fScissorRect(scissorRect) {} |
| 74 | FixedDynamicState() = default; |
| 75 | SkIRect fScissorRect = SkIRect::EmptyIRect(); |
Brian Salomon | f723264 | 2018-09-19 08:58:08 -0400 | [diff] [blame] | 76 | // Must have GrPrimitiveProcessor::numTextureSamplers() entries. Can be null if no samplers |
| 77 | // or textures are passed using DynamicStateArrays. |
Brian Salomon | 7eae3e0 | 2018-08-07 14:02:38 +0000 | [diff] [blame] | 78 | GrTextureProxy** fPrimitiveProcessorTextures = nullptr; |
Chris Dalton | 46983b7 | 2017-06-06 12:27:16 -0600 | [diff] [blame] | 79 | }; |
| 80 | |
| 81 | /** |
Brian Salomon | 4934890 | 2018-06-26 09:12:38 -0400 | [diff] [blame] | 82 | * Any non-null array overrides the FixedDynamicState on a mesh-by-mesh basis. Arrays must |
| 83 | * have one entry for each GrMesh. |
| 84 | */ |
| 85 | struct DynamicStateArrays { |
| 86 | const SkIRect* fScissorRects = nullptr; |
Brian Salomon | f723264 | 2018-09-19 08:58:08 -0400 | [diff] [blame] | 87 | // Must have GrPrimitiveProcessor::numTextureSamplers() * num_meshes entries. |
| 88 | // Can be null if no samplers or to use the same textures for all meshes via' |
| 89 | // FixedDynamicState. |
| 90 | GrTextureProxy** fPrimitiveProcessorTextures = nullptr; |
Brian Salomon | 4934890 | 2018-06-26 09:12:38 -0400 | [diff] [blame] | 91 | }; |
| 92 | |
| 93 | /** |
csmartdalton | 119fb2b | 2017-02-08 14:41:05 -0500 | [diff] [blame] | 94 | * 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] | 95 | * must be "Porter Duff" (<= kLastCoeffMode). If using GrScissorTest::kEnabled, the caller must |
Chris Dalton | 46983b7 | 2017-06-06 12:27:16 -0600 | [diff] [blame] | 96 | * specify a scissor rectangle through the DynamicState struct. |
csmartdalton | 119fb2b | 2017-02-08 14:41:05 -0500 | [diff] [blame] | 97 | **/ |
Chris Dalton | c3318f0 | 2019-07-19 14:20:53 -0600 | [diff] [blame] | 98 | GrPipeline(GrScissorTest scissor, SkBlendMode blend, const GrSwizzle& outputSwizzle, |
| 99 | InputFlags flags = InputFlags::kNone, |
| 100 | const GrUserStencilSettings* stencil = &GrUserStencilSettings::kUnused) |
| 101 | : GrPipeline(scissor, GrPorterDuffXPFactory::MakeNoCoverageXP(blend), outputSwizzle, |
| 102 | flags, stencil) { |
| 103 | } |
| 104 | |
| 105 | GrPipeline(GrScissorTest, sk_sp<const GrXferProcessor>, const GrSwizzle& outputSwizzle, |
Greg Daniel | 2c3398d | 2019-06-19 11:58:01 -0400 | [diff] [blame] | 106 | InputFlags = InputFlags::kNone, |
Chris Dalton | d7291ba | 2019-03-07 14:17:03 -0700 | [diff] [blame] | 107 | const GrUserStencilSettings* = &GrUserStencilSettings::kUnused); |
csmartdalton | 119fb2b | 2017-02-08 14:41:05 -0500 | [diff] [blame] | 108 | |
Brian Salomon | bfd18cd | 2017-08-09 16:27:09 -0400 | [diff] [blame] | 109 | GrPipeline(const InitArgs&, GrProcessorSet&&, GrAppliedClip&&); |
Brian Salomon | 6d4b65e | 2017-05-03 17:06:09 -0400 | [diff] [blame] | 110 | |
Brian Salomon | 1635146 | 2017-07-19 16:35:31 -0400 | [diff] [blame] | 111 | GrPipeline(const GrPipeline&) = delete; |
| 112 | GrPipeline& operator=(const GrPipeline&) = delete; |
| 113 | |
egdaniel | 89af44a | 2014-09-26 06:15:04 -0700 | [diff] [blame] | 114 | /// @} |
| 115 | |
| 116 | /////////////////////////////////////////////////////////////////////////// |
bsalomon | 6be6f7c | 2015-02-26 13:05:21 -0800 | [diff] [blame] | 117 | /// @name GrFragmentProcessors |
egdaniel | 89af44a | 2014-09-26 06:15:04 -0700 | [diff] [blame] | 118 | |
bsalomon | ac856c9 | 2015-08-27 06:30:17 -0700 | [diff] [blame] | 119 | int numColorFragmentProcessors() const { return fNumColorProcessors; } |
| 120 | int numCoverageFragmentProcessors() const { |
| 121 | return fFragmentProcessors.count() - fNumColorProcessors; |
| 122 | } |
| 123 | int numFragmentProcessors() const { return fFragmentProcessors.count(); } |
egdaniel | 89af44a | 2014-09-26 06:15:04 -0700 | [diff] [blame] | 124 | |
bsalomon | 2047b78 | 2015-12-21 13:12:54 -0800 | [diff] [blame] | 125 | const GrXferProcessor& getXferProcessor() const { |
Brian Salomon | d61c9d9 | 2017-04-10 10:54:25 -0400 | [diff] [blame] | 126 | if (fXferProcessor) { |
bsalomon | 2047b78 | 2015-12-21 13:12:54 -0800 | [diff] [blame] | 127 | return *fXferProcessor.get(); |
| 128 | } else { |
| 129 | // A null xp member means the common src-over case. GrXferProcessor's ref'ing |
| 130 | // mechanism is not thread safe so we do not hold a ref on this global. |
| 131 | return GrPorterDuffXPFactory::SimpleSrcOverXP(); |
| 132 | } |
| 133 | } |
egdaniel | 378092f | 2014-12-03 10:40:13 -0800 | [diff] [blame] | 134 | |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 135 | /** |
| 136 | * If the GrXferProcessor uses a texture to access the dst color, then this returns that |
| 137 | * texture and the offset to the dst contents within that texture. |
| 138 | */ |
Robert Phillips | bb581ce | 2017-05-29 15:05:15 -0400 | [diff] [blame] | 139 | GrTextureProxy* dstTextureProxy(SkIPoint* offset = nullptr) const { |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 140 | if (offset) { |
| 141 | *offset = fDstTextureOffset; |
| 142 | } |
Robert Phillips | 3d4cac5 | 2019-06-11 08:08:08 -0400 | [diff] [blame] | 143 | |
Robert Phillips | 80bff5b | 2019-08-20 16:56:18 -0400 | [diff] [blame] | 144 | return fDstTextureProxy.get(); |
Robert Phillips | bb581ce | 2017-05-29 15:05:15 -0400 | [diff] [blame] | 145 | } |
| 146 | |
| 147 | GrTexture* peekDstTexture(SkIPoint* offset = nullptr) const { |
| 148 | if (GrTextureProxy* dstProxy = this->dstTextureProxy(offset)) { |
Brian Salomon | fd98c2c | 2018-07-31 17:25:29 -0400 | [diff] [blame] | 149 | return dstProxy->peekTexture(); |
Robert Phillips | bb581ce | 2017-05-29 15:05:15 -0400 | [diff] [blame] | 150 | } |
| 151 | |
| 152 | return nullptr; |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 153 | } |
| 154 | |
bsalomon | ac856c9 | 2015-08-27 06:30:17 -0700 | [diff] [blame] | 155 | const GrFragmentProcessor& getColorFragmentProcessor(int idx) const { |
| 156 | SkASSERT(idx < this->numColorFragmentProcessors()); |
| 157 | return *fFragmentProcessors[idx].get(); |
egdaniel | d9aa218 | 2014-10-09 13:47:05 -0700 | [diff] [blame] | 158 | } |
bsalomon | ac856c9 | 2015-08-27 06:30:17 -0700 | [diff] [blame] | 159 | |
| 160 | const GrFragmentProcessor& getCoverageFragmentProcessor(int idx) const { |
| 161 | SkASSERT(idx < this->numCoverageFragmentProcessors()); |
| 162 | return *fFragmentProcessors[fNumColorProcessors + idx].get(); |
egdaniel | d9aa218 | 2014-10-09 13:47:05 -0700 | [diff] [blame] | 163 | } |
bsalomon | ac856c9 | 2015-08-27 06:30:17 -0700 | [diff] [blame] | 164 | |
| 165 | const GrFragmentProcessor& getFragmentProcessor(int idx) const { |
| 166 | return *fFragmentProcessors[idx].get(); |
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; } |
egdaniel | 89af44a | 2014-09-26 06:15:04 -0700 | [diff] [blame] | 172 | |
Chris Dalton | 916c498 | 2018-08-15 00:53:25 -0600 | [diff] [blame] | 173 | bool isScissorEnabled() const { |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 174 | return SkToBool(fFlags & Flags::kScissorEnabled); |
Brian Salomon | 4934890 | 2018-06-26 09:12:38 -0400 | [diff] [blame] | 175 | } |
joshualitt | 54e0c12 | 2014-11-19 09:38:51 -0800 | [diff] [blame] | 176 | |
csmartdalton | bf4a8f9 | 2016-09-06 10:01:06 -0700 | [diff] [blame] | 177 | const GrWindowRectsState& getWindowRectsState() const { return fWindowRectsState; } |
csmartdalton | 28341fa | 2016-08-17 10:00:21 -0700 | [diff] [blame] | 178 | |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 179 | bool isHWAntialiasState() const { return SkToBool(fFlags & InputFlags::kHWAntialias); } |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame] | 180 | bool snapVerticesToPixelCenters() const { |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 181 | return SkToBool(fFlags & InputFlags::kSnapVerticesToPixelCenters); |
Brian Salomon | 189098e7 | 2017-01-19 09:55:19 -0500 | [diff] [blame] | 182 | } |
cdalton | 193d9cf | 2016-05-12 11:52:02 -0700 | [diff] [blame] | 183 | bool hasStencilClip() const { |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 184 | return SkToBool(fFlags & Flags::kHasStencilClip); |
cdalton | 193d9cf | 2016-05-12 11:52:02 -0700 | [diff] [blame] | 185 | } |
csmartdalton | c633abb | 2016-11-01 08:55:55 -0700 | [diff] [blame] | 186 | bool isStencilEnabled() const { |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 187 | return SkToBool(fFlags & Flags::kStencilEnabled); |
csmartdalton | c633abb | 2016-11-01 08:55:55 -0700 | [diff] [blame] | 188 | } |
Robert Phillips | 82774f8 | 2019-06-20 14:38:27 -0400 | [diff] [blame] | 189 | SkDEBUGCODE(bool isBad() const { return SkToBool(fFlags & Flags::kIsBad); }) |
bsalomon | ae59b77 | 2014-11-19 08:23:49 -0800 | [diff] [blame] | 190 | |
Robert Phillips | d0fe875 | 2019-01-31 14:13:59 -0500 | [diff] [blame] | 191 | GrXferBarrierType xferBarrierType(GrTexture*, const GrCaps&) const; |
bsalomon | cb02b38 | 2015-08-12 11:14:50 -0700 | [diff] [blame] | 192 | |
Jim Van Verth | 1223e7f | 2019-02-28 17:38:35 -0500 | [diff] [blame] | 193 | // Used by Vulkan and Metal to cache their respective pipeline objects |
| 194 | uint32_t getBlendInfoKey() const; |
| 195 | |
Greg Daniel | 2c3398d | 2019-06-19 11:58:01 -0400 | [diff] [blame] | 196 | const GrSwizzle& outputSwizzle() const { return fOutputSwizzle; } |
| 197 | |
bsalomon | ae59b77 | 2014-11-19 08:23:49 -0800 | [diff] [blame] | 198 | private: |
Robert Phillips | 82774f8 | 2019-06-20 14:38:27 -0400 | [diff] [blame] | 199 | |
| 200 | SkDEBUGCODE(void markAsBad() { fFlags |= Flags::kIsBad; }) |
Robert Phillips | a91e0b7 | 2017-05-01 13:12:20 -0400 | [diff] [blame] | 201 | |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 202 | static constexpr uint8_t kLastInputFlag = (uint8_t)InputFlags::kSnapVerticesToPixelCenters; |
| 203 | |
| 204 | /** This is a continuation of the public "InputFlags" enum. */ |
| 205 | enum class Flags : uint8_t { |
| 206 | kHasStencilClip = (kLastInputFlag << 1), |
| 207 | kStencilEnabled = (kLastInputFlag << 2), |
| 208 | kScissorEnabled = (kLastInputFlag << 3), |
Robert Phillips | 82774f8 | 2019-06-20 14:38:27 -0400 | [diff] [blame] | 209 | #ifdef SK_DEBUG |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 210 | kIsBad = (kLastInputFlag << 4), |
Robert Phillips | 82774f8 | 2019-06-20 14:38:27 -0400 | [diff] [blame] | 211 | #endif |
bsalomon | 04ddf89 | 2014-11-19 12:36:22 -0800 | [diff] [blame] | 212 | }; |
| 213 | |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 214 | GR_DECL_BITFIELD_CLASS_OPS_FRIENDS(Flags); |
| 215 | |
| 216 | friend bool operator&(Flags, InputFlags); |
| 217 | |
Brian Salomon | aff329b | 2017-08-11 09:40:37 -0400 | [diff] [blame] | 218 | using FragmentProcessorArray = SkAutoSTArray<8, std::unique_ptr<const GrFragmentProcessor>>; |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 219 | |
Robert Phillips | 80bff5b | 2019-08-20 16:56:18 -0400 | [diff] [blame] | 220 | sk_sp<GrTextureProxy> fDstTextureProxy; |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 221 | SkIPoint fDstTextureOffset; |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 222 | GrWindowRectsState fWindowRectsState; |
| 223 | const GrUserStencilSettings* fUserStencilSettings; |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 224 | Flags fFlags; |
Brian Salomon | d61c9d9 | 2017-04-10 10:54:25 -0400 | [diff] [blame] | 225 | sk_sp<const GrXferProcessor> fXferProcessor; |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 226 | FragmentProcessorArray fFragmentProcessors; |
egdaniel | d9aa218 | 2014-10-09 13:47:05 -0700 | [diff] [blame] | 227 | |
bsalomon | ac856c9 | 2015-08-27 06:30:17 -0700 | [diff] [blame] | 228 | // This value is also the index in fFragmentProcessors where coverage processors begin. |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 229 | int fNumColorProcessors; |
Greg Daniel | 2c3398d | 2019-06-19 11:58:01 -0400 | [diff] [blame] | 230 | |
| 231 | GrSwizzle fOutputSwizzle; |
egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 232 | }; |
| 233 | |
Chris Dalton | baa1b35 | 2019-04-03 12:03:00 -0600 | [diff] [blame] | 234 | GR_MAKE_BITFIELD_CLASS_OPS(GrPipeline::InputFlags); |
| 235 | GR_MAKE_BITFIELD_CLASS_OPS(GrPipeline::Flags); |
| 236 | |
| 237 | inline bool operator&(GrPipeline::Flags flags, GrPipeline::InputFlags inputFlag) { |
| 238 | return (flags & (GrPipeline::Flags)inputFlag); |
| 239 | } |
| 240 | |
egdaniel | 3658f38 | 2014-09-15 07:01:59 -0700 | [diff] [blame] | 241 | #endif |