Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019 Google LLC |
| 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 GrRenderTask_DEFINED |
| 9 | #define GrRenderTask_DEFINED |
| 10 | |
| 11 | #include "include/core/SkRefCnt.h" |
Brian Salomon | 07bc9a2 | 2020-12-02 13:37:16 -0500 | [diff] [blame] | 12 | #include "include/private/SkTArray.h" |
Adlai Holler | 7803608 | 2021-01-07 11:41:33 -0500 | [diff] [blame] | 13 | #include "src/core/SkTInternalLList.h" |
Greg Daniel | 16f5c65 | 2019-10-29 11:26:01 -0400 | [diff] [blame] | 14 | #include "src/gpu/GrSurfaceProxyView.h" |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 15 | #include "src/gpu/GrTextureProxy.h" |
Chris Dalton | 0875512 | 2019-08-05 16:13:47 -0600 | [diff] [blame] | 16 | #include "src/gpu/GrTextureResolveManager.h" |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 17 | |
Adlai Holler | 08f5311 | 2021-01-20 17:44:15 -0500 | [diff] [blame] | 18 | class GrMockRenderTask; |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 19 | class GrOpFlushState; |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 20 | class GrResourceAllocator; |
Chris Dalton | e2a903e | 2019-09-18 13:41:50 -0600 | [diff] [blame] | 21 | class GrTextureResolveRenderTask; |
Robert Phillips | 3e87a8e | 2021-08-25 13:22:24 -0400 | [diff] [blame] | 22 | namespace skgpu { namespace v1 { class OpsTask; }} |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 23 | |
| 24 | // This class abstracts a task that targets a single GrSurfaceProxy, participates in the |
| 25 | // GrDrawingManager's DAG, and implements the onExecute method to modify its target proxy's |
Greg Daniel | f41b2bd | 2019-08-22 16:19:24 -0400 | [diff] [blame] | 26 | // contents. (e.g., an opsTask that executes a command buffer, a task to regenerate mipmaps, etc.) |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 27 | class GrRenderTask : public SkRefCnt { |
| 28 | public: |
Greg Daniel | 16f5c65 | 2019-10-29 11:26:01 -0400 | [diff] [blame] | 29 | GrRenderTask(); |
Adlai Holler | 33d569e | 2020-06-16 14:30:08 -0400 | [diff] [blame] | 30 | SkDEBUGCODE(~GrRenderTask() override); |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 31 | |
Chris Dalton | aa938ce | 2021-06-23 18:13:59 -0600 | [diff] [blame] | 32 | void makeClosed(GrRecordingContext*); |
Chris Dalton | aa3cbb8 | 2019-08-21 00:01:21 -0600 | [diff] [blame] | 33 | |
Robert Phillips | 29f3854 | 2019-10-16 09:20:25 -0400 | [diff] [blame] | 34 | void prePrepare(GrRecordingContext* context) { this->onPrePrepare(context); } |
Robert Phillips | 7327c9d | 2019-10-08 16:32:56 -0400 | [diff] [blame] | 35 | |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 36 | // These two methods are only invoked at flush time |
Adlai Holler | 9e2c50e | 2021-02-09 14:41:52 -0500 | [diff] [blame] | 37 | void prepare(GrOpFlushState* flushState); |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 38 | bool execute(GrOpFlushState* flushState) { return this->onExecute(flushState); } |
| 39 | |
Robert Phillips | 07f675d | 2020-11-16 13:44:01 -0500 | [diff] [blame] | 40 | virtual bool requiresExplicitCleanup() const { return false; } |
| 41 | |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 42 | // Called when this class will survive a flush and needs to truncate its ops and start over. |
| 43 | // TODO: ultimately it should be invalid for an op list to survive a flush. |
| 44 | // https://bugs.chromium.org/p/skia/issues/detail?id=7111 |
Adlai Holler | d71b7b0 | 2020-06-08 15:55:00 -0400 | [diff] [blame] | 45 | virtual void endFlush(GrDrawingManager*) {} |
| 46 | |
| 47 | // This method "disowns" all the GrSurfaceProxies this RenderTask modifies. In |
| 48 | // practice this just means telling the drawingManager to forget the relevant |
| 49 | // mappings from surface proxy to last modifying rendertask. |
| 50 | virtual void disown(GrDrawingManager*); |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 51 | |
| 52 | bool isClosed() const { return this->isSetFlag(kClosed_Flag); } |
| 53 | |
Brian Salomon | d63638b | 2021-03-05 14:00:07 -0500 | [diff] [blame] | 54 | /** |
Adlai Holler | e9ea414 | 2021-04-27 14:31:56 -0400 | [diff] [blame] | 55 | * Make this task skippable. This must be used purely for optimization purposes |
Brian Salomon | d63638b | 2021-03-05 14:00:07 -0500 | [diff] [blame] | 56 | * at this point as not all tasks will actually skip their work. It would be better if we could |
| 57 | * detect tasks that can be skipped automatically. We'd need to support minimal flushes (i.e., |
| 58 | * only flush that which is required for SkSurfaces/SkImages) and the ability to detect |
| 59 | * "orphaned tasks" and clean them out from the DAG so they don't indefinitely accumulate. |
| 60 | * Finally, we'd probably have to track whether a proxy's backing store was imported or ever |
| 61 | * exported to the client in case the client is doing direct reads outside of Skia and thus |
| 62 | * may require tasks targeting the proxy to execute even if our DAG contains no reads. |
| 63 | */ |
Adlai Holler | e9ea414 | 2021-04-27 14:31:56 -0400 | [diff] [blame] | 64 | void makeSkippable(); |
| 65 | |
| 66 | bool isSkippable() const { return this->isSetFlag(kSkippable_Flag); } |
Brian Salomon | d63638b | 2021-03-05 14:00:07 -0500 | [diff] [blame] | 67 | |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 68 | /* |
| 69 | * Notify this GrRenderTask that it relies on the contents of 'dependedOn' |
| 70 | */ |
Brian Salomon | 7e67dca | 2020-07-21 09:27:25 -0400 | [diff] [blame] | 71 | void addDependency(GrDrawingManager*, GrSurfaceProxy* dependedOn, GrMipmapped, |
Adlai Holler | d71b7b0 | 2020-06-08 15:55:00 -0400 | [diff] [blame] | 72 | GrTextureResolveManager, const GrCaps& caps); |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 73 | |
| 74 | /* |
Greg Daniel | c30f1a9 | 2019-09-06 15:28:58 -0400 | [diff] [blame] | 75 | * Notify this GrRenderTask that it relies on the contents of all GrRenderTasks which otherTask |
| 76 | * depends on. |
| 77 | */ |
| 78 | void addDependenciesFromOtherTask(GrRenderTask* otherTask); |
| 79 | |
Brian Osman | ae87bf1 | 2021-05-11 13:36:10 -0400 | [diff] [blame] | 80 | SkSpan<GrRenderTask*> dependencies() { return SkMakeSpan(fDependencies); } |
| 81 | SkSpan<GrRenderTask*> dependents() { return SkMakeSpan(fDependents); } |
Herb Derby | f5b03fc | 2021-04-29 14:01:12 -0400 | [diff] [blame] | 82 | |
| 83 | void replaceDependency(const GrRenderTask* toReplace, GrRenderTask* replaceWith); |
| 84 | void replaceDependent(const GrRenderTask* toReplace, GrRenderTask* replaceWith); |
| 85 | |
Adlai Holler | 08f5311 | 2021-01-20 17:44:15 -0500 | [diff] [blame] | 86 | |
Greg Daniel | c30f1a9 | 2019-09-06 15:28:58 -0400 | [diff] [blame] | 87 | /* |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 88 | * Does this renderTask depend on 'dependedOn'? |
| 89 | */ |
| 90 | bool dependsOn(const GrRenderTask* dependedOn) const; |
| 91 | |
Robert Phillips | 07f675d | 2020-11-16 13:44:01 -0500 | [diff] [blame] | 92 | virtual void gatherIDs(SkSTArray<8, uint32_t, true>* idArray) const { |
| 93 | idArray->push_back(fUniqueID); |
| 94 | } |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 95 | uint32_t uniqueID() const { return fUniqueID; } |
Adlai Holler | 858fc99 | 2021-05-17 13:51:46 -0400 | [diff] [blame] | 96 | int numTargets() const { return fTargets.count(); } |
Brian Salomon | 982127b | 2021-01-21 10:43:35 -0500 | [diff] [blame] | 97 | GrSurfaceProxy* target(int i) const { return fTargets[i].get(); } |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 98 | |
| 99 | /* |
Robert Phillips | 3e87a8e | 2021-08-25 13:22:24 -0400 | [diff] [blame] | 100 | * Safely cast this GrRenderTask to a OpsTask (if possible). |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 101 | */ |
Robert Phillips | 3e87a8e | 2021-08-25 13:22:24 -0400 | [diff] [blame] | 102 | virtual skgpu::v1::OpsTask* asOpsTask() { return nullptr; } |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 103 | |
John Stiles | 1e0136e | 2020-08-12 18:44:00 -0400 | [diff] [blame] | 104 | #if GR_TEST_UTILS |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 105 | /* |
| 106 | * Dump out the GrRenderTask dependency DAG |
| 107 | */ |
Robert Phillips | 047d5bb | 2021-01-08 13:39:19 -0500 | [diff] [blame] | 108 | virtual void dump(const SkString& label, |
| 109 | SkString indent, |
| 110 | bool printDependencies, |
| 111 | bool close) const; |
Robert Phillips | 44e2c5f | 2020-04-14 13:00:04 -0400 | [diff] [blame] | 112 | virtual const char* name() const = 0; |
John Stiles | 1e0136e | 2020-08-12 18:44:00 -0400 | [diff] [blame] | 113 | #endif |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 114 | |
John Stiles | 1e0136e | 2020-08-12 18:44:00 -0400 | [diff] [blame] | 115 | #ifdef SK_DEBUG |
Chris Dalton | c4b4735 | 2019-08-23 10:10:36 -0600 | [diff] [blame] | 116 | virtual int numClips() const { return 0; } |
| 117 | |
Robert Phillips | 294723d | 2021-06-17 09:23:58 -0400 | [diff] [blame] | 118 | virtual void visitProxies_debugOnly(const GrVisitProxyFunc&) const = 0; |
Chris Dalton | c4b4735 | 2019-08-23 10:10:36 -0600 | [diff] [blame] | 119 | |
Robert Phillips | 294723d | 2021-06-17 09:23:58 -0400 | [diff] [blame] | 120 | void visitTargetAndSrcProxies_debugOnly(const GrVisitProxyFunc& func) const { |
| 121 | this->visitProxies_debugOnly(func); |
Brian Salomon | 982127b | 2021-01-21 10:43:35 -0500 | [diff] [blame] | 122 | for (const sk_sp<GrSurfaceProxy>& target : fTargets) { |
Robert Phillips | 294723d | 2021-06-17 09:23:58 -0400 | [diff] [blame] | 123 | func(target.get(), GrMipmapped::kNo); |
Chris Dalton | e2a903e | 2019-09-18 13:41:50 -0600 | [diff] [blame] | 124 | } |
Chris Dalton | c4b4735 | 2019-08-23 10:10:36 -0600 | [diff] [blame] | 125 | } |
| 126 | #endif |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 127 | |
Robert Phillips | 07f675d | 2020-11-16 13:44:01 -0500 | [diff] [blame] | 128 | bool isUsed(GrSurfaceProxy* proxy) const { |
Brian Salomon | 982127b | 2021-01-21 10:43:35 -0500 | [diff] [blame] | 129 | for (const sk_sp<GrSurfaceProxy>& target : fTargets) { |
| 130 | if (target.get() == proxy) { |
Robert Phillips | 07f675d | 2020-11-16 13:44:01 -0500 | [diff] [blame] | 131 | return true; |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | return this->onIsUsed(proxy); |
| 136 | } |
| 137 | |
Robert Phillips | 9ef7e20 | 2020-11-17 13:11:09 -0500 | [diff] [blame] | 138 | // Feed proxy usage intervals to the GrResourceAllocator class |
| 139 | virtual void gatherProxyIntervals(GrResourceAllocator*) const = 0; |
| 140 | |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 141 | // In addition to just the GrSurface being allocated, has the stencil buffer been allocated (if |
| 142 | // it is required)? |
| 143 | bool isInstantiated() const; |
| 144 | |
Adlai Holler | 08f5311 | 2021-01-20 17:44:15 -0500 | [diff] [blame] | 145 | // Used by GrRenderTaskCluster. |
Adlai Holler | 7803608 | 2021-01-07 11:41:33 -0500 | [diff] [blame] | 146 | SK_DECLARE_INTERNAL_LLIST_INTERFACE(GrRenderTask); |
| 147 | |
Robert Phillips | 9ef7e20 | 2020-11-17 13:11:09 -0500 | [diff] [blame] | 148 | protected: |
Adlai Holler | 9e2c50e | 2021-02-09 14:41:52 -0500 | [diff] [blame] | 149 | SkDEBUGCODE(bool deferredProxiesAreInstantiated() const;) |
| 150 | |
Adlai Holler | 33d569e | 2020-06-16 14:30:08 -0400 | [diff] [blame] | 151 | // Add a target surface proxy to the list of targets for this task. |
| 152 | // This also informs the drawing manager to update the lastRenderTask association. |
Brian Salomon | 982127b | 2021-01-21 10:43:35 -0500 | [diff] [blame] | 153 | void addTarget(GrDrawingManager*, sk_sp<GrSurfaceProxy>); |
| 154 | |
| 155 | // Helper that adds the proxy owned by a view. |
| 156 | void addTarget(GrDrawingManager* dm, const GrSurfaceProxyView& view) { |
| 157 | this->addTarget(dm, view.refProxy()); |
| 158 | } |
Adlai Holler | 33d569e | 2020-06-16 14:30:08 -0400 | [diff] [blame] | 159 | |
Chris Dalton | aa3cbb8 | 2019-08-21 00:01:21 -0600 | [diff] [blame] | 160 | enum class ExpectedOutcome : bool { |
| 161 | kTargetUnchanged, |
| 162 | kTargetDirty, |
| 163 | }; |
| 164 | |
Chris Dalton | 16a33c6 | 2019-09-24 22:19:17 -0600 | [diff] [blame] | 165 | // Performs any work to finalize this renderTask prior to execution. If returning |
| 166 | // ExpectedOutcome::kTargetDiry, the caller is also responsible to fill out the area it will |
| 167 | // modify in targetUpdateBounds. |
| 168 | // |
| 169 | // targetUpdateBounds must not extend beyond the proxy bounds. |
Chris Dalton | aa938ce | 2021-06-23 18:13:59 -0600 | [diff] [blame] | 170 | virtual ExpectedOutcome onMakeClosed(GrRecordingContext*, SkIRect* targetUpdateBounds) = 0; |
Chris Dalton | aa3cbb8 | 2019-08-21 00:01:21 -0600 | [diff] [blame] | 171 | |
Brian Salomon | 982127b | 2021-01-21 10:43:35 -0500 | [diff] [blame] | 172 | SkSTArray<1, sk_sp<GrSurfaceProxy>> fTargets; |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 173 | |
Adlai Holler | 9e2c50e | 2021-02-09 14:41:52 -0500 | [diff] [blame] | 174 | // List of texture proxies whose contents are being prepared on a worker thread |
| 175 | // TODO: this list exists so we can fire off the proper upload when an renderTask begins |
| 176 | // executing. Can this be replaced? |
| 177 | SkTArray<GrTextureProxy*, true> fDeferredProxies; |
| 178 | |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 179 | enum Flags { |
Adlai Holler | d71b7b0 | 2020-06-08 15:55:00 -0400 | [diff] [blame] | 180 | kClosed_Flag = 0x01, //!< This task can't accept any more dependencies. |
| 181 | kDisowned_Flag = 0x02, //!< This task is disowned by its creating GrDrawingManager. |
Adlai Holler | e9ea414 | 2021-04-27 14:31:56 -0400 | [diff] [blame] | 182 | kSkippable_Flag = 0x04, //!< This task is skippable. |
Chris Dalton | 83420eb | 2021-06-23 18:47:09 -0600 | [diff] [blame] | 183 | kAtlas_Flag = 0x08, //!< This task is atlas. |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 184 | |
Chris Dalton | 83420eb | 2021-06-23 18:47:09 -0600 | [diff] [blame] | 185 | kWasOutput_Flag = 0x10, //!< Flag for topological sorting |
| 186 | kTempMark_Flag = 0x20, //!< Flag for topological sorting |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 187 | }; |
| 188 | |
| 189 | void setFlag(uint32_t flag) { |
| 190 | fFlags |= flag; |
| 191 | } |
| 192 | |
| 193 | void resetFlag(uint32_t flag) { |
| 194 | fFlags &= ~flag; |
| 195 | } |
| 196 | |
| 197 | bool isSetFlag(uint32_t flag) const { |
| 198 | return SkToBool(fFlags & flag); |
| 199 | } |
| 200 | |
Robert Phillips | 4dbff75 | 2020-11-18 12:16:31 -0500 | [diff] [blame] | 201 | void setIndex(uint32_t index) { |
| 202 | SkASSERT(!this->isSetFlag(kWasOutput_Flag)); |
Chris Dalton | 83420eb | 2021-06-23 18:47:09 -0600 | [diff] [blame] | 203 | SkASSERT(index < (1 << 26)); |
| 204 | fFlags |= index << 6; |
Robert Phillips | 4dbff75 | 2020-11-18 12:16:31 -0500 | [diff] [blame] | 205 | } |
| 206 | |
| 207 | uint32_t getIndex() const { |
| 208 | SkASSERT(this->isSetFlag(kWasOutput_Flag)); |
Chris Dalton | 83420eb | 2021-06-23 18:47:09 -0600 | [diff] [blame] | 209 | return fFlags >> 6; |
Robert Phillips | 4dbff75 | 2020-11-18 12:16:31 -0500 | [diff] [blame] | 210 | } |
| 211 | |
Robert Phillips | 9ef7e20 | 2020-11-17 13:11:09 -0500 | [diff] [blame] | 212 | private: |
Chris Dalton | aa938ce | 2021-06-23 18:13:59 -0600 | [diff] [blame] | 213 | // for TopoSortTraits, fTextureResolveTask, addDependency |
Robert Phillips | 9ef7e20 | 2020-11-17 13:11:09 -0500 | [diff] [blame] | 214 | friend class GrDrawingManager; |
Adlai Holler | 08f5311 | 2021-01-20 17:44:15 -0500 | [diff] [blame] | 215 | friend class GrMockRenderTask; |
Robert Phillips | 9ef7e20 | 2020-11-17 13:11:09 -0500 | [diff] [blame] | 216 | |
| 217 | // Derived classes can override to indicate usage of proxies _other than target proxies_. |
| 218 | // GrRenderTask itself will handle checking the target proxies. |
| 219 | virtual bool onIsUsed(GrSurfaceProxy*) const = 0; |
| 220 | |
| 221 | void addDependency(GrRenderTask* dependedOn); |
| 222 | void addDependent(GrRenderTask* dependent); |
Adlai Holler | 7803608 | 2021-01-07 11:41:33 -0500 | [diff] [blame] | 223 | SkDEBUGCODE(bool isDependent(const GrRenderTask* dependent) const;) |
Robert Phillips | 9ef7e20 | 2020-11-17 13:11:09 -0500 | [diff] [blame] | 224 | SkDEBUGCODE(void validate() const;) |
Robert Phillips | 9ef7e20 | 2020-11-17 13:11:09 -0500 | [diff] [blame] | 225 | |
| 226 | static uint32_t CreateUniqueID(); |
| 227 | |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 228 | struct TopoSortTraits { |
Robert Phillips | 4dbff75 | 2020-11-18 12:16:31 -0500 | [diff] [blame] | 229 | static uint32_t GetIndex(GrRenderTask* renderTask) { |
| 230 | return renderTask->getIndex(); |
| 231 | } |
| 232 | static void Output(GrRenderTask* renderTask, uint32_t index) { |
| 233 | renderTask->setIndex(index); |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 234 | renderTask->setFlag(kWasOutput_Flag); |
| 235 | } |
| 236 | static bool WasOutput(const GrRenderTask* renderTask) { |
| 237 | return renderTask->isSetFlag(kWasOutput_Flag); |
| 238 | } |
| 239 | static void SetTempMark(GrRenderTask* renderTask) { |
| 240 | renderTask->setFlag(kTempMark_Flag); |
| 241 | } |
| 242 | static void ResetTempMark(GrRenderTask* renderTask) { |
| 243 | renderTask->resetFlag(kTempMark_Flag); |
| 244 | } |
| 245 | static bool IsTempMarked(const GrRenderTask* renderTask) { |
| 246 | return renderTask->isSetFlag(kTempMark_Flag); |
| 247 | } |
| 248 | static int NumDependencies(const GrRenderTask* renderTask) { |
| 249 | return renderTask->fDependencies.count(); |
| 250 | } |
| 251 | static GrRenderTask* Dependency(GrRenderTask* renderTask, int index) { |
| 252 | return renderTask->fDependencies[index]; |
| 253 | } |
| 254 | }; |
| 255 | |
Adlai Holler | e9ea414 | 2021-04-27 14:31:56 -0400 | [diff] [blame] | 256 | virtual void onMakeSkippable() {} |
Robert Phillips | 3e87a8e | 2021-08-25 13:22:24 -0400 | [diff] [blame] | 257 | virtual void onPrePrepare(GrRecordingContext*) {} // Only OpsTask currently overrides this |
| 258 | virtual void onPrepare(GrOpFlushState*) {} // OpsTask and GrDDLTask override this |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 259 | virtual bool onExecute(GrOpFlushState* flushState) = 0; |
| 260 | |
| 261 | const uint32_t fUniqueID; |
| 262 | uint32_t fFlags; |
| 263 | |
Greg Daniel | f41b2bd | 2019-08-22 16:19:24 -0400 | [diff] [blame] | 264 | // 'this' GrRenderTask relies on the output of the GrRenderTasks in 'fDependencies' |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 265 | SkSTArray<1, GrRenderTask*, true> fDependencies; |
Greg Daniel | f41b2bd | 2019-08-22 16:19:24 -0400 | [diff] [blame] | 266 | // 'this' GrRenderTask's output is relied on by the GrRenderTasks in 'fDependents' |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 267 | SkSTArray<1, GrRenderTask*, true> fDependents; |
Chris Dalton | e2a903e | 2019-09-18 13:41:50 -0600 | [diff] [blame] | 268 | |
| 269 | // For performance reasons, we should perform texture resolves back-to-back as much as possible. |
| 270 | // (http://skbug.com/9406). To accomplish this, we make and reuse one single resolve task for |
| 271 | // each render task, then add it as a dependency during makeClosed(). |
| 272 | GrTextureResolveRenderTask* fTextureResolveTask = nullptr; |
Adlai Holler | 96ead54 | 2020-06-26 08:50:14 -0400 | [diff] [blame] | 273 | |
| 274 | SkDEBUGCODE(GrDrawingManager *fDrawingMgr = nullptr;) |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 275 | }; |
| 276 | |
| 277 | #endif |