robertphillips@google.com | 1e945b7 | 2012-04-16 18:03:03 +0000 | [diff] [blame] | 1 | /* |
csmartdalton | c6f411e | 2016-08-05 22:32:12 -0700 | [diff] [blame] | 2 | * Copyright 2016 Google Inc. |
robertphillips@google.com | 1e945b7 | 2012-04-16 18:03:03 +0000 | [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 | |
csmartdalton | c6f411e | 2016-08-05 22:32:12 -0700 | [diff] [blame] | 8 | #include "GrClipStackClip.h" |
csmartdalton | 28341fa | 2016-08-17 10:00:21 -0700 | [diff] [blame] | 9 | #include "GrAppliedClip.h" |
csmartdalton | bde96c6 | 2016-08-31 12:54:46 -0700 | [diff] [blame] | 10 | #include "GrContextPriv.h" |
Brian Osman | 099fa0f | 2017-10-02 16:38:32 -0400 | [diff] [blame] | 11 | #include "GrDeferredProxyUploader.h" |
robertphillips | 6873782 | 2015-10-29 12:12:21 -0700 | [diff] [blame] | 12 | #include "GrDrawingManager.h" |
csmartdalton | 02fa32c | 2016-08-19 13:29:27 -0700 | [diff] [blame] | 13 | #include "GrFixedClip.h" |
bsalomon | 473addf | 2015-10-02 07:49:05 -0700 | [diff] [blame] | 14 | #include "GrGpuResourcePriv.h" |
Hal Canary | fdcfb8b | 2018-06-13 09:42:32 -0400 | [diff] [blame] | 15 | #include "GrProxyProvider.h" |
Hal Canary | c640d0d | 2018-06-13 09:59:02 -0400 | [diff] [blame] | 16 | #include "GrRenderTargetContextPriv.h" |
Hal Canary | fdcfb8b | 2018-06-13 09:42:32 -0400 | [diff] [blame] | 17 | #include "GrSWMaskHelper.h" |
Brian Salomon | 653f42f | 2018-07-10 10:07:31 -0400 | [diff] [blame] | 18 | #include "GrShape.h" |
Hal Canary | c640d0d | 2018-06-13 09:59:02 -0400 | [diff] [blame] | 19 | #include "GrStencilAttachment.h" |
Brian Salomon | 653f42f | 2018-07-10 10:07:31 -0400 | [diff] [blame] | 20 | #include "GrStyle.h" |
Robert Phillips | e305cc1f | 2016-12-14 12:19:05 -0500 | [diff] [blame] | 21 | #include "GrTextureProxy.h" |
Hal Canary | fdcfb8b | 2018-06-13 09:42:32 -0400 | [diff] [blame] | 22 | #include "SkClipOpPriv.h" |
| 23 | #include "SkMakeUnique.h" |
| 24 | #include "SkTaskGroup.h" |
Hal Canary | c640d0d | 2018-06-13 09:59:02 -0400 | [diff] [blame] | 25 | #include "SkTo.h" |
Hal Canary | fdcfb8b | 2018-06-13 09:42:32 -0400 | [diff] [blame] | 26 | #include "SkTraceEvent.h" |
Hal Canary | c640d0d | 2018-06-13 09:59:02 -0400 | [diff] [blame] | 27 | #include "effects/GrConvexPolyEffect.h" |
| 28 | #include "effects/GrRRectEffect.h" |
| 29 | #include "effects/GrTextureDomain.h" |
bsalomon@google.com | c6b3e48 | 2012-12-07 20:43:52 +0000 | [diff] [blame] | 30 | |
Brian Salomon | c3833b4 | 2018-07-09 18:23:58 +0000 | [diff] [blame] | 31 | typedef SkClipStack::Element Element; |
| 32 | typedef GrReducedClip::InitialState InitialState; |
| 33 | typedef GrReducedClip::ElementList ElementList; |
| 34 | |
| 35 | const char GrClipStackClip::kMaskTestTag[] = "clip_mask"; |
robertphillips | 976f5f0 | 2016-06-03 10:59:20 -0700 | [diff] [blame] | 36 | |
csmartdalton | c6f411e | 2016-08-05 22:32:12 -0700 | [diff] [blame] | 37 | bool GrClipStackClip::quickContains(const SkRect& rect) const { |
reed | 4d2cce4 | 2016-08-22 13:03:47 -0700 | [diff] [blame] | 38 | if (!fStack || fStack->isWideOpen()) { |
csmartdalton | c6f411e | 2016-08-05 22:32:12 -0700 | [diff] [blame] | 39 | return true; |
| 40 | } |
Brian Salomon | 9a76772 | 2017-03-13 17:57:28 -0400 | [diff] [blame] | 41 | return fStack->quickContains(rect); |
csmartdalton | c6f411e | 2016-08-05 22:32:12 -0700 | [diff] [blame] | 42 | } |
| 43 | |
bsalomon | 7f0d9f3 | 2016-08-15 14:49:10 -0700 | [diff] [blame] | 44 | bool GrClipStackClip::quickContains(const SkRRect& rrect) const { |
reed | 4d2cce4 | 2016-08-22 13:03:47 -0700 | [diff] [blame] | 45 | if (!fStack || fStack->isWideOpen()) { |
bsalomon | 7f0d9f3 | 2016-08-15 14:49:10 -0700 | [diff] [blame] | 46 | return true; |
| 47 | } |
Brian Salomon | 9a76772 | 2017-03-13 17:57:28 -0400 | [diff] [blame] | 48 | return fStack->quickContains(rrect); |
bsalomon | 7f0d9f3 | 2016-08-15 14:49:10 -0700 | [diff] [blame] | 49 | } |
| 50 | |
Brian Salomon | 0e8fc8b | 2016-12-09 15:10:07 -0500 | [diff] [blame] | 51 | bool GrClipStackClip::isRRect(const SkRect& origRTBounds, SkRRect* rr, GrAA* aa) const { |
bsalomon | cb31e51 | 2016-08-26 10:48:19 -0700 | [diff] [blame] | 52 | if (!fStack) { |
| 53 | return false; |
| 54 | } |
| 55 | const SkRect* rtBounds = &origRTBounds; |
Brian Salomon | 0e8fc8b | 2016-12-09 15:10:07 -0500 | [diff] [blame] | 56 | bool isAA; |
| 57 | if (fStack->isRRect(*rtBounds, rr, &isAA)) { |
Chris Dalton | 3b51df1 | 2017-11-27 14:33:06 -0700 | [diff] [blame] | 58 | *aa = GrAA(isAA); |
bsalomon | cb31e51 | 2016-08-26 10:48:19 -0700 | [diff] [blame] | 59 | return true; |
| 60 | } |
| 61 | return false; |
| 62 | } |
| 63 | |
csmartdalton | c6f411e | 2016-08-05 22:32:12 -0700 | [diff] [blame] | 64 | void GrClipStackClip::getConservativeBounds(int width, int height, SkIRect* devResult, |
| 65 | bool* isIntersectionOfRects) const { |
| 66 | if (!fStack) { |
| 67 | devResult->setXYWH(0, 0, width, height); |
| 68 | if (isIntersectionOfRects) { |
| 69 | *isIntersectionOfRects = true; |
| 70 | } |
| 71 | return; |
| 72 | } |
| 73 | SkRect devBounds; |
Brian Salomon | 9a76772 | 2017-03-13 17:57:28 -0400 | [diff] [blame] | 74 | fStack->getConservativeBounds(0, 0, width, height, &devBounds, isIntersectionOfRects); |
csmartdalton | c6f411e | 2016-08-05 22:32:12 -0700 | [diff] [blame] | 75 | devBounds.roundOut(devResult); |
| 76 | } |
| 77 | |
Chris Dalton | c534808 | 2018-03-30 15:59:38 +0000 | [diff] [blame] | 78 | //////////////////////////////////////////////////////////////////////////////// |
| 79 | // set up the draw state to enable the aa clipping mask. |
| 80 | static std::unique_ptr<GrFragmentProcessor> create_fp_for_mask(sk_sp<GrTextureProxy> mask, |
| 81 | const SkIRect& devBound) { |
| 82 | SkIRect domainTexels = SkIRect::MakeWH(devBound.width(), devBound.height()); |
| 83 | return GrDeviceSpaceTextureDecalFragmentProcessor::Make(std::move(mask), domainTexels, |
| 84 | {devBound.fLeft, devBound.fTop}); |
| 85 | } |
| 86 | |
| 87 | // Does the path in 'element' require SW rendering? If so, return true (and, |
| 88 | // optionally, set 'prOut' to NULL. If not, return false (and, optionally, set |
| 89 | // 'prOut' to the non-SW path renderer that will do the job). |
| 90 | bool GrClipStackClip::PathNeedsSWRenderer(GrContext* context, |
| 91 | const SkIRect& scissorRect, |
| 92 | bool hasUserStencilSettings, |
| 93 | const GrRenderTargetContext* renderTargetContext, |
| 94 | const SkMatrix& viewMatrix, |
Brian Salomon | c3833b4 | 2018-07-09 18:23:58 +0000 | [diff] [blame] | 95 | const Element* element, |
Chris Dalton | c534808 | 2018-03-30 15:59:38 +0000 | [diff] [blame] | 96 | GrPathRenderer** prOut, |
| 97 | bool needsStencil) { |
Brian Salomon | c3833b4 | 2018-07-09 18:23:58 +0000 | [diff] [blame] | 98 | if (Element::DeviceSpaceType::kRect == element->getDeviceSpaceType()) { |
Chris Dalton | c534808 | 2018-03-30 15:59:38 +0000 | [diff] [blame] | 99 | // rects can always be drawn directly w/o using the software path |
| 100 | // TODO: skip rrects once we're drawing them directly. |
| 101 | if (prOut) { |
| 102 | *prOut = nullptr; |
| 103 | } |
| 104 | return false; |
| 105 | } else { |
| 106 | // We shouldn't get here with an empty clip element. |
Brian Salomon | c3833b4 | 2018-07-09 18:23:58 +0000 | [diff] [blame] | 107 | SkASSERT(Element::DeviceSpaceType::kEmpty != element->getDeviceSpaceType()); |
Chris Dalton | c534808 | 2018-03-30 15:59:38 +0000 | [diff] [blame] | 108 | |
| 109 | // the gpu alpha mask will draw the inverse paths as non-inverse to a temp buffer |
| 110 | SkPath path; |
Brian Salomon | c3833b4 | 2018-07-09 18:23:58 +0000 | [diff] [blame] | 111 | element->asDeviceSpacePath(&path); |
Chris Dalton | c534808 | 2018-03-30 15:59:38 +0000 | [diff] [blame] | 112 | if (path.isInverseFillType()) { |
| 113 | path.toggleInverseFillType(); |
| 114 | } |
| 115 | |
| 116 | GrPathRendererChain::DrawType type = |
| 117 | needsStencil ? GrPathRendererChain::DrawType::kStencilAndColor |
| 118 | : GrPathRendererChain::DrawType::kColor; |
| 119 | |
| 120 | GrShape shape(path, GrStyle::SimpleFill()); |
| 121 | GrPathRenderer::CanDrawPathArgs canDrawArgs; |
Brian Salomon | c7fe0f7 | 2018-05-11 10:14:21 -0400 | [diff] [blame] | 122 | canDrawArgs.fCaps = context->contextPriv().caps(); |
Chris Dalton | c534808 | 2018-03-30 15:59:38 +0000 | [diff] [blame] | 123 | canDrawArgs.fClipConservativeBounds = &scissorRect; |
| 124 | canDrawArgs.fViewMatrix = &viewMatrix; |
| 125 | canDrawArgs.fShape = &shape; |
Brian Salomon | c3833b4 | 2018-07-09 18:23:58 +0000 | [diff] [blame] | 126 | canDrawArgs.fAAType = GrChooseAAType(GrAA(element->isAA()), |
Chris Dalton | c534808 | 2018-03-30 15:59:38 +0000 | [diff] [blame] | 127 | renderTargetContext->fsaaType(), |
| 128 | GrAllowMixedSamples::kYes, |
Brian Salomon | c7fe0f7 | 2018-05-11 10:14:21 -0400 | [diff] [blame] | 129 | *context->contextPriv().caps()); |
Chris Dalton | c534808 | 2018-03-30 15:59:38 +0000 | [diff] [blame] | 130 | canDrawArgs.fHasUserStencilSettings = hasUserStencilSettings; |
| 131 | |
| 132 | // the 'false' parameter disallows use of the SW path renderer |
| 133 | GrPathRenderer* pr = |
| 134 | context->contextPriv().drawingManager()->getPathRenderer(canDrawArgs, false, type); |
| 135 | if (prOut) { |
| 136 | *prOut = pr; |
| 137 | } |
| 138 | return SkToBool(!pr); |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | /* |
| 143 | * This method traverses the clip stack to see if the GrSoftwarePathRenderer |
| 144 | * will be used on any element. If so, it returns true to indicate that the |
| 145 | * entire clip should be rendered in SW and then uploaded en masse to the gpu. |
| 146 | */ |
| 147 | bool GrClipStackClip::UseSWOnlyPath(GrContext* context, |
| 148 | bool hasUserStencilSettings, |
| 149 | const GrRenderTargetContext* renderTargetContext, |
| 150 | const GrReducedClip& reducedClip) { |
Chris Dalton | d22a023 | 2018-08-22 17:25:10 +0000 | [diff] [blame] | 151 | // TODO: right now it appears that GPU clip masks are strictly slower than software. We may |
| 152 | // want to revisit this assumption once we can test with render target sorting. |
| 153 | return true; |
| 154 | |
Chris Dalton | c534808 | 2018-03-30 15:59:38 +0000 | [diff] [blame] | 155 | // TODO: generalize this function so that when |
| 156 | // a clip gets complex enough it can just be done in SW regardless |
| 157 | // of whether it would invoke the GrSoftwarePathRenderer. |
| 158 | |
| 159 | // If we're avoiding stencils, always use SW: |
Brian Salomon | c7fe0f7 | 2018-05-11 10:14:21 -0400 | [diff] [blame] | 160 | if (context->contextPriv().caps()->avoidStencilBuffers()) { |
Chris Dalton | c534808 | 2018-03-30 15:59:38 +0000 | [diff] [blame] | 161 | return true; |
Brian Salomon | c7fe0f7 | 2018-05-11 10:14:21 -0400 | [diff] [blame] | 162 | } |
Chris Dalton | c534808 | 2018-03-30 15:59:38 +0000 | [diff] [blame] | 163 | |
| 164 | // Set the matrix so that rendered clip elements are transformed to mask space from clip |
| 165 | // space. |
| 166 | SkMatrix translate; |
| 167 | translate.setTranslate(SkIntToScalar(-reducedClip.left()), SkIntToScalar(-reducedClip.top())); |
| 168 | |
| 169 | for (ElementList::Iter iter(reducedClip.maskElements()); iter.get(); iter.next()) { |
Brian Salomon | c3833b4 | 2018-07-09 18:23:58 +0000 | [diff] [blame] | 170 | const Element* element = iter.get(); |
Chris Dalton | c534808 | 2018-03-30 15:59:38 +0000 | [diff] [blame] | 171 | |
Brian Salomon | c3833b4 | 2018-07-09 18:23:58 +0000 | [diff] [blame] | 172 | SkClipOp op = element->getOp(); |
| 173 | bool invert = element->isInverseFilled(); |
Chris Dalton | c534808 | 2018-03-30 15:59:38 +0000 | [diff] [blame] | 174 | bool needsStencil = invert || |
| 175 | kIntersect_SkClipOp == op || kReverseDifference_SkClipOp == op; |
| 176 | |
| 177 | if (PathNeedsSWRenderer(context, reducedClip.scissor(), hasUserStencilSettings, |
| 178 | renderTargetContext, translate, element, nullptr, needsStencil)) { |
| 179 | return true; |
| 180 | } |
| 181 | } |
| 182 | return false; |
| 183 | } |
| 184 | |
| 185 | //////////////////////////////////////////////////////////////////////////////// |
| 186 | // sort out what kind of clip mask needs to be created: alpha, stencil, |
| 187 | // scissor, or entirely software |
Brian Osman | 1105224 | 2016-10-27 14:47:55 -0400 | [diff] [blame] | 188 | bool GrClipStackClip::apply(GrContext* context, GrRenderTargetContext* renderTargetContext, |
Brian Salomon | 97180af | 2017-03-14 13:42:58 -0400 | [diff] [blame] | 189 | bool useHWAA, bool hasUserStencilSettings, GrAppliedClip* out, |
| 190 | SkRect* bounds) const { |
Brian Salomon | 97180af | 2017-03-14 13:42:58 -0400 | [diff] [blame] | 191 | SkRect devBounds = SkRect::MakeIWH(renderTargetContext->width(), renderTargetContext->height()); |
| 192 | if (!devBounds.intersect(*bounds)) { |
csmartdalton | cbecb08 | 2016-07-22 08:59:08 -0700 | [diff] [blame] | 193 | return false; |
| 194 | } |
| 195 | |
Brian Salomon | 510dd42 | 2017-03-16 12:15:22 -0400 | [diff] [blame] | 196 | if (!fStack || fStack->isWideOpen()) { |
| 197 | return true; |
| 198 | } |
| 199 | |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 200 | int maxWindowRectangles = renderTargetContext->priv().maxWindowRectangles(); |
Brian Salomon | c7fe0f7 | 2018-05-11 10:14:21 -0400 | [diff] [blame] | 201 | int maxAnalyticFPs = context->contextPriv().caps()->maxClipAnalyticFPs(); |
Chris Dalton | 584a79a | 2017-11-15 13:14:01 -0700 | [diff] [blame] | 202 | if (GrFSAAType::kNone != renderTargetContext->fsaaType()) { |
| 203 | // With mixed samples (non-msaa color buffer), any coverage info is lost from color once it |
| 204 | // hits the color buffer anyway, so we may as well use coverage AA if nothing else in the |
| 205 | // pipe is multisampled. |
Brian Salomon | bdecacf | 2018-02-02 20:32:49 -0500 | [diff] [blame] | 206 | if (renderTargetContext->numColorSamples() > 1 || useHWAA || hasUserStencilSettings) { |
Chris Dalton | 584a79a | 2017-11-15 13:14:01 -0700 | [diff] [blame] | 207 | maxAnalyticFPs = 0; |
| 208 | } |
Brian Salomon | c7fe0f7 | 2018-05-11 10:14:21 -0400 | [diff] [blame] | 209 | // We disable MSAA when avoiding stencil. |
| 210 | SkASSERT(!context->contextPriv().caps()->avoidStencilBuffers()); |
Chris Dalton | 584a79a | 2017-11-15 13:14:01 -0700 | [diff] [blame] | 211 | } |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 212 | auto* ccpr = context->contextPriv().drawingManager()->getCoverageCountingPathRenderer(); |
Chris Dalton | 584a79a | 2017-11-15 13:14:01 -0700 | [diff] [blame] | 213 | |
Chris Dalton | 4c458b1 | 2018-06-16 17:22:59 -0600 | [diff] [blame] | 214 | GrReducedClip reducedClip(*fStack, devBounds, context->contextPriv().caps(), |
| 215 | maxWindowRectangles, maxAnalyticFPs, ccpr ? maxAnalyticFPs : 0); |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 216 | if (InitialState::kAllOut == reducedClip.initialState() && |
| 217 | reducedClip.maskElements().isEmpty()) { |
| 218 | return false; |
| 219 | } |
bsalomon@google.com | 4c2443e | 2012-12-06 20:58:57 +0000 | [diff] [blame] | 220 | |
Chris Dalton | 7947193 | 2017-10-27 01:50:57 -0600 | [diff] [blame] | 221 | if (reducedClip.hasScissor() && !GrClip::IsInsideClip(reducedClip.scissor(), devBounds)) { |
Chris Dalton | bbfd516 | 2017-11-07 13:35:22 -0700 | [diff] [blame] | 222 | out->hardClip().addScissor(reducedClip.scissor(), bounds); |
cdalton | 846c051 | 2016-05-13 10:25:00 -0700 | [diff] [blame] | 223 | } |
cdalton | 93a379b | 2016-05-11 13:58:08 -0700 | [diff] [blame] | 224 | |
csmartdalton | bf4a8f9 | 2016-09-06 10:01:06 -0700 | [diff] [blame] | 225 | if (!reducedClip.windowRectangles().empty()) { |
Chris Dalton | bbfd516 | 2017-11-07 13:35:22 -0700 | [diff] [blame] | 226 | out->hardClip().addWindowRectangles(reducedClip.windowRectangles(), |
| 227 | GrWindowRectsState::Mode::kExclusive); |
csmartdalton | bf4a8f9 | 2016-09-06 10:01:06 -0700 | [diff] [blame] | 228 | } |
| 229 | |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 230 | if (!reducedClip.maskElements().isEmpty()) { |
| 231 | if (!this->applyClipMask(context, renderTargetContext, reducedClip, hasUserStencilSettings, |
| 232 | out)) { |
| 233 | return false; |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | // The opList ID must not be looked up until AFTER producing the clip mask (if any). That step |
| 238 | // can cause a flush or otherwise change which opList our draw is going into. |
| 239 | uint32_t opListID = renderTargetContext->getOpList()->uniqueID(); |
| 240 | int rtWidth = renderTargetContext->width(), rtHeight = renderTargetContext->height(); |
Chris Dalton | 4c458b1 | 2018-06-16 17:22:59 -0600 | [diff] [blame] | 241 | if (auto clipFPs = reducedClip.finishAndDetachAnalyticFPs(ccpr, opListID, rtWidth, rtHeight)) { |
Chris Dalton | 584a79a | 2017-11-15 13:14:01 -0700 | [diff] [blame] | 242 | out->addCoverageFP(std::move(clipFPs)); |
| 243 | } |
| 244 | |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 245 | return true; |
| 246 | } |
csmartdalton | d211e78 | 2016-08-15 11:17:19 -0700 | [diff] [blame] | 247 | |
Chris Dalton | a32a3c3 | 2017-12-05 10:05:21 -0700 | [diff] [blame] | 248 | bool GrClipStackClip::applyClipMask(GrContext* context, GrRenderTargetContext* renderTargetContext, |
| 249 | const GrReducedClip& reducedClip, bool hasUserStencilSettings, |
| 250 | GrAppliedClip* out) const { |
csmartdalton | 3affdc1 | 2016-10-28 12:01:10 -0700 | [diff] [blame] | 251 | #ifdef SK_DEBUG |
Chris Dalton | 7947193 | 2017-10-27 01:50:57 -0600 | [diff] [blame] | 252 | SkASSERT(reducedClip.hasScissor()); |
Robert Phillips | 784b7bf | 2016-12-09 13:35:02 -0500 | [diff] [blame] | 253 | SkIRect rtIBounds = SkIRect::MakeWH(renderTargetContext->width(), |
| 254 | renderTargetContext->height()); |
Chris Dalton | 7947193 | 2017-10-27 01:50:57 -0600 | [diff] [blame] | 255 | const SkIRect& scissor = reducedClip.scissor(); |
| 256 | SkASSERT(rtIBounds.contains(scissor)); // Mask shouldn't be larger than the RT. |
csmartdalton | 3affdc1 | 2016-10-28 12:01:10 -0700 | [diff] [blame] | 257 | #endif |
csmartdalton | d211e78 | 2016-08-15 11:17:19 -0700 | [diff] [blame] | 258 | |
cdalton | ede7574 | 2015-11-11 15:27:57 -0800 | [diff] [blame] | 259 | // If the stencil buffer is multisampled we can use it to do everything. |
Chris Dalton | 7947193 | 2017-10-27 01:50:57 -0600 | [diff] [blame] | 260 | if ((GrFSAAType::kNone == renderTargetContext->fsaaType() && reducedClip.maskRequiresAA()) || |
Brian Salomon | c7fe0f7 | 2018-05-11 10:14:21 -0400 | [diff] [blame] | 261 | context->contextPriv().caps()->avoidStencilBuffers()) { |
Chris Dalton | c534808 | 2018-03-30 15:59:38 +0000 | [diff] [blame] | 262 | sk_sp<GrTextureProxy> result; |
| 263 | if (UseSWOnlyPath(context, hasUserStencilSettings, renderTargetContext, reducedClip)) { |
| 264 | // The clip geometry is complex enough that it will be more efficient to create it |
| 265 | // entirely in software |
| 266 | result = this->createSoftwareClipMask(context, reducedClip, renderTargetContext); |
| 267 | } else { |
| 268 | result = this->createAlphaClipMask(context, reducedClip); |
| 269 | } |
| 270 | |
| 271 | if (result) { |
| 272 | // The mask's top left coord should be pinned to the rounded-out top left corner of |
| 273 | // the clip's device space bounds. |
| 274 | out->addCoverageFP(create_fp_for_mask(std::move(result), reducedClip.scissor())); |
robertphillips@google.com | f294b77 | 2012-04-27 14:29:26 +0000 | [diff] [blame] | 275 | return true; |
| 276 | } |
Eric Karl | 5c77975 | 2017-05-08 12:02:07 -0700 | [diff] [blame] | 277 | |
Chris Dalton | c534808 | 2018-03-30 15:59:38 +0000 | [diff] [blame] | 278 | // If alpha or software clip mask creation fails, fall through to the stencil code paths, |
| 279 | // unless stencils are disallowed. |
Brian Salomon | c7fe0f7 | 2018-05-11 10:14:21 -0400 | [diff] [blame] | 280 | if (context->contextPriv().caps()->avoidStencilBuffers()) { |
Chris Dalton | 584a79a | 2017-11-15 13:14:01 -0700 | [diff] [blame] | 281 | SkDebugf("WARNING: Clip mask requires stencil, but stencil unavailable. " |
| 282 | "Clip will be ignored.\n"); |
Eric Karl | 5c77975 | 2017-05-08 12:02:07 -0700 | [diff] [blame] | 283 | return false; |
| 284 | } |
robertphillips@google.com | f294b77 | 2012-04-27 14:29:26 +0000 | [diff] [blame] | 285 | } |
robertphillips@google.com | f294b77 | 2012-04-27 14:29:26 +0000 | [diff] [blame] | 286 | |
Robert Phillips | 6504813 | 2017-08-10 08:44:49 -0400 | [diff] [blame] | 287 | renderTargetContext->setNeedsStencil(); |
csmartdalton | bde96c6 | 2016-08-31 12:54:46 -0700 | [diff] [blame] | 288 | |
Brian Salomon | c3833b4 | 2018-07-09 18:23:58 +0000 | [diff] [blame] | 289 | // This relies on the property that a reduced sub-rect of the last clip will contain all the |
| 290 | // relevant window rectangles that were in the last clip. This subtle requirement will go away |
| 291 | // after clipping is overhauled. |
| 292 | if (renderTargetContext->priv().mustRenderClip(reducedClip.maskGenID(), reducedClip.scissor(), |
| 293 | reducedClip.numAnalyticFPs())) { |
Brian Salomon | 9a76772 | 2017-03-13 17:57:28 -0400 | [diff] [blame] | 294 | reducedClip.drawStencilClipMask(context, renderTargetContext); |
Brian Salomon | c3833b4 | 2018-07-09 18:23:58 +0000 | [diff] [blame] | 295 | renderTargetContext->priv().setLastClip(reducedClip.maskGenID(), reducedClip.scissor(), |
| 296 | reducedClip.numAnalyticFPs()); |
csmartdalton | bde96c6 | 2016-08-31 12:54:46 -0700 | [diff] [blame] | 297 | } |
Brian Salomon | c3833b4 | 2018-07-09 18:23:58 +0000 | [diff] [blame] | 298 | // GrAppliedClip doesn't need to figure numAnalyticFPs into its key (used by operator==) because |
| 299 | // it verifies the FPs are also equal. |
| 300 | out->hardClip().addStencilClip(reducedClip.maskGenID()); |
robertphillips@google.com | 1e945b7 | 2012-04-16 18:03:03 +0000 | [diff] [blame] | 301 | return true; |
| 302 | } |
| 303 | |
robertphillips@google.com | 6b70a7b | 2012-05-11 15:32:48 +0000 | [diff] [blame] | 304 | //////////////////////////////////////////////////////////////////////////////// |
bsalomon | 473addf | 2015-10-02 07:49:05 -0700 | [diff] [blame] | 305 | // Create a 8-bit clip mask in alpha |
| 306 | |
Brian Salomon | c3833b4 | 2018-07-09 18:23:58 +0000 | [diff] [blame] | 307 | static void create_clip_mask_key(uint32_t clipGenID, const SkIRect& bounds, int numAnalyticFPs, |
| 308 | GrUniqueKey* key) { |
| 309 | static const GrUniqueKey::Domain kDomain = GrUniqueKey::GenerateDomain(); |
| 310 | GrUniqueKey::Builder builder(key, kDomain, 4, GrClipStackClip::kMaskTestTag); |
| 311 | builder[0] = clipGenID; |
| 312 | // SkToS16 because image filters outset layers to a size indicated by the filter, which can |
| 313 | // sometimes result in negative coordinates from device space. |
| 314 | builder[1] = SkToS16(bounds.fLeft) | (SkToS16(bounds.fRight) << 16); |
| 315 | builder[2] = SkToS16(bounds.fTop) | (SkToS16(bounds.fBottom) << 16); |
| 316 | builder[3] = numAnalyticFPs; |
| 317 | } |
| 318 | |
Robert Phillips | 806be2d | 2017-06-28 15:23:59 -0400 | [diff] [blame] | 319 | static void add_invalidate_on_pop_message(const SkClipStack& stack, uint32_t clipGenID, |
Brian Salomon | 238069b | 2018-07-11 15:58:57 -0400 | [diff] [blame] | 320 | const GrUniqueKey& clipMaskKey, |
| 321 | uint32_t contextUniqueID) { |
Brian Salomon | 19f0ed5 | 2017-01-06 13:54:58 -0500 | [diff] [blame] | 322 | SkClipStack::Iter iter(stack, SkClipStack::Iter::kTop_IterStart); |
| 323 | while (const Element* element = iter.prev()) { |
| 324 | if (element->getGenID() == clipGenID) { |
| 325 | std::unique_ptr<GrUniqueKeyInvalidatedMessage> msg( |
Brian Salomon | 238069b | 2018-07-11 15:58:57 -0400 | [diff] [blame] | 326 | new GrUniqueKeyInvalidatedMessage(clipMaskKey, contextUniqueID)); |
Brian Salomon | 19f0ed5 | 2017-01-06 13:54:58 -0500 | [diff] [blame] | 327 | element->addResourceInvalidationMessage(std::move(msg)); |
| 328 | return; |
| 329 | } |
| 330 | } |
| 331 | SkDEBUGFAIL("Gen ID was not found in stack."); |
| 332 | } |
| 333 | |
Chris Dalton | c534808 | 2018-03-30 15:59:38 +0000 | [diff] [blame] | 334 | sk_sp<GrTextureProxy> GrClipStackClip::createAlphaClipMask(GrContext* context, |
| 335 | const GrReducedClip& reducedClip) const { |
| 336 | GrProxyProvider* proxyProvider = context->contextPriv().proxyProvider(); |
Brian Salomon | c3833b4 | 2018-07-09 18:23:58 +0000 | [diff] [blame] | 337 | GrUniqueKey key; |
| 338 | create_clip_mask_key(reducedClip.maskGenID(), reducedClip.scissor(), |
| 339 | reducedClip.numAnalyticFPs(), &key); |
| 340 | |
Chris Dalton | c534808 | 2018-03-30 15:59:38 +0000 | [diff] [blame] | 341 | sk_sp<GrTextureProxy> proxy(proxyProvider->findOrCreateProxyByUniqueKey( |
Robert Phillips | 5491e82 | 2018-06-27 12:54:44 -0400 | [diff] [blame] | 342 | key, kTopLeft_GrSurfaceOrigin)); |
Chris Dalton | c534808 | 2018-03-30 15:59:38 +0000 | [diff] [blame] | 343 | if (proxy) { |
| 344 | return proxy; |
| 345 | } |
| 346 | |
| 347 | sk_sp<GrRenderTargetContext> rtc( |
Robert Phillips | 5491e82 | 2018-06-27 12:54:44 -0400 | [diff] [blame] | 348 | context->contextPriv().makeDeferredRenderTargetContextWithFallback( |
| 349 | SkBackingFit::kApprox, |
| 350 | reducedClip.width(), |
| 351 | reducedClip.height(), |
| 352 | kAlpha_8_GrPixelConfig, |
| 353 | nullptr, 1, |
| 354 | GrMipMapped::kNo, |
| 355 | kTopLeft_GrSurfaceOrigin)); |
Chris Dalton | c534808 | 2018-03-30 15:59:38 +0000 | [diff] [blame] | 356 | if (!rtc) { |
| 357 | return nullptr; |
| 358 | } |
| 359 | |
| 360 | if (!reducedClip.drawAlphaClipMask(rtc.get())) { |
| 361 | return nullptr; |
| 362 | } |
| 363 | |
| 364 | sk_sp<GrTextureProxy> result(rtc->asTextureProxyRef()); |
| 365 | if (!result) { |
| 366 | return nullptr; |
| 367 | } |
| 368 | |
Robert Phillips | 5491e82 | 2018-06-27 12:54:44 -0400 | [diff] [blame] | 369 | SkASSERT(result->origin() == kTopLeft_GrSurfaceOrigin); |
Chris Dalton | c534808 | 2018-03-30 15:59:38 +0000 | [diff] [blame] | 370 | proxyProvider->assignUniqueKeyToProxy(key, result.get()); |
Brian Salomon | 238069b | 2018-07-11 15:58:57 -0400 | [diff] [blame] | 371 | add_invalidate_on_pop_message(*fStack, reducedClip.maskGenID(), key, context->uniqueID()); |
Chris Dalton | c534808 | 2018-03-30 15:59:38 +0000 | [diff] [blame] | 372 | |
| 373 | return result; |
| 374 | } |
| 375 | |
Brian Osman | 5d03474 | 2017-09-11 13:38:55 -0400 | [diff] [blame] | 376 | namespace { |
Robert Phillips | 875218e | 2017-02-24 08:37:13 -0500 | [diff] [blame] | 377 | |
Brian Osman | 5d03474 | 2017-09-11 13:38:55 -0400 | [diff] [blame] | 378 | /** |
Brian Osman | 099fa0f | 2017-10-02 16:38:32 -0400 | [diff] [blame] | 379 | * Payload class for use with GrTDeferredProxyUploader. The clip mask code renders multiple |
Brian Osman | 5d03474 | 2017-09-11 13:38:55 -0400 | [diff] [blame] | 380 | * elements, each storing their own AA setting (and already transformed into device space). This |
| 381 | * stores all of the information needed by the worker thread to draw all clip elements (see below, |
| 382 | * in createSoftwareClipMask). |
| 383 | */ |
| 384 | class ClipMaskData { |
| 385 | public: |
| 386 | ClipMaskData(const GrReducedClip& reducedClip) |
Chris Dalton | 7947193 | 2017-10-27 01:50:57 -0600 | [diff] [blame] | 387 | : fScissor(reducedClip.scissor()) |
Brian Osman | 5d03474 | 2017-09-11 13:38:55 -0400 | [diff] [blame] | 388 | , fInitialState(reducedClip.initialState()) { |
Chris Dalton | 7947193 | 2017-10-27 01:50:57 -0600 | [diff] [blame] | 389 | for (ElementList::Iter iter(reducedClip.maskElements()); iter.get(); iter.next()) { |
Brian Osman | 5d03474 | 2017-09-11 13:38:55 -0400 | [diff] [blame] | 390 | fElements.addToTail(*iter.get()); |
| 391 | } |
robertphillips@google.com | 6b70a7b | 2012-05-11 15:32:48 +0000 | [diff] [blame] | 392 | } |
| 393 | |
Chris Dalton | 7947193 | 2017-10-27 01:50:57 -0600 | [diff] [blame] | 394 | const SkIRect& scissor() const { return fScissor; } |
Brian Osman | 5d03474 | 2017-09-11 13:38:55 -0400 | [diff] [blame] | 395 | InitialState initialState() const { return fInitialState; } |
| 396 | const ElementList& elements() const { return fElements; } |
bsalomon@google.com | 4c2443e | 2012-12-06 20:58:57 +0000 | [diff] [blame] | 397 | |
Brian Osman | 5d03474 | 2017-09-11 13:38:55 -0400 | [diff] [blame] | 398 | private: |
Chris Dalton | 7947193 | 2017-10-27 01:50:57 -0600 | [diff] [blame] | 399 | SkIRect fScissor; |
Brian Osman | 5d03474 | 2017-09-11 13:38:55 -0400 | [diff] [blame] | 400 | InitialState fInitialState; |
| 401 | ElementList fElements; |
| 402 | }; |
robertphillips@google.com | 6b70a7b | 2012-05-11 15:32:48 +0000 | [diff] [blame] | 403 | |
Brian Osman | 5d03474 | 2017-09-11 13:38:55 -0400 | [diff] [blame] | 404 | } |
| 405 | |
| 406 | static void draw_clip_elements_to_mask_helper(GrSWMaskHelper& helper, const ElementList& elements, |
Chris Dalton | 7947193 | 2017-10-27 01:50:57 -0600 | [diff] [blame] | 407 | const SkIRect& scissor, InitialState initialState) { |
Brian Osman | 5d03474 | 2017-09-11 13:38:55 -0400 | [diff] [blame] | 408 | // Set the matrix so that rendered clip elements are transformed to mask space from clip space. |
joshualitt | 8059eb9 | 2014-12-29 15:10:07 -0800 | [diff] [blame] | 409 | SkMatrix translate; |
Chris Dalton | 7947193 | 2017-10-27 01:50:57 -0600 | [diff] [blame] | 410 | translate.setTranslate(SkIntToScalar(-scissor.left()), SkIntToScalar(-scissor.top())); |
joshualitt | 9853cce | 2014-11-17 14:22:48 -0800 | [diff] [blame] | 411 | |
Brian Osman | 5d03474 | 2017-09-11 13:38:55 -0400 | [diff] [blame] | 412 | helper.clear(InitialState::kAllIn == initialState ? 0xFF : 0x00); |
sugoi@google.com | 12b4e27 | 2012-12-06 20:13:11 +0000 | [diff] [blame] | 413 | |
Brian Osman | 5d03474 | 2017-09-11 13:38:55 -0400 | [diff] [blame] | 414 | for (ElementList::Iter iter(elements); iter.get(); iter.next()) { |
Brian Salomon | c3833b4 | 2018-07-09 18:23:58 +0000 | [diff] [blame] | 415 | const Element* element = iter.get(); |
| 416 | SkClipOp op = element->getOp(); |
| 417 | GrAA aa = GrAA(element->isAA()); |
robertphillips@google.com | fa66294 | 2012-05-17 12:20:22 +0000 | [diff] [blame] | 418 | |
Mike Reed | c1f7774 | 2016-12-09 09:00:50 -0500 | [diff] [blame] | 419 | if (kIntersect_SkClipOp == op || kReverseDifference_SkClipOp == op) { |
bsalomon@google.com | 4c2443e | 2012-12-06 20:58:57 +0000 | [diff] [blame] | 420 | // Intersect and reverse difference require modifying pixels outside of the geometry |
| 421 | // that is being "drawn". In both cases we erase all the pixels outside of the geometry |
| 422 | // but leave the pixels inside the geometry alone. For reverse difference we invert all |
| 423 | // the pixels before clearing the ones outside the geometry. |
Mike Reed | c1f7774 | 2016-12-09 09:00:50 -0500 | [diff] [blame] | 424 | if (kReverseDifference_SkClipOp == op) { |
Chris Dalton | 7947193 | 2017-10-27 01:50:57 -0600 | [diff] [blame] | 425 | SkRect temp = SkRect::Make(scissor); |
robertphillips@google.com | fa66294 | 2012-05-17 12:20:22 +0000 | [diff] [blame] | 426 | // invert the entire scene |
Brian Salomon | 7407756 | 2017-08-30 13:55:35 -0400 | [diff] [blame] | 427 | helper.drawRect(temp, translate, SkRegion::kXOR_Op, GrAA::kNo, 0xFF); |
robertphillips@google.com | fa66294 | 2012-05-17 12:20:22 +0000 | [diff] [blame] | 428 | } |
commit-bot@chromium.org | 5c05639 | 2014-02-17 19:50:02 +0000 | [diff] [blame] | 429 | SkPath clipPath; |
Brian Salomon | c3833b4 | 2018-07-09 18:23:58 +0000 | [diff] [blame] | 430 | element->asDeviceSpacePath(&clipPath); |
commit-bot@chromium.org | 5c05639 | 2014-02-17 19:50:02 +0000 | [diff] [blame] | 431 | clipPath.toggleInverseFillType(); |
bsalomon | 8acedde | 2016-06-24 10:42:16 -0700 | [diff] [blame] | 432 | GrShape shape(clipPath, GrStyle::SimpleFill()); |
Brian Salomon | 7407756 | 2017-08-30 13:55:35 -0400 | [diff] [blame] | 433 | helper.drawShape(shape, translate, SkRegion::kReplace_Op, aa, 0x00); |
robertphillips@google.com | fa66294 | 2012-05-17 12:20:22 +0000 | [diff] [blame] | 434 | continue; |
| 435 | } |
| 436 | |
| 437 | // The other ops (union, xor, diff) only affect pixels inside |
| 438 | // the geometry so they can just be drawn normally |
Brian Salomon | c3833b4 | 2018-07-09 18:23:58 +0000 | [diff] [blame] | 439 | if (Element::DeviceSpaceType::kRect == element->getDeviceSpaceType()) { |
| 440 | helper.drawRect(element->getDeviceSpaceRect(), translate, (SkRegion::Op)op, aa, 0xFF); |
bsalomon@google.com | 8182fa0 | 2012-12-04 14:06:06 +0000 | [diff] [blame] | 441 | } else { |
commit-bot@chromium.org | 5c05639 | 2014-02-17 19:50:02 +0000 | [diff] [blame] | 442 | SkPath path; |
Brian Salomon | c3833b4 | 2018-07-09 18:23:58 +0000 | [diff] [blame] | 443 | element->asDeviceSpacePath(&path); |
bsalomon | 8acedde | 2016-06-24 10:42:16 -0700 | [diff] [blame] | 444 | GrShape shape(path, GrStyle::SimpleFill()); |
Brian Salomon | 7407756 | 2017-08-30 13:55:35 -0400 | [diff] [blame] | 445 | helper.drawShape(shape, translate, (SkRegion::Op)op, aa, 0xFF); |
robertphillips@google.com | 6b70a7b | 2012-05-11 15:32:48 +0000 | [diff] [blame] | 446 | } |
| 447 | } |
Brian Osman | 5d03474 | 2017-09-11 13:38:55 -0400 | [diff] [blame] | 448 | } |
robertphillips@google.com | 6b70a7b | 2012-05-11 15:32:48 +0000 | [diff] [blame] | 449 | |
Brian Osman | 5d03474 | 2017-09-11 13:38:55 -0400 | [diff] [blame] | 450 | sk_sp<GrTextureProxy> GrClipStackClip::createSoftwareClipMask( |
| 451 | GrContext* context, const GrReducedClip& reducedClip, |
| 452 | GrRenderTargetContext* renderTargetContext) const { |
Brian Salomon | c3833b4 | 2018-07-09 18:23:58 +0000 | [diff] [blame] | 453 | GrUniqueKey key; |
| 454 | create_clip_mask_key(reducedClip.maskGenID(), reducedClip.scissor(), |
| 455 | reducedClip.numAnalyticFPs(), &key); |
robertphillips | 391395d | 2016-03-02 09:26:36 -0800 | [diff] [blame] | 456 | |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 457 | GrProxyProvider* proxyProvider = context->contextPriv().proxyProvider(); |
| 458 | |
| 459 | sk_sp<GrTextureProxy> proxy(proxyProvider->findOrCreateProxyByUniqueKey( |
Brian Osman | 5d03474 | 2017-09-11 13:38:55 -0400 | [diff] [blame] | 460 | key, kTopLeft_GrSurfaceOrigin)); |
| 461 | if (proxy) { |
| 462 | return proxy; |
| 463 | } |
| 464 | |
| 465 | // The mask texture may be larger than necessary. We round out the clip bounds and pin the top |
| 466 | // left corner of the resulting rect to the top left of the texture. |
| 467 | SkIRect maskSpaceIBounds = SkIRect::MakeWH(reducedClip.width(), reducedClip.height()); |
| 468 | |
| 469 | SkTaskGroup* taskGroup = context->contextPriv().getTaskGroup(); |
| 470 | if (taskGroup && renderTargetContext) { |
| 471 | // Create our texture proxy |
| 472 | GrSurfaceDesc desc; |
Brian Osman | 5d03474 | 2017-09-11 13:38:55 -0400 | [diff] [blame] | 473 | desc.fWidth = maskSpaceIBounds.width(); |
| 474 | desc.fHeight = maskSpaceIBounds.height(); |
| 475 | desc.fConfig = kAlpha_8_GrPixelConfig; |
Brian Osman | d140fe9 | 2017-10-03 12:17:26 -0400 | [diff] [blame] | 476 | // MDB TODO: We're going to fill this proxy with an ASAP upload (which is out of order wrt |
| 477 | // to ops), so it can't have any pending IO. |
Brian Salomon | 2a4f983 | 2018-03-03 22:43:43 -0500 | [diff] [blame] | 478 | proxy = proxyProvider->createProxy(desc, kTopLeft_GrSurfaceOrigin, SkBackingFit::kApprox, |
Robert Phillips | fe0253f | 2018-03-16 16:47:25 -0400 | [diff] [blame] | 479 | SkBudgeted::kYes, GrInternalSurfaceFlags::kNoPendingIO); |
Brian Osman | 5d03474 | 2017-09-11 13:38:55 -0400 | [diff] [blame] | 480 | |
Brian Osman | 099fa0f | 2017-10-02 16:38:32 -0400 | [diff] [blame] | 481 | auto uploader = skstd::make_unique<GrTDeferredProxyUploader<ClipMaskData>>(reducedClip); |
| 482 | GrTDeferredProxyUploader<ClipMaskData>* uploaderRaw = uploader.get(); |
Brian Osman | 5d03474 | 2017-09-11 13:38:55 -0400 | [diff] [blame] | 483 | auto drawAndUploadMask = [uploaderRaw, maskSpaceIBounds] { |
| 484 | TRACE_EVENT0("skia", "Threaded SW Clip Mask Render"); |
| 485 | GrSWMaskHelper helper(uploaderRaw->getPixels()); |
| 486 | if (helper.init(maskSpaceIBounds)) { |
| 487 | draw_clip_elements_to_mask_helper(helper, uploaderRaw->data().elements(), |
Chris Dalton | 7947193 | 2017-10-27 01:50:57 -0600 | [diff] [blame] | 488 | uploaderRaw->data().scissor(), |
Brian Osman | 5d03474 | 2017-09-11 13:38:55 -0400 | [diff] [blame] | 489 | uploaderRaw->data().initialState()); |
| 490 | } else { |
| 491 | SkDEBUGFAIL("Unable to allocate SW clip mask."); |
| 492 | } |
Brian Osman | 099fa0f | 2017-10-02 16:38:32 -0400 | [diff] [blame] | 493 | uploaderRaw->signalAndFreeData(); |
Brian Osman | 5d03474 | 2017-09-11 13:38:55 -0400 | [diff] [blame] | 494 | }; |
| 495 | |
| 496 | taskGroup->add(std::move(drawAndUploadMask)); |
Brian Osman | 099fa0f | 2017-10-02 16:38:32 -0400 | [diff] [blame] | 497 | proxy->texPriv().setDeferredUploader(std::move(uploader)); |
Brian Osman | 5d03474 | 2017-09-11 13:38:55 -0400 | [diff] [blame] | 498 | } else { |
| 499 | GrSWMaskHelper helper; |
| 500 | if (!helper.init(maskSpaceIBounds)) { |
| 501 | return nullptr; |
| 502 | } |
| 503 | |
Chris Dalton | 7947193 | 2017-10-27 01:50:57 -0600 | [diff] [blame] | 504 | draw_clip_elements_to_mask_helper(helper, reducedClip.maskElements(), reducedClip.scissor(), |
Brian Osman | 5d03474 | 2017-09-11 13:38:55 -0400 | [diff] [blame] | 505 | reducedClip.initialState()); |
| 506 | |
| 507 | proxy = helper.toTextureProxy(context, SkBackingFit::kApprox); |
| 508 | } |
| 509 | |
| 510 | SkASSERT(proxy->origin() == kTopLeft_GrSurfaceOrigin); |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 511 | proxyProvider->assignUniqueKeyToProxy(key, proxy.get()); |
Brian Salomon | 238069b | 2018-07-11 15:58:57 -0400 | [diff] [blame] | 512 | add_invalidate_on_pop_message(*fStack, reducedClip.maskGenID(), key, context->uniqueID()); |
Brian Osman | 5d03474 | 2017-09-11 13:38:55 -0400 | [diff] [blame] | 513 | return proxy; |
robertphillips@google.com | 6b70a7b | 2012-05-11 15:32:48 +0000 | [diff] [blame] | 514 | } |