egdaniel | 378092f | 2014-12-03 10:40:13 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014 Google Inc. |
| 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 | |
| 8 | #ifndef GrXferProcessor_DEFINED |
| 9 | #define GrXferProcessor_DEFINED |
| 10 | |
cdalton | ee0175f | 2015-06-12 08:21:26 -0700 | [diff] [blame] | 11 | #include "GrBlend.h" |
egdaniel | 378092f | 2014-12-03 10:40:13 -0800 | [diff] [blame] | 12 | #include "GrColor.h" |
egdaniel | c230414 | 2014-12-11 13:15:13 -0800 | [diff] [blame] | 13 | #include "GrProcessor.h" |
Brian Salomon | 5298dc8 | 2017-02-22 11:52:03 -0500 | [diff] [blame] | 14 | #include "GrProcessorSet.h" |
bsalomon | 50785a3 | 2015-02-06 07:02:37 -0800 | [diff] [blame] | 15 | #include "GrTexture.h" |
egdaniel | 378092f | 2014-12-03 10:40:13 -0800 | [diff] [blame] | 16 | #include "GrTypes.h" |
egdaniel | 378092f | 2014-12-03 10:40:13 -0800 | [diff] [blame] | 17 | |
jvanverth | e9c0fc6 | 2015-04-29 11:18:05 -0700 | [diff] [blame] | 18 | class GrShaderCaps; |
egdaniel | fa4cc8b | 2015-11-13 08:34:52 -0800 | [diff] [blame] | 19 | class GrGLSLXferProcessor; |
egdaniel | 9513143 | 2014-12-09 11:15:43 -0800 | [diff] [blame] | 20 | |
egdaniel | 378092f | 2014-12-03 10:40:13 -0800 | [diff] [blame] | 21 | /** |
cdalton | 9954bc3 | 2015-04-29 14:17:00 -0700 | [diff] [blame] | 22 | * Barriers for blending. When a shader reads the dst directly, an Xfer barrier is sometimes |
| 23 | * required after a pixel has been written, before it can be safely read again. |
| 24 | */ |
| 25 | enum GrXferBarrierType { |
bsalomon | cb02b38 | 2015-08-12 11:14:50 -0700 | [diff] [blame] | 26 | kNone_GrXferBarrierType = 0, //<! No barrier is required |
| 27 | kTexture_GrXferBarrierType, //<! Required when a shader reads and renders to the same texture. |
| 28 | kBlend_GrXferBarrierType, //<! Required by certain blend extensions. |
cdalton | 9954bc3 | 2015-04-29 14:17:00 -0700 | [diff] [blame] | 29 | }; |
bsalomon | cb02b38 | 2015-08-12 11:14:50 -0700 | [diff] [blame] | 30 | /** Should be able to treat kNone as false in boolean expressions */ |
| 31 | GR_STATIC_ASSERT(SkToBool(kNone_GrXferBarrierType) == false); |
cdalton | 9954bc3 | 2015-04-29 14:17:00 -0700 | [diff] [blame] | 32 | |
| 33 | /** |
egdaniel | 378092f | 2014-12-03 10:40:13 -0800 | [diff] [blame] | 34 | * GrXferProcessor is responsible for implementing the xfer mode that blends the src color and dst |
cdalton | edbb31f | 2015-06-08 12:14:44 -0700 | [diff] [blame] | 35 | * color, and for applying any coverage. It does this by emitting fragment shader code and |
| 36 | * controlling the fixed-function blend state. When dual-source blending is available, it may also |
| 37 | * write a seconday fragment shader output color. GrXferProcessor has two modes of operation: |
| 38 | * |
| 39 | * Dst read: When allowed by the backend API, or when supplied a texture of the destination, the |
| 40 | * GrXferProcessor may read the destination color. While operating in this mode, the subclass only |
| 41 | * provides shader code that blends the src and dst colors, and the base class applies coverage. |
| 42 | * |
| 43 | * No dst read: When not performing a dst read, the subclass is given full control of the fixed- |
| 44 | * function blend state and/or secondary output, and is responsible to apply coverage on its own. |
egdaniel | 378092f | 2014-12-03 10:40:13 -0800 | [diff] [blame] | 45 | * |
| 46 | * A GrXferProcessor is never installed directly into our draw state, but instead is created from a |
| 47 | * GrXPFactory once we have finalized the state of our draw. |
| 48 | */ |
egdaniel | c230414 | 2014-12-11 13:15:13 -0800 | [diff] [blame] | 49 | class GrXferProcessor : public GrProcessor { |
egdaniel | 9513143 | 2014-12-09 11:15:43 -0800 | [diff] [blame] | 50 | public: |
| 51 | /** |
bsalomon | 6a44c6a | 2015-05-26 09:49:05 -0700 | [diff] [blame] | 52 | * A texture that contains the dst pixel values and an integer coord offset from device space |
| 53 | * to the space of the texture. Depending on GPU capabilities a DstTexture may be used by a |
| 54 | * GrXferProcessor for blending in the fragment shader. |
| 55 | */ |
| 56 | class DstTexture { |
| 57 | public: |
| 58 | DstTexture() { fOffset.set(0, 0); } |
| 59 | |
| 60 | DstTexture(const DstTexture& other) { |
| 61 | *this = other; |
| 62 | } |
| 63 | |
| 64 | DstTexture(GrTexture* texture, const SkIPoint& offset) |
Brian Salomon | 54d212e | 2017-03-21 14:22:38 -0400 | [diff] [blame] | 65 | : fTexture(SkSafeRef(texture)), fOffset(texture ? offset : SkIPoint{0, 0}) {} |
bsalomon | 6a44c6a | 2015-05-26 09:49:05 -0700 | [diff] [blame] | 66 | |
| 67 | DstTexture& operator=(const DstTexture& other) { |
bungeman | 6bd5284 | 2016-10-27 09:30:08 -0700 | [diff] [blame] | 68 | fTexture = other.fTexture; |
bsalomon | 6a44c6a | 2015-05-26 09:49:05 -0700 | [diff] [blame] | 69 | fOffset = other.fOffset; |
| 70 | return *this; |
| 71 | } |
| 72 | |
Brian Salomon | 54d212e | 2017-03-21 14:22:38 -0400 | [diff] [blame] | 73 | bool operator==(const DstTexture& that) const { |
| 74 | return fTexture == that.fTexture && fOffset == that.fOffset; |
| 75 | } |
| 76 | bool operator!=(const DstTexture& that) const { return !(*this == that); } |
| 77 | |
bsalomon | 6a44c6a | 2015-05-26 09:49:05 -0700 | [diff] [blame] | 78 | const SkIPoint& offset() const { return fOffset; } |
| 79 | |
| 80 | void setOffset(const SkIPoint& offset) { fOffset = offset; } |
| 81 | void setOffset(int ox, int oy) { fOffset.set(ox, oy); } |
| 82 | |
| 83 | GrTexture* texture() const { return fTexture.get(); } |
| 84 | |
bungeman | 6bd5284 | 2016-10-27 09:30:08 -0700 | [diff] [blame] | 85 | void setTexture(sk_sp<GrTexture> texture) { |
| 86 | fTexture = std::move(texture); |
Brian Salomon | 54d212e | 2017-03-21 14:22:38 -0400 | [diff] [blame] | 87 | if (!fTexture) { |
| 88 | fOffset = {0, 0}; |
| 89 | } |
bsalomon | 6a44c6a | 2015-05-26 09:49:05 -0700 | [diff] [blame] | 90 | } |
| 91 | |
| 92 | private: |
bungeman | 6bd5284 | 2016-10-27 09:30:08 -0700 | [diff] [blame] | 93 | sk_sp<GrTexture> fTexture; |
| 94 | SkIPoint fOffset; |
bsalomon | 6a44c6a | 2015-05-26 09:49:05 -0700 | [diff] [blame] | 95 | }; |
| 96 | |
| 97 | /** |
egdaniel | 57d3b03 | 2015-11-13 11:57:27 -0800 | [diff] [blame] | 98 | * Sets a unique key on the GrProcessorKeyBuilder calls onGetGLSLProcessorKey(...) to get the |
bsalomon | 50785a3 | 2015-02-06 07:02:37 -0800 | [diff] [blame] | 99 | * specific subclass's key. |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 100 | */ |
| 101 | void getGLSLProcessorKey(const GrShaderCaps&, |
| 102 | GrProcessorKeyBuilder*, |
| 103 | const GrSurfaceOrigin* originIfDstTexture) const; |
egdaniel | c230414 | 2014-12-11 13:15:13 -0800 | [diff] [blame] | 104 | |
| 105 | /** Returns a new instance of the appropriate *GL* implementation class |
| 106 | for the given GrXferProcessor; caller is responsible for deleting |
| 107 | the object. */ |
egdaniel | 57d3b03 | 2015-11-13 11:57:27 -0800 | [diff] [blame] | 108 | virtual GrGLSLXferProcessor* createGLSLInstance() const = 0; |
egdaniel | c230414 | 2014-12-11 13:15:13 -0800 | [diff] [blame] | 109 | |
| 110 | /** |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 111 | * Returns the barrier type, if any, that this XP will require. Note that the possibility |
| 112 | * that a kTexture type barrier is required is handled by the GrPipeline and need not be |
| 113 | * considered by subclass overrides of this function. |
cdalton | 9954bc3 | 2015-04-29 14:17:00 -0700 | [diff] [blame] | 114 | */ |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 115 | virtual GrXferBarrierType xferBarrierType(const GrCaps& caps) const { |
| 116 | return kNone_GrXferBarrierType; |
| 117 | } |
cdalton | 9954bc3 | 2015-04-29 14:17:00 -0700 | [diff] [blame] | 118 | |
egdaniel | 9513143 | 2014-12-09 11:15:43 -0800 | [diff] [blame] | 119 | struct BlendInfo { |
cdalton | f4f2b44 | 2015-04-23 09:40:23 -0700 | [diff] [blame] | 120 | void reset() { |
cdalton | 8917d62 | 2015-05-06 13:40:21 -0700 | [diff] [blame] | 121 | fEquation = kAdd_GrBlendEquation; |
cdalton | f4f2b44 | 2015-04-23 09:40:23 -0700 | [diff] [blame] | 122 | fSrcBlend = kOne_GrBlendCoeff; |
| 123 | fDstBlend = kZero_GrBlendCoeff; |
| 124 | fBlendConstant = 0; |
| 125 | fWriteColor = true; |
| 126 | } |
egdaniel | 080e673 | 2014-12-22 07:35:52 -0800 | [diff] [blame] | 127 | |
bsalomon | f7cc877 | 2015-05-11 11:21:14 -0700 | [diff] [blame] | 128 | SkDEBUGCODE(SkString dump() const;) |
| 129 | |
cdalton | 8917d62 | 2015-05-06 13:40:21 -0700 | [diff] [blame] | 130 | GrBlendEquation fEquation; |
| 131 | GrBlendCoeff fSrcBlend; |
| 132 | GrBlendCoeff fDstBlend; |
| 133 | GrColor fBlendConstant; |
| 134 | bool fWriteColor; |
egdaniel | 9513143 | 2014-12-09 11:15:43 -0800 | [diff] [blame] | 135 | }; |
| 136 | |
cdalton | edbb31f | 2015-06-08 12:14:44 -0700 | [diff] [blame] | 137 | void getBlendInfo(BlendInfo* blendInfo) const; |
egdaniel | 9513143 | 2014-12-09 11:15:43 -0800 | [diff] [blame] | 138 | |
egdaniel | 9513143 | 2014-12-09 11:15:43 -0800 | [diff] [blame] | 139 | bool willReadDstColor() const { return fWillReadDstColor; } |
| 140 | |
bsalomon | 50785a3 | 2015-02-06 07:02:37 -0800 | [diff] [blame] | 141 | /** |
cdalton | 86ae0a9 | 2015-06-08 15:11:04 -0700 | [diff] [blame] | 142 | * If we are performing a dst read, returns whether the base class will use mixed samples to |
| 143 | * antialias the shader's final output. If not doing a dst read, the subclass is responsible |
| 144 | * for antialiasing and this returns false. |
| 145 | */ |
| 146 | bool dstReadUsesMixedSamples() const { return fDstReadUsesMixedSamples; } |
| 147 | |
| 148 | /** |
egdaniel | c230414 | 2014-12-11 13:15:13 -0800 | [diff] [blame] | 149 | * Returns whether or not this xferProcossor will set a secondary output to be used with dual |
| 150 | * source blending. |
| 151 | */ |
cdalton | edbb31f | 2015-06-08 12:14:44 -0700 | [diff] [blame] | 152 | bool hasSecondaryOutput() const; |
egdaniel | c230414 | 2014-12-11 13:15:13 -0800 | [diff] [blame] | 153 | |
| 154 | /** Returns true if this and other processor conservatively draw identically. It can only return |
| 155 | true when the two processor are of the same subclass (i.e. they return the same object from |
| 156 | from getFactory()). |
| 157 | |
| 158 | A return value of true from isEqual() should not be used to test whether the processor would |
egdaniel | 57d3b03 | 2015-11-13 11:57:27 -0800 | [diff] [blame] | 159 | generate the same shader code. To test for identical code generation use getGLSLProcessorKey |
| 160 | */ |
egdaniel | c230414 | 2014-12-11 13:15:13 -0800 | [diff] [blame] | 161 | |
| 162 | bool isEqual(const GrXferProcessor& that) const { |
| 163 | if (this->classID() != that.classID()) { |
| 164 | return false; |
| 165 | } |
bsalomon | 50785a3 | 2015-02-06 07:02:37 -0800 | [diff] [blame] | 166 | if (this->fWillReadDstColor != that.fWillReadDstColor) { |
| 167 | return false; |
| 168 | } |
cdalton | 86ae0a9 | 2015-06-08 15:11:04 -0700 | [diff] [blame] | 169 | if (this->fDstReadUsesMixedSamples != that.fDstReadUsesMixedSamples) { |
| 170 | return false; |
| 171 | } |
egdaniel | c230414 | 2014-12-11 13:15:13 -0800 | [diff] [blame] | 172 | return this->onIsEqual(that); |
| 173 | } |
Brian Salomon | 92aee3d | 2016-12-21 09:20:25 -0500 | [diff] [blame] | 174 | |
egdaniel | 9513143 | 2014-12-09 11:15:43 -0800 | [diff] [blame] | 175 | protected: |
bsalomon | 50785a3 | 2015-02-06 07:02:37 -0800 | [diff] [blame] | 176 | GrXferProcessor(); |
Brian Salomon | 18dfa98 | 2017-04-03 16:57:43 -0400 | [diff] [blame] | 177 | GrXferProcessor(bool willReadDstColor, bool hasMixedSamples); |
egdaniel | 9513143 | 2014-12-09 11:15:43 -0800 | [diff] [blame] | 178 | |
egdaniel | 378092f | 2014-12-03 10:40:13 -0800 | [diff] [blame] | 179 | private: |
bsalomon | 4204800 | 2015-08-27 16:43:48 -0700 | [diff] [blame] | 180 | void notifyRefCntIsZero() const final {} |
| 181 | |
bsalomon | 50785a3 | 2015-02-06 07:02:37 -0800 | [diff] [blame] | 182 | /** |
| 183 | * Sets a unique key on the GrProcessorKeyBuilder that is directly associated with this xfer |
| 184 | * processor's GL backend implementation. |
| 185 | */ |
Brian Salomon | 94efbf5 | 2016-11-29 13:43:05 -0500 | [diff] [blame] | 186 | virtual void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const = 0; |
bsalomon | 50785a3 | 2015-02-06 07:02:37 -0800 | [diff] [blame] | 187 | |
cdalton | f4f2b44 | 2015-04-23 09:40:23 -0700 | [diff] [blame] | 188 | /** |
cdalton | edbb31f | 2015-06-08 12:14:44 -0700 | [diff] [blame] | 189 | * If we are not performing a dst read, returns whether the subclass will set a secondary |
cdalton | 86ae0a9 | 2015-06-08 15:11:04 -0700 | [diff] [blame] | 190 | * output. When using dst reads, the base class controls the secondary output and this method |
cdalton | edbb31f | 2015-06-08 12:14:44 -0700 | [diff] [blame] | 191 | * will not be called. |
| 192 | */ |
| 193 | virtual bool onHasSecondaryOutput() const { return false; } |
| 194 | |
| 195 | /** |
| 196 | * If we are not performing a dst read, retrieves the fixed-function blend state required by the |
cdalton | 86ae0a9 | 2015-06-08 15:11:04 -0700 | [diff] [blame] | 197 | * subclass. When using dst reads, the base class controls the fixed-function blend state and |
| 198 | * this method will not be called. The BlendInfo struct comes initialized to "no blending". |
cdalton | f4f2b44 | 2015-04-23 09:40:23 -0700 | [diff] [blame] | 199 | */ |
| 200 | virtual void onGetBlendInfo(BlendInfo*) const {} |
| 201 | |
egdaniel | c230414 | 2014-12-11 13:15:13 -0800 | [diff] [blame] | 202 | virtual bool onIsEqual(const GrXferProcessor&) const = 0; |
egdaniel | 378092f | 2014-12-03 10:40:13 -0800 | [diff] [blame] | 203 | |
bsalomon | 50785a3 | 2015-02-06 07:02:37 -0800 | [diff] [blame] | 204 | bool fWillReadDstColor; |
cdalton | 86ae0a9 | 2015-06-08 15:11:04 -0700 | [diff] [blame] | 205 | bool fDstReadUsesMixedSamples; |
egdaniel | 9513143 | 2014-12-09 11:15:43 -0800 | [diff] [blame] | 206 | |
egdaniel | 378092f | 2014-12-03 10:40:13 -0800 | [diff] [blame] | 207 | typedef GrFragmentProcessor INHERITED; |
| 208 | }; |
| 209 | |
| 210 | /** |
| 211 | * We install a GrXPFactory (XPF) early on in the pipeline before all the final draw information is |
| 212 | * known (e.g. whether there is fractional pixel coverage, will coverage be 1 or 4 channel, is the |
| 213 | * draw opaque, etc.). Once the state of the draw is finalized, we use the XPF along with all the |
| 214 | * draw information to create a GrXferProcessor (XP) which can implement the desired blending for |
| 215 | * the draw. |
| 216 | * |
| 217 | * Before the XP is created, the XPF is able to answer queries about what functionality the XPs it |
| 218 | * creates will have. For example, can it create an XP that supports RGB coverage or will the XP |
| 219 | * blend with the destination color. |
Brian Salomon | a163392 | 2017-01-09 11:46:10 -0500 | [diff] [blame] | 220 | * |
| 221 | * GrXPFactories are intended to be static immutable objects. We pass them around as raw pointers |
| 222 | * and expect the pointers to always be valid and for the factories to be reusable and thread safe. |
| 223 | * Equality is tested for using pointer comparison. GrXPFactory destructors must be no-ops. |
egdaniel | 378092f | 2014-12-03 10:40:13 -0800 | [diff] [blame] | 224 | */ |
Brian Salomon | a163392 | 2017-01-09 11:46:10 -0500 | [diff] [blame] | 225 | |
| 226 | // In order to construct GrXPFactory subclass instances as constexpr the subclass, and therefore |
| 227 | // GrXPFactory, must be a literal type. One requirement is having a trivial destructor. This is ok |
| 228 | // since these objects have no need for destructors. However, GCC and clang throw a warning when a |
| 229 | // class has virtual functions and a non-virtual destructor. We suppress that warning here and |
| 230 | // for the subclasses. |
| 231 | #if defined(__GNUC__) || defined(__clang) |
| 232 | #pragma GCC diagnostic push |
| 233 | #pragma GCC diagnostic ignored "-Wnon-virtual-dtor" |
| 234 | #endif |
| 235 | class GrXPFactory { |
egdaniel | 378092f | 2014-12-03 10:40:13 -0800 | [diff] [blame] | 236 | public: |
bsalomon | 6a44c6a | 2015-05-26 09:49:05 -0700 | [diff] [blame] | 237 | typedef GrXferProcessor::DstTexture DstTexture; |
Brian Salomon | 5be6c95 | 2017-01-20 19:06:29 +0000 | [diff] [blame] | 238 | |
Brian Salomon | 3185384 | 2017-03-28 16:32:05 -0400 | [diff] [blame] | 239 | enum class AnalysisProperties : unsigned { |
| 240 | kNone = 0x0, |
Brian Salomon | 4fc7740 | 2017-03-30 16:48:26 -0400 | [diff] [blame] | 241 | /** |
| 242 | * The fragment shader will require the destination color. |
| 243 | */ |
Brian Salomon | 3185384 | 2017-03-28 16:32:05 -0400 | [diff] [blame] | 244 | kReadsDstInShader = 0x1, |
Brian Salomon | 4fc7740 | 2017-03-30 16:48:26 -0400 | [diff] [blame] | 245 | /** |
| 246 | * The op may apply coverage as alpha and still blend correctly. |
| 247 | */ |
| 248 | kCompatibleWithAlphaAsCoverage = 0x2, |
| 249 | /** |
| 250 | * The color input to the GrXferProcessor will be ignored. |
| 251 | */ |
| 252 | kIgnoresInputColor = 0x4, |
| 253 | /** |
| 254 | * If set overlapping stencil and cover operations can be replaced by a combined stencil |
| 255 | * followed by a combined cover. |
| 256 | */ |
| 257 | kCanCombineOverlappedStencilAndCover = 0x8, |
| 258 | /** |
| 259 | * The destination color will be provided to the fragment processor using a texture. This is |
| 260 | * additional information about the implementation of kReadsDstInShader. |
| 261 | */ |
| 262 | kRequiresDstTexture = 0x10, |
| 263 | /** |
| 264 | * If set overlapping draws may not be combined because a barrier must be inserted between |
| 265 | * them. |
| 266 | */ |
| 267 | kRequiresBarrierBetweenOverlappingDraws = 0x20, |
Brian Salomon | 3185384 | 2017-03-28 16:32:05 -0400 | [diff] [blame] | 268 | }; |
| 269 | GR_DECL_BITFIELD_CLASS_OPS_FRIENDS(AnalysisProperties); |
egdaniel | 080e673 | 2014-12-22 07:35:52 -0800 | [diff] [blame] | 270 | |
Brian Salomon | a076d87 | 2017-04-04 15:17:03 -0400 | [diff] [blame] | 271 | static sk_sp<GrXferProcessor> MakeXferProcessor(const GrXPFactory*, |
| 272 | const GrProcessorAnalysisColor&, |
| 273 | GrProcessorAnalysisCoverage, |
| 274 | bool hasMixedSamples, |
| 275 | const GrCaps& caps); |
| 276 | |
Brian Salomon | 3185384 | 2017-03-28 16:32:05 -0400 | [diff] [blame] | 277 | static AnalysisProperties GetAnalysisProperties(const GrXPFactory*, |
Brian Salomon | a811b12 | 2017-03-30 08:21:32 -0400 | [diff] [blame] | 278 | const GrProcessorAnalysisColor&, |
| 279 | const GrProcessorAnalysisCoverage&, |
Brian Salomon | 3185384 | 2017-03-28 16:32:05 -0400 | [diff] [blame] | 280 | const GrCaps&); |
Brian Salomon | 54d212e | 2017-03-21 14:22:38 -0400 | [diff] [blame] | 281 | |
egdaniel | 915187b | 2014-12-05 12:58:28 -0800 | [diff] [blame] | 282 | protected: |
Brian Salomon | a163392 | 2017-01-09 11:46:10 -0500 | [diff] [blame] | 283 | constexpr GrXPFactory() {} |
egdaniel | 915187b | 2014-12-05 12:58:28 -0800 | [diff] [blame] | 284 | |
egdaniel | 378092f | 2014-12-03 10:40:13 -0800 | [diff] [blame] | 285 | private: |
Brian Salomon | a076d87 | 2017-04-04 15:17:03 -0400 | [diff] [blame] | 286 | virtual sk_sp<GrXferProcessor> makeXferProcessor(const GrProcessorAnalysisColor&, |
| 287 | GrProcessorAnalysisCoverage, |
| 288 | bool hasMixedSamples, |
| 289 | const GrCaps&) const = 0; |
ethannicholas | 2279325 | 2016-01-30 09:59:10 -0800 | [diff] [blame] | 290 | |
bsalomon | 50785a3 | 2015-02-06 07:02:37 -0800 | [diff] [blame] | 291 | /** |
Brian Salomon | 3185384 | 2017-03-28 16:32:05 -0400 | [diff] [blame] | 292 | * Subclass analysis implementation. This should not return kNeedsDstInTexture as that will be |
| 293 | * inferred by the base class based on kReadsDstInShader and the caps. |
bsalomon | 50785a3 | 2015-02-06 07:02:37 -0800 | [diff] [blame] | 294 | */ |
Brian Salomon | a811b12 | 2017-03-30 08:21:32 -0400 | [diff] [blame] | 295 | virtual AnalysisProperties analysisProperties(const GrProcessorAnalysisColor&, |
| 296 | const GrProcessorAnalysisCoverage&, |
Brian Salomon | 3185384 | 2017-03-28 16:32:05 -0400 | [diff] [blame] | 297 | const GrCaps&) const = 0; |
egdaniel | 378092f | 2014-12-03 10:40:13 -0800 | [diff] [blame] | 298 | }; |
Brian Salomon | a163392 | 2017-01-09 11:46:10 -0500 | [diff] [blame] | 299 | #if defined(__GNUC__) || defined(__clang) |
| 300 | #pragma GCC diagnostic pop |
| 301 | #endif |
egdaniel | 378092f | 2014-12-03 10:40:13 -0800 | [diff] [blame] | 302 | |
Brian Salomon | 3185384 | 2017-03-28 16:32:05 -0400 | [diff] [blame] | 303 | GR_MAKE_BITFIELD_CLASS_OPS(GrXPFactory::AnalysisProperties); |
egdaniel | 378092f | 2014-12-03 10:40:13 -0800 | [diff] [blame] | 304 | |
Brian Salomon | 3185384 | 2017-03-28 16:32:05 -0400 | [diff] [blame] | 305 | #endif |