robertphillips | 77a2e52 | 2015-10-17 07:43:27 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 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 GrDrawingManager_DEFINED |
| 9 | #define GrDrawingManager_DEFINED |
| 10 | |
Robert Phillips | 15c9142 | 2019-05-07 16:54:48 -0400 | [diff] [blame] | 11 | #include <set> |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 12 | #include "include/core/SkSurface.h" |
| 13 | #include "include/private/SkTArray.h" |
| 14 | #include "src/gpu/GrBufferAllocPool.h" |
| 15 | #include "src/gpu/GrDeferredUpload.h" |
| 16 | #include "src/gpu/GrPathRenderer.h" |
| 17 | #include "src/gpu/GrPathRendererChain.h" |
| 18 | #include "src/gpu/GrResourceCache.h" |
| 19 | #include "src/gpu/text/GrTextContext.h" |
Robert Phillips | f2361d2 | 2016-10-25 14:20:06 -0400 | [diff] [blame] | 20 | |
Chris Dalton | fddb6c0 | 2017-11-04 15:22:22 -0600 | [diff] [blame] | 21 | class GrCoverageCountingPathRenderer; |
Robert Phillips | fbcef6e | 2017-06-15 12:07:18 -0400 | [diff] [blame] | 22 | class GrOnFlushCallbackObject; |
Herb Derby | dc214c2 | 2018-11-08 13:31:39 -0500 | [diff] [blame] | 23 | class GrOpFlushState; |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 24 | class GrOpList; |
Robert Phillips | 6989370 | 2019-02-22 11:16:30 -0500 | [diff] [blame] | 25 | class GrRecordingContext; |
Brian Osman | 1105224 | 2016-10-27 14:47:55 -0400 | [diff] [blame] | 26 | class GrRenderTargetContext; |
Robert Phillips | c7635fa | 2016-10-28 13:25:24 -0400 | [diff] [blame] | 27 | class GrRenderTargetProxy; |
Brian Salomon | 653f42f | 2018-07-10 10:07:31 -0400 | [diff] [blame] | 28 | class GrRenderTargetOpList; |
robertphillips | 6873782 | 2015-10-29 12:12:21 -0700 | [diff] [blame] | 29 | class GrSoftwarePathRenderer; |
Brian Osman | 45580d3 | 2016-11-23 09:37:01 -0500 | [diff] [blame] | 30 | class GrTextureContext; |
| 31 | class GrTextureOpList; |
Brian Salomon | 653f42f | 2018-07-10 10:07:31 -0400 | [diff] [blame] | 32 | class SkDeferredDisplayList; |
robertphillips | 77a2e52 | 2015-10-17 07:43:27 -0700 | [diff] [blame] | 33 | |
robertphillips | 77a2e52 | 2015-10-17 07:43:27 -0700 | [diff] [blame] | 34 | class GrDrawingManager { |
| 35 | public: |
| 36 | ~GrDrawingManager(); |
| 37 | |
robertphillips | 6873782 | 2015-10-29 12:12:21 -0700 | [diff] [blame] | 38 | void freeGpuResources(); |
robertphillips | 77a2e52 | 2015-10-17 07:43:27 -0700 | [diff] [blame] | 39 | |
Robert Phillips | 3743013 | 2016-11-09 06:50:43 -0500 | [diff] [blame] | 40 | sk_sp<GrRenderTargetContext> makeRenderTargetContext(sk_sp<GrSurfaceProxy>, |
Brian Salomon | d628747 | 2019-06-24 15:50:07 -0400 | [diff] [blame] | 41 | GrColorType, |
Brian Osman | 1105224 | 2016-10-27 14:47:55 -0400 | [diff] [blame] | 42 | sk_sp<SkColorSpace>, |
Robert Phillips | 941d144 | 2017-06-14 16:37:02 -0400 | [diff] [blame] | 43 | const SkSurfaceProps*, |
| 44 | bool managedOpList = true); |
Brian Salomon | e7499c7 | 2019-06-24 12:12:36 -0400 | [diff] [blame] | 45 | sk_sp<GrTextureContext> makeTextureContext(sk_sp<GrSurfaceProxy>, |
Brian Salomon | d628747 | 2019-06-24 15:50:07 -0400 | [diff] [blame] | 46 | GrColorType, |
Brian Salomon | e7499c7 | 2019-06-24 12:12:36 -0400 | [diff] [blame] | 47 | SkAlphaType, |
| 48 | sk_sp<SkColorSpace>); |
robertphillips | 77a2e52 | 2015-10-17 07:43:27 -0700 | [diff] [blame] | 49 | |
Robert Phillips | 941d144 | 2017-06-14 16:37:02 -0400 | [diff] [blame] | 50 | // A managed opList is controlled by the drawing manager (i.e., sorted & flushed with the |
Robert Phillips | 831a293 | 2019-04-12 17:18:39 -0400 | [diff] [blame] | 51 | // others). An unmanaged one is created and used by the onFlushCallback. |
| 52 | sk_sp<GrRenderTargetOpList> newRTOpList(sk_sp<GrRenderTargetProxy>, bool managedOpList); |
| 53 | sk_sp<GrTextureOpList> newTextureOpList(sk_sp<GrTextureProxy>); |
robertphillips | 77a2e52 | 2015-10-17 07:43:27 -0700 | [diff] [blame] | 54 | |
Chris Dalton | 3d77027 | 2019-08-14 09:24:37 -0600 | [diff] [blame] | 55 | // Create a new, specialized, render task that will regenerate mipmap levels and/or resolve |
| 56 | // MSAA (depending on GrTextureResolveFlags). This method will add the new render task to the |
| 57 | // list of render tasks and make it depend on the target texture proxy. It is up to the caller |
| 58 | // to add any dependencies on the new render task. |
| 59 | GrRenderTask* newTextureResolveRenderTask( |
| 60 | sk_sp<GrTextureProxy>, GrTextureResolveFlags, const GrCaps&); |
| 61 | |
Greg Daniel | bbfec9d | 2019-08-20 10:56:51 -0400 | [diff] [blame] | 62 | // Create a new render task which copies the pixels from the srcProxy into the dstBuffer. This |
| 63 | // is used to support the asynchronous readback API. The srcRect is the region of the srcProxy |
| 64 | // to be copied. The surfaceColorType says how we should interpret the data when reading back |
| 65 | // from the source. DstColorType describes how the data should be stored in the dstBuffer. |
| 66 | // DstOffset is the offset into the dstBuffer where we will start writing data. |
| 67 | void newTransferFromRenderTask(sk_sp<GrSurfaceProxy> srcProxy, const SkIRect& srcRect, |
| 68 | GrColorType surfaceColorType, GrColorType dstColorType, |
| 69 | sk_sp<GrGpuBuffer> dstBuffer, size_t dstOffset); |
| 70 | |
Robert Phillips | 6989370 | 2019-02-22 11:16:30 -0500 | [diff] [blame] | 71 | GrRecordingContext* getContext() { return fContext; } |
robertphillips | 77a2e52 | 2015-10-17 07:43:27 -0700 | [diff] [blame] | 72 | |
Herb Derby | 26cbe51 | 2018-05-24 14:39:01 -0400 | [diff] [blame] | 73 | GrTextContext* getTextContext(); |
brianosman | 86e7626 | 2016-08-11 12:17:31 -0700 | [diff] [blame] | 74 | |
robertphillips | 6873782 | 2015-10-29 12:12:21 -0700 | [diff] [blame] | 75 | GrPathRenderer* getPathRenderer(const GrPathRenderer::CanDrawPathArgs& args, |
| 76 | bool allowSW, |
| 77 | GrPathRendererChain::DrawType drawType, |
Ben Wagner | a93a14a | 2017-08-28 10:34:05 -0400 | [diff] [blame] | 78 | GrPathRenderer::StencilSupport* stencilSupport = nullptr); |
robertphillips | 6873782 | 2015-10-29 12:12:21 -0700 | [diff] [blame] | 79 | |
Brian Salomon | e7df0bb | 2018-05-07 14:44:57 -0400 | [diff] [blame] | 80 | GrPathRenderer* getSoftwarePathRenderer(); |
| 81 | |
Chris Dalton | fddb6c0 | 2017-11-04 15:22:22 -0600 | [diff] [blame] | 82 | // Returns a direct pointer to the coverage counting path renderer, or null if it is not |
| 83 | // supported and turned on. |
| 84 | GrCoverageCountingPathRenderer* getCoverageCountingPathRenderer(); |
| 85 | |
Brian Salomon | 653f42f | 2018-07-10 10:07:31 -0400 | [diff] [blame] | 86 | void flushIfNecessary(); |
bsalomon | b77a907 | 2016-09-07 10:02:04 -0700 | [diff] [blame] | 87 | |
Greg Daniel | 78325c1 | 2017-06-19 16:39:13 -0400 | [diff] [blame] | 88 | static bool ProgramUnitTest(GrContext* context, int maxStages, int maxLevels); |
robertphillips | a13e202 | 2015-11-11 12:01:09 -0800 | [diff] [blame] | 89 | |
Brian Salomon | f9a1fdf | 2019-05-09 10:30:12 -0400 | [diff] [blame] | 90 | GrSemaphoresSubmitted flushSurfaces(GrSurfaceProxy* proxies[], |
| 91 | int cnt, |
| 92 | SkSurface::BackendSurfaceAccess access, |
| 93 | const GrFlushInfo& info); |
| 94 | GrSemaphoresSubmitted flushSurface(GrSurfaceProxy* proxy, |
Greg Daniel | 4aa13e7 | 2019-04-15 14:42:20 -0400 | [diff] [blame] | 95 | SkSurface::BackendSurfaceAccess access, |
Brian Salomon | f9a1fdf | 2019-05-09 10:30:12 -0400 | [diff] [blame] | 96 | const GrFlushInfo& info) { |
| 97 | return this->flushSurfaces(&proxy, 1, access, info); |
| 98 | } |
bsalomon | 6a2b194 | 2016-09-08 11:28:59 -0700 | [diff] [blame] | 99 | |
Chris Dalton | fe199b7 | 2017-05-05 11:26:15 -0400 | [diff] [blame] | 100 | void addOnFlushCallbackObject(GrOnFlushCallbackObject*); |
Robert Phillips | dbaf317 | 2019-02-06 15:12:53 -0500 | [diff] [blame] | 101 | |
| 102 | #if GR_TEST_UTILS |
Chris Dalton | fe199b7 | 2017-05-05 11:26:15 -0400 | [diff] [blame] | 103 | void testingOnly_removeOnFlushCallbackObject(GrOnFlushCallbackObject*); |
Robert Phillips | dbaf317 | 2019-02-06 15:12:53 -0500 | [diff] [blame] | 104 | #endif |
Robert Phillips | eb35f4d | 2017-03-21 07:56:47 -0400 | [diff] [blame] | 105 | |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 106 | void moveRenderTasksToDDL(SkDeferredDisplayList* ddl); |
| 107 | void copyRenderTasksFromDDL(const SkDeferredDisplayList*, GrRenderTargetProxy* newDest); |
Robert Phillips | 6200036 | 2018-02-01 09:10:04 -0500 | [diff] [blame] | 108 | |
robertphillips | 77a2e52 | 2015-10-17 07:43:27 -0700 | [diff] [blame] | 109 | private: |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 110 | // This class encapsulates maintenance and manipulation of the drawing manager's DAG of |
| 111 | // renderTasks. |
| 112 | class RenderTaskDAG { |
Robert Phillips | 22310d6 | 2018-09-05 11:07:21 -0400 | [diff] [blame] | 113 | public: |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 114 | RenderTaskDAG(bool sortRenderTasks); |
| 115 | ~RenderTaskDAG(); |
Robert Phillips | 22310d6 | 2018-09-05 11:07:21 -0400 | [diff] [blame] | 116 | |
| 117 | // Currently, when explicitly allocating resources, this call will topologically sort the |
| 118 | // opLists. |
| 119 | // MDB TODO: remove once incremental opList sorting is enabled |
| 120 | void prepForFlush(); |
| 121 | |
| 122 | void closeAll(const GrCaps* caps); |
| 123 | |
| 124 | // A yucky combination of closeAll and reset |
| 125 | void cleanup(const GrCaps* caps); |
| 126 | |
| 127 | void gatherIDs(SkSTArray<8, uint32_t, true>* idArray) const; |
| 128 | |
| 129 | void reset(); |
| 130 | |
| 131 | // These calls forceably remove an opList from the DAG. They are problematic bc they just |
| 132 | // remove the opList but don't cleanup any refering pointers (i.e., dependency pointers |
| 133 | // in the DAG). They work right now bc they are only called at flush time, after the |
| 134 | // topological sort is complete (so the dangling pointers aren't used). |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 135 | void removeRenderTask(int index); |
| 136 | void removeRenderTasks(int startIndex, int stopIndex); |
Robert Phillips | 22310d6 | 2018-09-05 11:07:21 -0400 | [diff] [blame] | 137 | |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 138 | bool empty() const { return fRenderTasks.empty(); } |
| 139 | int numRenderTasks() const { return fRenderTasks.count(); } |
Robert Phillips | 22310d6 | 2018-09-05 11:07:21 -0400 | [diff] [blame] | 140 | |
Robert Phillips | 9313aa7 | 2019-04-09 18:41:27 -0400 | [diff] [blame] | 141 | bool isUsed(GrSurfaceProxy*) const; |
| 142 | |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 143 | GrRenderTask* renderTask(int index) { return fRenderTasks[index].get(); } |
| 144 | const GrRenderTask* renderTask(int index) const { return fRenderTasks[index].get(); } |
Robert Phillips | 22310d6 | 2018-09-05 11:07:21 -0400 | [diff] [blame] | 145 | |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 146 | GrRenderTask* back() { return fRenderTasks.back().get(); } |
| 147 | const GrRenderTask* back() const { return fRenderTasks.back().get(); } |
Robert Phillips | 22310d6 | 2018-09-05 11:07:21 -0400 | [diff] [blame] | 148 | |
Chris Dalton | 3d77027 | 2019-08-14 09:24:37 -0600 | [diff] [blame] | 149 | GrRenderTask* add(sk_sp<GrRenderTask>); |
| 150 | GrRenderTask* addBeforeLast(sk_sp<GrRenderTask>); |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 151 | void add(const SkTArray<sk_sp<GrRenderTask>>&); |
Robert Phillips | 22310d6 | 2018-09-05 11:07:21 -0400 | [diff] [blame] | 152 | |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 153 | void swap(SkTArray<sk_sp<GrRenderTask>>* renderTasks); |
Robert Phillips | 22310d6 | 2018-09-05 11:07:21 -0400 | [diff] [blame] | 154 | |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 155 | bool sortingRenderTasks() const { return fSortRenderTasks; } |
Robert Phillips | 46acf9d | 2018-10-09 09:31:40 -0400 | [diff] [blame] | 156 | |
Robert Phillips | 22310d6 | 2018-09-05 11:07:21 -0400 | [diff] [blame] | 157 | private: |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 158 | SkTArray<sk_sp<GrRenderTask>> fRenderTasks; |
| 159 | bool fSortRenderTasks; |
Robert Phillips | 22310d6 | 2018-09-05 11:07:21 -0400 | [diff] [blame] | 160 | }; |
| 161 | |
Robert Phillips | 6989370 | 2019-02-22 11:16:30 -0500 | [diff] [blame] | 162 | GrDrawingManager(GrRecordingContext*, const GrPathRendererChain::Options&, |
Robert Phillips | 0d075de | 2019-03-04 11:08:13 -0500 | [diff] [blame] | 163 | const GrTextContext::Options&, |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 164 | bool sortRenderTasks, |
Robert Phillips | 6db27c2 | 2019-05-01 10:43:56 -0400 | [diff] [blame] | 165 | bool reduceOpListSplitting); |
robertphillips | 77a2e52 | 2015-10-17 07:43:27 -0700 | [diff] [blame] | 166 | |
Robert Phillips | a9162df | 2019-02-11 14:12:03 -0500 | [diff] [blame] | 167 | bool wasAbandoned() const; |
| 168 | |
robertphillips | 77a2e52 | 2015-10-17 07:43:27 -0700 | [diff] [blame] | 169 | void cleanup(); |
Robert Phillips | eafd48a | 2017-11-16 07:52:08 -0500 | [diff] [blame] | 170 | |
Chris Dalton | 5fe9977 | 2019-08-06 11:57:39 -0600 | [diff] [blame] | 171 | // Closes the target's dependent render tasks (or, if not in sorting/opList-splitting-reduction |
| 172 | // mode, closes fActiveOpList) in preparation for us opening a new opList that will write to |
| 173 | // 'target'. |
Greg Daniel | bbfec9d | 2019-08-20 10:56:51 -0400 | [diff] [blame] | 174 | void closeRenderTasksForNewRenderTask(GrSurfaceProxy* target); |
Chris Dalton | 5fe9977 | 2019-08-06 11:57:39 -0600 | [diff] [blame] | 175 | |
Robert Phillips | eafd48a | 2017-11-16 07:52:08 -0500 | [diff] [blame] | 176 | // return true if any opLists were actually executed; false otherwise |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 177 | bool executeRenderTasks(int startIndex, int stopIndex, GrOpFlushState*, |
| 178 | int* numRenderTasksExecuted); |
Robert Phillips | eafd48a | 2017-11-16 07:52:08 -0500 | [diff] [blame] | 179 | |
Brian Salomon | f9a1fdf | 2019-05-09 10:30:12 -0400 | [diff] [blame] | 180 | GrSemaphoresSubmitted flush(GrSurfaceProxy* proxies[], |
| 181 | int numProxies, |
Greg Daniel | bae7121 | 2019-03-01 15:24:35 -0500 | [diff] [blame] | 182 | SkSurface::BackendSurfaceAccess access, |
Greg Daniel | 797efca | 2019-05-09 14:04:20 -0400 | [diff] [blame] | 183 | const GrFlushInfo&, |
| 184 | const GrPrepareForExternalIORequests&); |
robertphillips | 77a2e52 | 2015-10-17 07:43:27 -0700 | [diff] [blame] | 185 | |
Robert Phillips | 38d64b0 | 2018-09-04 13:23:26 -0400 | [diff] [blame] | 186 | SkDEBUGCODE(void validate() const); |
| 187 | |
Robert Phillips | 6989370 | 2019-02-22 11:16:30 -0500 | [diff] [blame] | 188 | friend class GrContext; // access to: flush & cleanup |
Robert Phillips | 7ee385e | 2017-03-30 08:02:11 -0400 | [diff] [blame] | 189 | friend class GrContextPriv; // access to: flush |
Chris Dalton | fe199b7 | 2017-05-05 11:26:15 -0400 | [diff] [blame] | 190 | friend class GrOnFlushResourceProvider; // this is just a shallow wrapper around this class |
Robert Phillips | 6989370 | 2019-02-22 11:16:30 -0500 | [diff] [blame] | 191 | friend class GrRecordingContext; // access to: ctor |
Greg Daniel | b6c15ba | 2019-03-04 13:08:25 -0500 | [diff] [blame] | 192 | friend class SkImage; // for access to: flush |
robertphillips | 77a2e52 | 2015-10-17 07:43:27 -0700 | [diff] [blame] | 193 | |
| 194 | static const int kNumPixelGeometries = 5; // The different pixel geometries |
| 195 | static const int kNumDFTOptions = 2; // DFT or no DFT |
| 196 | |
Robert Phillips | 6989370 | 2019-02-22 11:16:30 -0500 | [diff] [blame] | 197 | GrRecordingContext* fContext; |
bsalomon | 6b2552f | 2016-09-15 13:50:26 -0700 | [diff] [blame] | 198 | GrPathRendererChain::Options fOptionsForPathRendererChain; |
Herb Derby | 26cbe51 | 2018-05-24 14:39:01 -0400 | [diff] [blame] | 199 | GrTextContext::Options fOptionsForTextContext; |
Brian Salomon | 601ac80 | 2019-02-07 13:37:16 -0500 | [diff] [blame] | 200 | // This cache is used by both the vertex and index pools. It reuses memory across multiple |
| 201 | // flushes. |
| 202 | sk_sp<GrBufferAllocPool::CpuBufferCache> fCpuBufferCache; |
joshualitt | de8dc7e | 2016-01-08 10:09:13 -0800 | [diff] [blame] | 203 | |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 204 | RenderTaskDAG fDAG; |
Robert Phillips | 38d64b0 | 2018-09-04 13:23:26 -0400 | [diff] [blame] | 205 | GrOpList* fActiveOpList = nullptr; |
Chris Dalton | 3968ff9 | 2017-11-27 12:26:31 -0700 | [diff] [blame] | 206 | // These are the IDs of the opLists currently being flushed (in internalFlush) |
Chris Dalton | 6b49810 | 2019-08-01 14:14:52 -0600 | [diff] [blame] | 207 | SkSTArray<8, uint32_t, true> fFlushingRenderTaskIDs; |
Chris Dalton | 3968ff9 | 2017-11-27 12:26:31 -0700 | [diff] [blame] | 208 | // These are the new opLists generated by the onFlush CBs |
| 209 | SkSTArray<8, sk_sp<GrOpList>> fOnFlushCBOpLists; |
robertphillips | 77a2e52 | 2015-10-17 07:43:27 -0700 | [diff] [blame] | 210 | |
Herb Derby | 26cbe51 | 2018-05-24 14:39:01 -0400 | [diff] [blame] | 211 | std::unique_ptr<GrTextContext> fTextContext; |
robertphillips | a13e202 | 2015-11-11 12:01:09 -0800 | [diff] [blame] | 212 | |
Ben Wagner | 9ec70c6 | 2018-07-12 13:30:47 -0400 | [diff] [blame] | 213 | std::unique_ptr<GrPathRendererChain> fPathRendererChain; |
| 214 | sk_sp<GrSoftwarePathRenderer> fSoftwarePathRenderer; |
brianosman | 86e7626 | 2016-08-11 12:17:31 -0700 | [diff] [blame] | 215 | |
Robert Phillips | 40a29d7 | 2018-01-18 12:59:22 -0500 | [diff] [blame] | 216 | GrTokenTracker fTokenTracker; |
brianosman | 86e7626 | 2016-08-11 12:17:31 -0700 | [diff] [blame] | 217 | bool fFlushing; |
Robert Phillips | 46acf9d | 2018-10-09 09:31:40 -0400 | [diff] [blame] | 218 | bool fReduceOpListSplitting; |
bsalomon | b77a907 | 2016-09-07 10:02:04 -0700 | [diff] [blame] | 219 | |
Chris Dalton | fe199b7 | 2017-05-05 11:26:15 -0400 | [diff] [blame] | 220 | SkTArray<GrOnFlushCallbackObject*> fOnFlushCBObjects; |
Robert Phillips | 15c9142 | 2019-05-07 16:54:48 -0400 | [diff] [blame] | 221 | |
| 222 | void addDDLTarget(GrSurfaceProxy* proxy) { fDDLTargets.insert(proxy); } |
| 223 | bool isDDLTarget(GrSurfaceProxy* proxy) { return fDDLTargets.find(proxy) != fDDLTargets.end(); } |
| 224 | void clearDDLTargets() { fDDLTargets.clear(); } |
| 225 | |
| 226 | // We play a trick with lazy proxies to retarget the base target of a DDL to the SkSurface |
| 227 | // it is replayed on. Because of this remapping we need to explicitly store the targets of |
| 228 | // DDL replaying. |
| 229 | // Note: we do not expect a whole lot of these per flush |
| 230 | std::set<GrSurfaceProxy*> fDDLTargets; |
robertphillips | 77a2e52 | 2015-10-17 07:43:27 -0700 | [diff] [blame] | 231 | }; |
| 232 | |
| 233 | #endif |