robertphillips@google.com | f4c2c52 | 2012-04-27 12:08:47 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012 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 | #include "GrSoftwarePathRenderer.h" |
robertphillips | 976f5f0 | 2016-06-03 10:59:20 -0700 | [diff] [blame] | 9 | #include "GrAuditTrail.h" |
| 10 | #include "GrClip.h" |
bsalomon | 39ef7fb | 2016-09-21 11:16:05 -0700 | [diff] [blame] | 11 | #include "GrGpuResourcePriv.h" |
Brian Salomon | 6a63904 | 2016-12-14 11:08:17 -0500 | [diff] [blame] | 12 | #include "GrPipelineBuilder.h" |
Brian Osman | 32342f0 | 2017-03-04 08:12:46 -0500 | [diff] [blame] | 13 | #include "GrResourceProvider.h" |
robertphillips@google.com | 58b2021 | 2012-06-27 20:44:52 +0000 | [diff] [blame] | 14 | #include "GrSWMaskHelper.h" |
Brian Salomon | 8952743 | 2016-12-16 09:52:16 -0500 | [diff] [blame] | 15 | #include "ops/GrRectOpFactory.h" |
robertphillips@google.com | f4c2c52 | 2012-04-27 12:08:47 +0000 | [diff] [blame] | 16 | |
robertphillips@google.com | ed4155d | 2012-05-01 14:30:24 +0000 | [diff] [blame] | 17 | //////////////////////////////////////////////////////////////////////////////// |
bsalomon | 0aff2fa | 2015-07-31 06:48:27 -0700 | [diff] [blame] | 18 | bool GrSoftwarePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const { |
bsalomon | 8acedde | 2016-06-24 10:42:16 -0700 | [diff] [blame] | 19 | // Pass on any style that applies. The caller will apply the style if a suitable renderer is |
| 20 | // not found and try again with the new GrShape. |
Brian Osman | 32342f0 | 2017-03-04 08:12:46 -0500 | [diff] [blame] | 21 | return !args.fShape->style().applies() && SkToBool(fResourceProvider) && |
Brian Salomon | 0e8fc8b | 2016-12-09 15:10:07 -0500 | [diff] [blame] | 22 | (args.fAAType == GrAAType::kCoverage || args.fAAType == GrAAType::kNone); |
robertphillips@google.com | f4c2c52 | 2012-04-27 12:08:47 +0000 | [diff] [blame] | 23 | } |
| 24 | |
robertphillips@google.com | ed4155d | 2012-05-01 14:30:24 +0000 | [diff] [blame] | 25 | //////////////////////////////////////////////////////////////////////////////// |
bsalomon | 39ef7fb | 2016-09-21 11:16:05 -0700 | [diff] [blame] | 26 | static bool get_unclipped_shape_dev_bounds(const GrShape& shape, const SkMatrix& matrix, |
| 27 | SkIRect* devBounds) { |
| 28 | SkRect shapeBounds = shape.styledBounds(); |
| 29 | if (shapeBounds.isEmpty()) { |
| 30 | return false; |
| 31 | } |
| 32 | SkRect shapeDevBounds; |
| 33 | matrix.mapRect(&shapeDevBounds, shapeBounds); |
Brian Salomon | c1c607e | 2016-12-20 11:41:43 -0500 | [diff] [blame] | 34 | // Even though these are "unclipped" bounds we still clip to the int32_t range. |
| 35 | // This is the largest int32_t that is representable exactly as a float. The next 63 larger ints |
| 36 | // would round down to this value when cast to a float, but who really cares. |
| 37 | // INT32_MIN is exactly representable. |
| 38 | static constexpr int32_t kMaxInt = 2147483520; |
| 39 | if (!shapeDevBounds.intersect(SkRect::MakeLTRB(INT32_MIN, INT32_MIN, kMaxInt, kMaxInt))) { |
| 40 | return false; |
| 41 | } |
bsalomon | 39ef7fb | 2016-09-21 11:16:05 -0700 | [diff] [blame] | 42 | shapeDevBounds.roundOut(devBounds); |
| 43 | return true; |
| 44 | } |
| 45 | |
| 46 | // Gets the shape bounds, the clip bounds, and the intersection (if any). Returns false if there |
| 47 | // is no intersection. |
| 48 | static bool get_shape_and_clip_bounds(int width, int height, |
| 49 | const GrClip& clip, |
| 50 | const GrShape& shape, |
| 51 | const SkMatrix& matrix, |
| 52 | SkIRect* unclippedDevShapeBounds, |
| 53 | SkIRect* clippedDevShapeBounds, |
| 54 | SkIRect* devClipBounds) { |
robertphillips@google.com | ed4155d | 2012-05-01 14:30:24 +0000 | [diff] [blame] | 55 | // compute bounds as intersection of rt size, clip, and path |
robertphillips | 0152d73 | 2016-05-20 06:38:43 -0700 | [diff] [blame] | 56 | clip.getConservativeBounds(width, height, devClipBounds); |
robertphillips@google.com | 7b11289 | 2012-07-31 15:18:21 +0000 | [diff] [blame] | 57 | |
bsalomon | 39ef7fb | 2016-09-21 11:16:05 -0700 | [diff] [blame] | 58 | if (!get_unclipped_shape_dev_bounds(shape, matrix, unclippedDevShapeBounds)) { |
| 59 | *unclippedDevShapeBounds = SkIRect::EmptyIRect(); |
| 60 | *clippedDevShapeBounds = SkIRect::EmptyIRect(); |
robertphillips@google.com | 3e11c0b | 2012-07-11 18:20:35 +0000 | [diff] [blame] | 61 | return false; |
robertphillips@google.com | ed4155d | 2012-05-01 14:30:24 +0000 | [diff] [blame] | 62 | } |
bsalomon | 39ef7fb | 2016-09-21 11:16:05 -0700 | [diff] [blame] | 63 | if (!clippedDevShapeBounds->intersect(*devClipBounds, *unclippedDevShapeBounds)) { |
| 64 | *clippedDevShapeBounds = SkIRect::EmptyIRect(); |
robertphillips@google.com | ed4155d | 2012-05-01 14:30:24 +0000 | [diff] [blame] | 65 | return false; |
| 66 | } |
| 67 | return true; |
| 68 | } |
| 69 | |
| 70 | //////////////////////////////////////////////////////////////////////////////// |
robertphillips | 976f5f0 | 2016-06-03 10:59:20 -0700 | [diff] [blame] | 71 | |
Brian Osman | 1105224 | 2016-10-27 14:47:55 -0400 | [diff] [blame] | 72 | void GrSoftwarePathRenderer::DrawNonAARect(GrRenderTargetContext* renderTargetContext, |
Brian Salomon | 82f4431 | 2017-01-11 13:42:54 -0500 | [diff] [blame] | 73 | GrPaint&& paint, |
robertphillips | d2b6d64 | 2016-07-21 08:55:08 -0700 | [diff] [blame] | 74 | const GrUserStencilSettings& userStencilSettings, |
robertphillips | 976f5f0 | 2016-06-03 10:59:20 -0700 | [diff] [blame] | 75 | const GrClip& clip, |
robertphillips | 976f5f0 | 2016-06-03 10:59:20 -0700 | [diff] [blame] | 76 | const SkMatrix& viewMatrix, |
| 77 | const SkRect& rect, |
| 78 | const SkMatrix& localMatrix) { |
Brian Salomon | d3ccb0a | 2017-04-03 10:38:00 -0400 | [diff] [blame] | 79 | std::unique_ptr<GrLegacyMeshDrawOp> op(GrRectOpFactory::MakeNonAAFill( |
| 80 | paint.getColor(), viewMatrix, rect, nullptr, &localMatrix)); |
robertphillips | 976f5f0 | 2016-06-03 10:59:20 -0700 | [diff] [blame] | 81 | |
Brian Salomon | 82f4431 | 2017-01-11 13:42:54 -0500 | [diff] [blame] | 82 | GrPipelineBuilder pipelineBuilder(std::move(paint), GrAAType::kNone); |
bsalomon | bb24383 | 2016-07-22 07:10:19 -0700 | [diff] [blame] | 83 | pipelineBuilder.setUserStencil(&userStencilSettings); |
Brian Salomon | e14bd80 | 2017-04-04 15:13:25 -0400 | [diff] [blame] | 84 | renderTargetContext->addLegacyMeshDrawOp(std::move(pipelineBuilder), clip, std::move(op)); |
robertphillips | 976f5f0 | 2016-06-03 10:59:20 -0700 | [diff] [blame] | 85 | } |
| 86 | |
Brian Osman | 1105224 | 2016-10-27 14:47:55 -0400 | [diff] [blame] | 87 | void GrSoftwarePathRenderer::DrawAroundInvPath(GrRenderTargetContext* renderTargetContext, |
Brian Salomon | 82f4431 | 2017-01-11 13:42:54 -0500 | [diff] [blame] | 88 | GrPaint&& paint, |
robertphillips | d2b6d64 | 2016-07-21 08:55:08 -0700 | [diff] [blame] | 89 | const GrUserStencilSettings& userStencilSettings, |
robertphillips | 976f5f0 | 2016-06-03 10:59:20 -0700 | [diff] [blame] | 90 | const GrClip& clip, |
robertphillips | 976f5f0 | 2016-06-03 10:59:20 -0700 | [diff] [blame] | 91 | const SkMatrix& viewMatrix, |
| 92 | const SkIRect& devClipBounds, |
| 93 | const SkIRect& devPathBounds) { |
joshualitt | d27f73e | 2014-12-29 07:43:36 -0800 | [diff] [blame] | 94 | SkMatrix invert; |
joshualitt | 8059eb9 | 2014-12-29 15:10:07 -0800 | [diff] [blame] | 95 | if (!viewMatrix.invert(&invert)) { |
bsalomon@google.com | e3d3216 | 2012-07-20 13:37:06 +0000 | [diff] [blame] | 96 | return; |
| 97 | } |
joshualitt | d27f73e | 2014-12-29 07:43:36 -0800 | [diff] [blame] | 98 | |
commit-bot@chromium.org | fd03d4a | 2013-07-17 21:39:42 +0000 | [diff] [blame] | 99 | SkRect rect; |
robertphillips@google.com | 7b11289 | 2012-07-31 15:18:21 +0000 | [diff] [blame] | 100 | if (devClipBounds.fTop < devPathBounds.fTop) { |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 101 | rect.iset(devClipBounds.fLeft, devClipBounds.fTop, |
robertphillips@google.com | 7b11289 | 2012-07-31 15:18:21 +0000 | [diff] [blame] | 102 | devClipBounds.fRight, devPathBounds.fTop); |
Brian Salomon | 82f4431 | 2017-01-11 13:42:54 -0500 | [diff] [blame] | 103 | DrawNonAARect(renderTargetContext, GrPaint(paint), userStencilSettings, clip, SkMatrix::I(), |
| 104 | rect, invert); |
robertphillips@google.com | ed4155d | 2012-05-01 14:30:24 +0000 | [diff] [blame] | 105 | } |
robertphillips@google.com | 7b11289 | 2012-07-31 15:18:21 +0000 | [diff] [blame] | 106 | if (devClipBounds.fLeft < devPathBounds.fLeft) { |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 107 | rect.iset(devClipBounds.fLeft, devPathBounds.fTop, |
robertphillips@google.com | 7b11289 | 2012-07-31 15:18:21 +0000 | [diff] [blame] | 108 | devPathBounds.fLeft, devPathBounds.fBottom); |
Brian Salomon | 82f4431 | 2017-01-11 13:42:54 -0500 | [diff] [blame] | 109 | DrawNonAARect(renderTargetContext, GrPaint(paint), userStencilSettings, clip, SkMatrix::I(), |
| 110 | rect, invert); |
robertphillips@google.com | ed4155d | 2012-05-01 14:30:24 +0000 | [diff] [blame] | 111 | } |
robertphillips@google.com | 7b11289 | 2012-07-31 15:18:21 +0000 | [diff] [blame] | 112 | if (devClipBounds.fRight > devPathBounds.fRight) { |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 113 | rect.iset(devPathBounds.fRight, devPathBounds.fTop, |
robertphillips@google.com | 7b11289 | 2012-07-31 15:18:21 +0000 | [diff] [blame] | 114 | devClipBounds.fRight, devPathBounds.fBottom); |
Brian Salomon | 82f4431 | 2017-01-11 13:42:54 -0500 | [diff] [blame] | 115 | DrawNonAARect(renderTargetContext, GrPaint(paint), userStencilSettings, clip, SkMatrix::I(), |
| 116 | rect, invert); |
robertphillips@google.com | ed4155d | 2012-05-01 14:30:24 +0000 | [diff] [blame] | 117 | } |
robertphillips@google.com | 7b11289 | 2012-07-31 15:18:21 +0000 | [diff] [blame] | 118 | if (devClipBounds.fBottom > devPathBounds.fBottom) { |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 119 | rect.iset(devClipBounds.fLeft, devPathBounds.fBottom, |
robertphillips@google.com | 7b11289 | 2012-07-31 15:18:21 +0000 | [diff] [blame] | 120 | devClipBounds.fRight, devClipBounds.fBottom); |
Brian Salomon | 82f4431 | 2017-01-11 13:42:54 -0500 | [diff] [blame] | 121 | DrawNonAARect(renderTargetContext, std::move(paint), userStencilSettings, clip, |
robertphillips | 976f5f0 | 2016-06-03 10:59:20 -0700 | [diff] [blame] | 122 | SkMatrix::I(), rect, invert); |
robertphillips@google.com | ed4155d | 2012-05-01 14:30:24 +0000 | [diff] [blame] | 123 | } |
| 124 | } |
| 125 | |
robertphillips@google.com | ed4155d | 2012-05-01 14:30:24 +0000 | [diff] [blame] | 126 | //////////////////////////////////////////////////////////////////////////////// |
| 127 | // return true on success; false on failure |
bsalomon | 0aff2fa | 2015-07-31 06:48:27 -0700 | [diff] [blame] | 128 | bool GrSoftwarePathRenderer::onDrawPath(const DrawPathArgs& args) { |
Brian Osman | 1105224 | 2016-10-27 14:47:55 -0400 | [diff] [blame] | 129 | GR_AUDIT_TRAIL_AUTO_FRAME(args.fRenderTargetContext->auditTrail(), |
robertphillips | 976f5f0 | 2016-06-03 10:59:20 -0700 | [diff] [blame] | 130 | "GrSoftwarePathRenderer::onDrawPath"); |
Brian Osman | 32342f0 | 2017-03-04 08:12:46 -0500 | [diff] [blame] | 131 | if (!fResourceProvider) { |
robertphillips@google.com | ed4155d | 2012-05-01 14:30:24 +0000 | [diff] [blame] | 132 | return false; |
| 133 | } |
| 134 | |
bsalomon | 8acedde | 2016-06-24 10:42:16 -0700 | [diff] [blame] | 135 | // We really need to know if the shape will be inverse filled or not |
| 136 | bool inverseFilled = false; |
| 137 | SkTLazy<GrShape> tmpShape; |
caryclark | d656200 | 2016-07-27 12:02:07 -0700 | [diff] [blame] | 138 | SkASSERT(!args.fShape->style().applies()); |
Eric Karl | 5c77975 | 2017-05-08 12:02:07 -0700 | [diff] [blame^] | 139 | // If the path is hairline, ignore inverse fill. |
| 140 | inverseFilled = args.fShape->inverseFilled() && |
| 141 | !IsStrokeHairlineOrEquivalent(args.fShape->style(), *args.fViewMatrix, nullptr); |
bsalomon | 8acedde | 2016-06-24 10:42:16 -0700 | [diff] [blame] | 142 | |
bsalomon | 39ef7fb | 2016-09-21 11:16:05 -0700 | [diff] [blame] | 143 | SkIRect unclippedDevShapeBounds, clippedDevShapeBounds, devClipBounds; |
| 144 | // To prevent overloading the cache with entries during animations we limit the cache of masks |
| 145 | // to cases where the matrix preserves axis alignment. |
| 146 | bool useCache = fAllowCaching && !inverseFilled && args.fViewMatrix->preservesAxisAlignment() && |
Brian Salomon | 0e8fc8b | 2016-12-09 15:10:07 -0500 | [diff] [blame] | 147 | args.fShape->hasUnstyledKey() && GrAAType::kCoverage == args.fAAType; |
bsalomon | 39ef7fb | 2016-09-21 11:16:05 -0700 | [diff] [blame] | 148 | |
Brian Osman | 1105224 | 2016-10-27 14:47:55 -0400 | [diff] [blame] | 149 | if (!get_shape_and_clip_bounds(args.fRenderTargetContext->width(), |
| 150 | args.fRenderTargetContext->height(), |
bsalomon | 8acedde | 2016-06-24 10:42:16 -0700 | [diff] [blame] | 151 | *args.fClip, *args.fShape, |
bsalomon | 39ef7fb | 2016-09-21 11:16:05 -0700 | [diff] [blame] | 152 | *args.fViewMatrix, &unclippedDevShapeBounds, |
| 153 | &clippedDevShapeBounds, |
| 154 | &devClipBounds)) { |
bsalomon | 8acedde | 2016-06-24 10:42:16 -0700 | [diff] [blame] | 155 | if (inverseFilled) { |
Brian Salomon | 82f4431 | 2017-01-11 13:42:54 -0500 | [diff] [blame] | 156 | DrawAroundInvPath(args.fRenderTargetContext, std::move(args.fPaint), |
| 157 | *args.fUserStencilSettings, *args.fClip, *args.fViewMatrix, |
| 158 | devClipBounds, unclippedDevShapeBounds); |
bsalomon@google.com | 276c1fa | 2012-06-19 13:22:45 +0000 | [diff] [blame] | 159 | } |
| 160 | return true; |
robertphillips@google.com | ed4155d | 2012-05-01 14:30:24 +0000 | [diff] [blame] | 161 | } |
robertphillips@google.com | 366f1c6 | 2012-06-29 21:38:47 +0000 | [diff] [blame] | 162 | |
bsalomon | 39ef7fb | 2016-09-21 11:16:05 -0700 | [diff] [blame] | 163 | const SkIRect* boundsForMask = &clippedDevShapeBounds; |
| 164 | if (useCache) { |
| 165 | // Use the cache only if >50% of the path is visible. |
| 166 | int unclippedWidth = unclippedDevShapeBounds.width(); |
| 167 | int unclippedHeight = unclippedDevShapeBounds.height(); |
| 168 | int unclippedArea = unclippedWidth * unclippedHeight; |
| 169 | int clippedArea = clippedDevShapeBounds.width() * clippedDevShapeBounds.height(); |
Brian Osman | 1105224 | 2016-10-27 14:47:55 -0400 | [diff] [blame] | 170 | int maxTextureSize = args.fRenderTargetContext->caps()->maxTextureSize(); |
bsalomon | 39ef7fb | 2016-09-21 11:16:05 -0700 | [diff] [blame] | 171 | if (unclippedArea > 2 * clippedArea || unclippedWidth > maxTextureSize || |
| 172 | unclippedHeight > maxTextureSize) { |
| 173 | useCache = false; |
| 174 | } else { |
| 175 | boundsForMask = &unclippedDevShapeBounds; |
| 176 | } |
robertphillips@google.com | ed4155d | 2012-05-01 14:30:24 +0000 | [diff] [blame] | 177 | } |
| 178 | |
bsalomon | 39ef7fb | 2016-09-21 11:16:05 -0700 | [diff] [blame] | 179 | GrUniqueKey maskKey; |
| 180 | struct KeyData { |
| 181 | SkScalar fFractionalTranslateX; |
| 182 | SkScalar fFractionalTranslateY; |
| 183 | }; |
| 184 | |
| 185 | if (useCache) { |
| 186 | // We require the upper left 2x2 of the matrix to match exactly for a cache hit. |
| 187 | SkScalar sx = args.fViewMatrix->get(SkMatrix::kMScaleX); |
| 188 | SkScalar sy = args.fViewMatrix->get(SkMatrix::kMScaleY); |
| 189 | SkScalar kx = args.fViewMatrix->get(SkMatrix::kMSkewX); |
| 190 | SkScalar ky = args.fViewMatrix->get(SkMatrix::kMSkewY); |
| 191 | SkScalar tx = args.fViewMatrix->get(SkMatrix::kMTransX); |
| 192 | SkScalar ty = args.fViewMatrix->get(SkMatrix::kMTransY); |
| 193 | // Allow 8 bits each in x and y of subpixel positioning. |
| 194 | SkFixed fracX = SkScalarToFixed(SkScalarFraction(tx)) & 0x0000FF00; |
| 195 | SkFixed fracY = SkScalarToFixed(SkScalarFraction(ty)) & 0x0000FF00; |
| 196 | static const GrUniqueKey::Domain kDomain = GrUniqueKey::GenerateDomain(); |
| 197 | GrUniqueKey::Builder builder(&maskKey, kDomain, 5 + args.fShape->unstyledKeySize()); |
| 198 | builder[0] = SkFloat2Bits(sx); |
| 199 | builder[1] = SkFloat2Bits(sy); |
| 200 | builder[2] = SkFloat2Bits(kx); |
| 201 | builder[3] = SkFloat2Bits(ky); |
| 202 | builder[4] = fracX | (fracY >> 8); |
| 203 | args.fShape->writeUnstyledKey(&builder[5]); |
Brian Salomon | 0e8fc8b | 2016-12-09 15:10:07 -0500 | [diff] [blame] | 204 | // FIXME: Doesn't the key need to consider whether we're using AA or not? In practice that |
| 205 | // should always be true, though. |
bsalomon | 39ef7fb | 2016-09-21 11:16:05 -0700 | [diff] [blame] | 206 | } |
| 207 | |
Robert Phillips | d374948 | 2017-03-14 09:17:43 -0400 | [diff] [blame] | 208 | sk_sp<GrTextureProxy> proxy; |
bsalomon | 39ef7fb | 2016-09-21 11:16:05 -0700 | [diff] [blame] | 209 | if (useCache) { |
Robert Phillips | d374948 | 2017-03-14 09:17:43 -0400 | [diff] [blame] | 210 | proxy = fResourceProvider->findProxyByUniqueKey(maskKey); |
bsalomon | 39ef7fb | 2016-09-21 11:16:05 -0700 | [diff] [blame] | 211 | } |
Robert Phillips | d374948 | 2017-03-14 09:17:43 -0400 | [diff] [blame] | 212 | if (!proxy) { |
Robert Phillips | 417b7f4 | 2016-12-14 09:12:13 -0500 | [diff] [blame] | 213 | SkBackingFit fit = useCache ? SkBackingFit::kExact : SkBackingFit::kApprox; |
Brian Salomon | 0e8fc8b | 2016-12-09 15:10:07 -0500 | [diff] [blame] | 214 | GrAA aa = GrAAType::kCoverage == args.fAAType ? GrAA::kYes : GrAA::kNo; |
Robert Phillips | 26c90e0 | 2017-03-14 14:39:29 -0400 | [diff] [blame] | 215 | proxy = GrSWMaskHelper::DrawShapeMaskToTexture(args.fContext, *args.fShape, |
Robert Phillips | d374948 | 2017-03-14 09:17:43 -0400 | [diff] [blame] | 216 | *boundsForMask, aa, |
| 217 | fit, args.fViewMatrix); |
| 218 | if (!proxy) { |
Brian Salomon | 0e8fc8b | 2016-12-09 15:10:07 -0500 | [diff] [blame] | 219 | return false; |
| 220 | } |
| 221 | if (useCache) { |
Robert Phillips | d374948 | 2017-03-14 09:17:43 -0400 | [diff] [blame] | 222 | fResourceProvider->assignUniqueKeyToProxy(maskKey, proxy.get()); |
Brian Salomon | 0e8fc8b | 2016-12-09 15:10:07 -0500 | [diff] [blame] | 223 | } |
bsalomon | 39ef7fb | 2016-09-21 11:16:05 -0700 | [diff] [blame] | 224 | } |
bsalomon | 8acedde | 2016-06-24 10:42:16 -0700 | [diff] [blame] | 225 | if (inverseFilled) { |
Brian Salomon | 82f4431 | 2017-01-11 13:42:54 -0500 | [diff] [blame] | 226 | DrawAroundInvPath(args.fRenderTargetContext, GrPaint(args.fPaint), |
| 227 | *args.fUserStencilSettings, *args.fClip, *args.fViewMatrix, devClipBounds, |
| 228 | unclippedDevShapeBounds); |
robertphillips@google.com | 5dfb672 | 2012-07-09 16:32:28 +0000 | [diff] [blame] | 229 | } |
Brian Salomon | 82f4431 | 2017-01-11 13:42:54 -0500 | [diff] [blame] | 230 | GrSWMaskHelper::DrawToTargetWithShapeMask( |
Robert Phillips | 296b1cc | 2017-03-15 10:42:12 -0400 | [diff] [blame] | 231 | std::move(proxy), args.fRenderTargetContext, std::move(args.fPaint), |
Brian Salomon | 82f4431 | 2017-01-11 13:42:54 -0500 | [diff] [blame] | 232 | *args.fUserStencilSettings, *args.fClip, *args.fViewMatrix, |
| 233 | SkIPoint{boundsForMask->fLeft, boundsForMask->fTop}, *boundsForMask); |
robertphillips@google.com | 5dfb672 | 2012-07-09 16:32:28 +0000 | [diff] [blame] | 234 | |
| 235 | return true; |
robertphillips@google.com | f4c2c52 | 2012-04-27 12:08:47 +0000 | [diff] [blame] | 236 | } |