joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [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 | |
Brian Salomon | 09e019e | 2016-12-15 10:20:35 -0500 | [diff] [blame] | 8 | #include "GrAtlasTextOp.h" |
Robert Phillips | e4fda6c | 2018-02-21 12:10:41 -0500 | [diff] [blame] | 9 | |
Robert Phillips | 296b1cc | 2017-03-15 10:42:12 -0400 | [diff] [blame] | 10 | #include "GrContext.h" |
Brian Salomon | 742e31d | 2016-12-07 17:06:19 -0500 | [diff] [blame] | 11 | #include "GrOpFlushState.h" |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 12 | #include "GrResourceProvider.h" |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 13 | #include "SkGlyphCache.h" |
halcanary | 4dbbd04 | 2016-06-07 17:21:10 -0700 | [diff] [blame] | 14 | #include "SkMathPriv.h" |
Brian Salomon | 5c6ac64 | 2017-12-19 11:09:32 -0500 | [diff] [blame] | 15 | #include "SkMatrixPriv.h" |
| 16 | #include "SkPoint3.h" |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 17 | #include "effects/GrBitmapTextGeoProc.h" |
| 18 | #include "effects/GrDistanceFieldGeoProc.h" |
Robert Phillips | acf1790 | 2018-02-27 16:43:18 -0500 | [diff] [blame] | 19 | #include "text/GrAtlasManager.h" |
| 20 | #include "text/GrGlyphCache.h" |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 21 | |
joshualitt | 60ce86d | 2015-11-23 13:08:22 -0800 | [diff] [blame] | 22 | /////////////////////////////////////////////////////////////////////////////////////////////////// |
| 23 | |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 24 | static const int kDistanceAdjustLumShift = 5; |
| 25 | |
Brian Salomon | 5c6ac64 | 2017-12-19 11:09:32 -0500 | [diff] [blame] | 26 | void GrAtlasTextOp::init() { |
| 27 | const Geometry& geo = fGeoData[0]; |
Brian Salomon | 5c6ac64 | 2017-12-19 11:09:32 -0500 | [diff] [blame] | 28 | SkRect bounds; |
| 29 | geo.fBlob->computeSubRunBounds(&bounds, geo.fRun, geo.fSubRun, geo.fViewMatrix, geo.fX, geo.fY); |
| 30 | // We don't have tight bounds on the glyph paths in device space. For the purposes of bounds |
| 31 | // we treat this as a set of non-AA rects rendered with a texture. |
| 32 | this->setBounds(bounds, HasAABloat::kNo, IsZeroArea::kNo); |
| 33 | if (this->usesDistanceFields()) { |
| 34 | bool isLCD = this->isLCD(); |
| 35 | |
| 36 | const SkMatrix& viewMatrix = geo.fViewMatrix; |
| 37 | |
| 38 | fDFGPFlags = viewMatrix.isSimilarity() ? kSimilarity_DistanceFieldEffectFlag : 0; |
| 39 | fDFGPFlags |= viewMatrix.isScaleTranslate() ? kScaleOnly_DistanceFieldEffectFlag : 0; |
| 40 | fDFGPFlags |= viewMatrix.hasPerspective() ? kPerspective_DistanceFieldEffectFlag : 0; |
| 41 | fDFGPFlags |= fUseGammaCorrectDistanceTable ? kGammaCorrect_DistanceFieldEffectFlag : 0; |
| 42 | fDFGPFlags |= (kAliasedDistanceField_MaskType == fMaskType) |
| 43 | ? kAliased_DistanceFieldEffectFlag |
| 44 | : 0; |
| 45 | |
| 46 | if (isLCD) { |
| 47 | fDFGPFlags |= kUseLCD_DistanceFieldEffectFlag; |
| 48 | fDFGPFlags |= |
| 49 | (kLCDBGRDistanceField_MaskType == fMaskType) ? kBGR_DistanceFieldEffectFlag : 0; |
| 50 | } |
| 51 | } |
| 52 | } |
| 53 | |
Robert Phillips | e4fda6c | 2018-02-21 12:10:41 -0500 | [diff] [blame] | 54 | void GrAtlasTextOp::visitProxies(const VisitProxyFunc& func) const { |
| 55 | fProcessors.visitProxies(func); |
| 56 | |
Robert Phillips | acf1790 | 2018-02-27 16:43:18 -0500 | [diff] [blame] | 57 | // We need to visit the atlasManager's proxies because, although the atlasManager explicitly |
| 58 | // manages their lifetimes, if they fail to allocate the draws that reference them need to |
| 59 | // be dropped. |
Robert Phillips | e4fda6c | 2018-02-21 12:10:41 -0500 | [diff] [blame] | 60 | unsigned int numProxies; |
Robert Phillips | acf1790 | 2018-02-27 16:43:18 -0500 | [diff] [blame] | 61 | const sk_sp<GrTextureProxy>* proxies = fRestrictedAtlasManager->getProxies( |
| 62 | this->maskFormat(), &numProxies); |
Robert Phillips | e4fda6c | 2018-02-21 12:10:41 -0500 | [diff] [blame] | 63 | for (unsigned int i = 0; i < numProxies; ++i) { |
| 64 | if (proxies[i]) { |
| 65 | func(proxies[i].get()); |
| 66 | } |
| 67 | } |
| 68 | } |
| 69 | |
Brian Salomon | 344ec42 | 2016-12-15 10:58:41 -0500 | [diff] [blame] | 70 | SkString GrAtlasTextOp::dumpInfo() const { |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 71 | SkString str; |
| 72 | |
| 73 | for (int i = 0; i < fGeoCount; ++i) { |
| 74 | str.appendf("%d: Color: 0x%08x Trans: %.2f,%.2f Runs: %d\n", |
| 75 | i, |
| 76 | fGeoData[i].fColor, |
joshualitt | 8e0ef29 | 2016-02-19 14:13:03 -0800 | [diff] [blame] | 77 | fGeoData[i].fX, |
| 78 | fGeoData[i].fY, |
joshualitt | ddd22d8 | 2016-02-16 06:47:52 -0800 | [diff] [blame] | 79 | fGeoData[i].fBlob->runCount()); |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 80 | } |
| 81 | |
Brian Salomon | 44acb5b | 2017-07-18 19:59:24 -0400 | [diff] [blame] | 82 | str += fProcessors.dumpProcessors(); |
| 83 | str += INHERITED::dumpInfo(); |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 84 | return str; |
| 85 | } |
| 86 | |
Brian Salomon | 44acb5b | 2017-07-18 19:59:24 -0400 | [diff] [blame] | 87 | GrDrawOp::FixedFunctionFlags GrAtlasTextOp::fixedFunctionFlags() const { |
| 88 | return FixedFunctionFlags::kNone; |
| 89 | } |
| 90 | |
| 91 | GrDrawOp::RequiresDstTexture GrAtlasTextOp::finalize(const GrCaps& caps, |
Brian Osman | 9a725dd | 2017-09-20 09:53:22 -0400 | [diff] [blame] | 92 | const GrAppliedClip* clip, |
| 93 | GrPixelConfigIsClamped dstIsClamped) { |
Brian Salomon | 44acb5b | 2017-07-18 19:59:24 -0400 | [diff] [blame] | 94 | GrProcessorAnalysisCoverage coverage; |
| 95 | GrProcessorAnalysisColor color; |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 96 | if (kColorBitmapMask_MaskType == fMaskType) { |
Brian Salomon | 44acb5b | 2017-07-18 19:59:24 -0400 | [diff] [blame] | 97 | color.setToUnknown(); |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 98 | } else { |
Brian Osman | 0906825 | 2018-01-03 09:57:29 -0500 | [diff] [blame] | 99 | color.setToConstant(this->color()); |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 100 | } |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 101 | switch (fMaskType) { |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 102 | case kGrayscaleCoverageMask_MaskType: |
Jim Van Verth | 90e89b3 | 2017-07-06 16:36:55 -0400 | [diff] [blame] | 103 | case kAliasedDistanceField_MaskType: |
| 104 | case kGrayscaleDistanceField_MaskType: |
Brian Salomon | 44acb5b | 2017-07-18 19:59:24 -0400 | [diff] [blame] | 105 | coverage = GrProcessorAnalysisCoverage::kSingleChannel; |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 106 | break; |
| 107 | case kLCDCoverageMask_MaskType: |
| 108 | case kLCDDistanceField_MaskType: |
Jim Van Verth | 90e89b3 | 2017-07-06 16:36:55 -0400 | [diff] [blame] | 109 | case kLCDBGRDistanceField_MaskType: |
Brian Salomon | 44acb5b | 2017-07-18 19:59:24 -0400 | [diff] [blame] | 110 | coverage = GrProcessorAnalysisCoverage::kLCD; |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 111 | break; |
| 112 | case kColorBitmapMask_MaskType: |
Brian Salomon | 44acb5b | 2017-07-18 19:59:24 -0400 | [diff] [blame] | 113 | coverage = GrProcessorAnalysisCoverage::kNone; |
Brian Salomon | c0b642c | 2017-03-27 13:09:36 -0400 | [diff] [blame] | 114 | break; |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 115 | } |
Brian Osman | 0906825 | 2018-01-03 09:57:29 -0500 | [diff] [blame] | 116 | auto analysis = fProcessors.finalize(color, coverage, clip, false, caps, dstIsClamped, |
| 117 | &fGeoData[0].fColor); |
Brian Salomon | 44acb5b | 2017-07-18 19:59:24 -0400 | [diff] [blame] | 118 | fUsesLocalCoords = analysis.usesLocalCoords(); |
| 119 | fCanCombineOnTouchOrOverlap = |
| 120 | !analysis.requiresDstTexture() && |
| 121 | !(fProcessors.xferProcessor() && fProcessors.xferProcessor()->xferBarrierType(caps)); |
| 122 | return analysis.requiresDstTexture() ? RequiresDstTexture::kYes : RequiresDstTexture::kNo; |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 123 | } |
| 124 | |
Brian Salomon | 18923f9 | 2017-11-06 16:26:02 -0500 | [diff] [blame] | 125 | static void clip_quads(const SkIRect& clipRect, char* currVertex, const char* blobVertices, |
Jim Van Verth | 58c3cce | 2017-10-19 15:50:24 -0400 | [diff] [blame] | 126 | size_t vertexStride, int glyphCount) { |
| 127 | for (int i = 0; i < glyphCount; ++i) { |
Brian Salomon | 18923f9 | 2017-11-06 16:26:02 -0500 | [diff] [blame] | 128 | const SkPoint* blobPositionLT = reinterpret_cast<const SkPoint*>(blobVertices); |
| 129 | const SkPoint* blobPositionRB = |
| 130 | reinterpret_cast<const SkPoint*>(blobVertices + 3 * vertexStride); |
Jim Van Verth | 58c3cce | 2017-10-19 15:50:24 -0400 | [diff] [blame] | 131 | |
Jim Van Verth | 328a33f | 2017-10-20 12:14:22 -0400 | [diff] [blame] | 132 | // positions for bitmap glyphs are pixel boundary aligned |
Brian Osman | 7ca90d2 | 2017-11-10 15:31:27 -0500 | [diff] [blame] | 133 | SkIRect positionRect = SkIRect::MakeLTRB(SkScalarRoundToInt(blobPositionLT->fX), |
| 134 | SkScalarRoundToInt(blobPositionLT->fY), |
| 135 | SkScalarRoundToInt(blobPositionRB->fX), |
| 136 | SkScalarRoundToInt(blobPositionRB->fY)); |
Jim Van Verth | 58c3cce | 2017-10-19 15:50:24 -0400 | [diff] [blame] | 137 | if (clipRect.contains(positionRect)) { |
| 138 | memcpy(currVertex, blobVertices, 4 * vertexStride); |
| 139 | currVertex += 4 * vertexStride; |
| 140 | } else { |
| 141 | // Pull out some more data that we'll need. |
| 142 | // In the LCD case the color will be garbage, but we'll overwrite it with the texcoords |
| 143 | // and it avoids a lot of conditionals. |
Brian Salomon | 18923f9 | 2017-11-06 16:26:02 -0500 | [diff] [blame] | 144 | auto color = *reinterpret_cast<const SkColor*>(blobVertices + sizeof(SkPoint)); |
Jim Van Verth | 328a33f | 2017-10-20 12:14:22 -0400 | [diff] [blame] | 145 | size_t coordOffset = vertexStride - 2*sizeof(uint16_t); |
Brian Salomon | 18923f9 | 2017-11-06 16:26:02 -0500 | [diff] [blame] | 146 | auto* blobCoordsLT = reinterpret_cast<const uint16_t*>(blobVertices + coordOffset); |
| 147 | auto* blobCoordsRB = reinterpret_cast<const uint16_t*>(blobVertices + 3 * vertexStride + |
| 148 | coordOffset); |
Jim Van Verth | 328a33f | 2017-10-20 12:14:22 -0400 | [diff] [blame] | 149 | // Pull out the texel coordinates and texture index bits |
| 150 | uint16_t coordsRectL = blobCoordsLT[0] >> 1; |
| 151 | uint16_t coordsRectT = blobCoordsLT[1] >> 1; |
| 152 | uint16_t coordsRectR = blobCoordsRB[0] >> 1; |
| 153 | uint16_t coordsRectB = blobCoordsRB[1] >> 1; |
| 154 | uint16_t pageIndexX = blobCoordsLT[0] & 0x1; |
| 155 | uint16_t pageIndexY = blobCoordsLT[1] & 0x1; |
Jim Van Verth | 58c3cce | 2017-10-19 15:50:24 -0400 | [diff] [blame] | 156 | |
Jim Van Verth | 328a33f | 2017-10-20 12:14:22 -0400 | [diff] [blame] | 157 | int positionRectWidth = positionRect.width(); |
| 158 | int positionRectHeight = positionRect.height(); |
| 159 | SkASSERT(positionRectWidth == (coordsRectR - coordsRectL)); |
| 160 | SkASSERT(positionRectHeight == (coordsRectB - coordsRectT)); |
Jim Van Verth | 58c3cce | 2017-10-19 15:50:24 -0400 | [diff] [blame] | 161 | |
| 162 | // Clip position and texCoords to the clipRect |
Jim Van Verth | 328a33f | 2017-10-20 12:14:22 -0400 | [diff] [blame] | 163 | unsigned int delta; |
| 164 | delta = SkTMin(SkTMax(clipRect.fLeft - positionRect.fLeft, 0), positionRectWidth); |
| 165 | coordsRectL += delta; |
| 166 | positionRect.fLeft += delta; |
Jim Van Verth | 58c3cce | 2017-10-19 15:50:24 -0400 | [diff] [blame] | 167 | |
Jim Van Verth | 328a33f | 2017-10-20 12:14:22 -0400 | [diff] [blame] | 168 | delta = SkTMin(SkTMax(clipRect.fTop - positionRect.fTop, 0), positionRectHeight); |
| 169 | coordsRectT += delta; |
| 170 | positionRect.fTop += delta; |
| 171 | |
| 172 | delta = SkTMin(SkTMax(positionRect.fRight - clipRect.fRight, 0), positionRectWidth); |
| 173 | coordsRectR -= delta; |
| 174 | positionRect.fRight -= delta; |
| 175 | |
| 176 | delta = SkTMin(SkTMax(positionRect.fBottom - clipRect.fBottom, 0), positionRectHeight); |
| 177 | coordsRectB -= delta; |
| 178 | positionRect.fBottom -= delta; |
| 179 | |
| 180 | // Repack texel coordinates and index |
| 181 | coordsRectL = coordsRectL << 1 | pageIndexX; |
| 182 | coordsRectT = coordsRectT << 1 | pageIndexY; |
| 183 | coordsRectR = coordsRectR << 1 | pageIndexX; |
| 184 | coordsRectB = coordsRectB << 1 | pageIndexY; |
| 185 | |
| 186 | // Set new positions and coords |
Jim Van Verth | 58c3cce | 2017-10-19 15:50:24 -0400 | [diff] [blame] | 187 | SkPoint* currPosition = reinterpret_cast<SkPoint*>(currVertex); |
| 188 | currPosition->fX = positionRect.fLeft; |
| 189 | currPosition->fY = positionRect.fTop; |
| 190 | *(reinterpret_cast<SkColor*>(currVertex + sizeof(SkPoint))) = color; |
Jim Van Verth | 328a33f | 2017-10-20 12:14:22 -0400 | [diff] [blame] | 191 | uint16_t* currCoords = reinterpret_cast<uint16_t*>(currVertex + coordOffset); |
| 192 | currCoords[0] = coordsRectL; |
| 193 | currCoords[1] = coordsRectT; |
Jim Van Verth | 58c3cce | 2017-10-19 15:50:24 -0400 | [diff] [blame] | 194 | currVertex += vertexStride; |
| 195 | |
| 196 | currPosition = reinterpret_cast<SkPoint*>(currVertex); |
| 197 | currPosition->fX = positionRect.fLeft; |
| 198 | currPosition->fY = positionRect.fBottom; |
| 199 | *(reinterpret_cast<SkColor*>(currVertex + sizeof(SkPoint))) = color; |
Jim Van Verth | 328a33f | 2017-10-20 12:14:22 -0400 | [diff] [blame] | 200 | currCoords = reinterpret_cast<uint16_t*>(currVertex + coordOffset); |
| 201 | currCoords[0] = coordsRectL; |
| 202 | currCoords[1] = coordsRectB; |
Jim Van Verth | 58c3cce | 2017-10-19 15:50:24 -0400 | [diff] [blame] | 203 | currVertex += vertexStride; |
| 204 | |
| 205 | currPosition = reinterpret_cast<SkPoint*>(currVertex); |
| 206 | currPosition->fX = positionRect.fRight; |
| 207 | currPosition->fY = positionRect.fTop; |
| 208 | *(reinterpret_cast<SkColor*>(currVertex + sizeof(SkPoint))) = color; |
Jim Van Verth | 328a33f | 2017-10-20 12:14:22 -0400 | [diff] [blame] | 209 | currCoords = reinterpret_cast<uint16_t*>(currVertex + coordOffset); |
| 210 | currCoords[0] = coordsRectR; |
| 211 | currCoords[1] = coordsRectT; |
Jim Van Verth | 58c3cce | 2017-10-19 15:50:24 -0400 | [diff] [blame] | 212 | currVertex += vertexStride; |
| 213 | |
| 214 | currPosition = reinterpret_cast<SkPoint*>(currVertex); |
| 215 | currPosition->fX = positionRect.fRight; |
| 216 | currPosition->fY = positionRect.fBottom; |
| 217 | *(reinterpret_cast<SkColor*>(currVertex + sizeof(SkPoint))) = color; |
Jim Van Verth | 328a33f | 2017-10-20 12:14:22 -0400 | [diff] [blame] | 218 | currCoords = reinterpret_cast<uint16_t*>(currVertex + coordOffset); |
| 219 | currCoords[0] = coordsRectR; |
| 220 | currCoords[1] = coordsRectB; |
Jim Van Verth | 58c3cce | 2017-10-19 15:50:24 -0400 | [diff] [blame] | 221 | currVertex += vertexStride; |
| 222 | } |
| 223 | |
| 224 | blobVertices += 4 * vertexStride; |
| 225 | } |
| 226 | } |
| 227 | |
Brian Salomon | 91326c3 | 2017-08-09 16:02:19 -0400 | [diff] [blame] | 228 | void GrAtlasTextOp::onPrepareDraws(Target* target) { |
Robert Phillips | 934c3d0 | 2018-02-26 16:49:16 +0000 | [diff] [blame] | 229 | auto resourceProvider = target->resourceProvider(); |
| 230 | |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 231 | // if we have RGB, then we won't have any SkShaders so no need to use a localmatrix. |
| 232 | // TODO actually only invert if we don't have RGBA |
| 233 | SkMatrix localMatrix; |
Brian Salomon | 5c6ac64 | 2017-12-19 11:09:32 -0500 | [diff] [blame] | 234 | if (this->usesLocalCoords() && !fGeoData[0].fViewMatrix.invert(&localMatrix)) { |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 235 | SkDebugf("Cannot invert viewmatrix\n"); |
| 236 | return; |
| 237 | } |
| 238 | |
Robert Phillips | acf1790 | 2018-02-27 16:43:18 -0500 | [diff] [blame] | 239 | GrAtlasManager* fullAtlasManager = target->fullAtlasManager(); |
| 240 | SkASSERT(fRestrictedAtlasManager == fullAtlasManager); |
| 241 | GrGlyphCache* glyphCache = target->glyphCache(); |
| 242 | |
Jim Van Verth | eafa64b | 2017-09-18 10:05:00 -0400 | [diff] [blame] | 243 | GrMaskFormat maskFormat = this->maskFormat(); |
| 244 | |
Robert Phillips | f3690dd | 2018-02-20 15:18:59 -0500 | [diff] [blame] | 245 | unsigned int atlasPageCount; |
Robert Phillips | acf1790 | 2018-02-27 16:43:18 -0500 | [diff] [blame] | 246 | const sk_sp<GrTextureProxy>* proxies = fullAtlasManager->getProxies(maskFormat, |
| 247 | &atlasPageCount); |
Robert Phillips | 934c3d0 | 2018-02-26 16:49:16 +0000 | [diff] [blame] | 248 | if (!proxies[0]) { |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 249 | SkDebugf("Could not allocate backing texture for atlas\n"); |
| 250 | return; |
| 251 | } |
| 252 | |
bsalomon | 342bfc2 | 2016-04-01 06:06:20 -0700 | [diff] [blame] | 253 | FlushInfo flushInfo; |
Brian Salomon | bfd18cd | 2017-08-09 16:27:09 -0400 | [diff] [blame] | 254 | flushInfo.fPipeline = |
| 255 | target->makePipeline(fSRGBFlags, std::move(fProcessors), target->detachAppliedClip()); |
Brian Salomon | 5c6ac64 | 2017-12-19 11:09:32 -0500 | [diff] [blame] | 256 | SkDEBUGCODE(bool dfPerspective = false); |
joshualitt | d9d30f7 | 2015-12-08 10:47:55 -0800 | [diff] [blame] | 257 | if (this->usesDistanceFields()) { |
Robert Phillips | acf1790 | 2018-02-27 16:43:18 -0500 | [diff] [blame] | 258 | flushInfo.fGeometryProcessor = this->setupDfProcessor(fullAtlasManager); |
Brian Salomon | 5c6ac64 | 2017-12-19 11:09:32 -0500 | [diff] [blame] | 259 | SkDEBUGCODE(dfPerspective = fGeoData[0].fViewMatrix.hasPerspective()); |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 260 | } else { |
Brian Salomon | 2bbdcc4 | 2017-09-07 12:36:34 -0400 | [diff] [blame] | 261 | flushInfo.fGeometryProcessor = GrBitmapTextGeoProc::Make( |
Jim Van Verth | eafa64b | 2017-09-18 10:05:00 -0400 | [diff] [blame] | 262 | this->color(), proxies, GrSamplerState::ClampNearest(), maskFormat, |
| 263 | localMatrix, this->usesLocalCoords()); |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 264 | } |
| 265 | |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 266 | flushInfo.fGlyphsToFlush = 0; |
bsalomon | 342bfc2 | 2016-04-01 06:06:20 -0700 | [diff] [blame] | 267 | size_t vertexStride = flushInfo.fGeometryProcessor->getVertexStride(); |
Brian Salomon | 5c6ac64 | 2017-12-19 11:09:32 -0500 | [diff] [blame] | 268 | SkASSERT(vertexStride == GrAtlasTextBlob::GetVertexStride(maskFormat, dfPerspective)); |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 269 | |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 270 | int glyphCount = this->numGlyphs(); |
cdalton | 397536c | 2016-03-25 12:15:03 -0700 | [diff] [blame] | 271 | const GrBuffer* vertexBuffer; |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 272 | |
Brian Salomon | 344ec42 | 2016-12-15 10:58:41 -0500 | [diff] [blame] | 273 | void* vertices = target->makeVertexSpace( |
| 274 | vertexStride, glyphCount * kVerticesPerGlyph, &vertexBuffer, &flushInfo.fVertexOffset); |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 275 | flushInfo.fVertexBuffer.reset(SkRef(vertexBuffer)); |
Brian Salomon | d28a79d | 2017-10-16 13:01:07 -0400 | [diff] [blame] | 276 | flushInfo.fIndexBuffer = target->resourceProvider()->refQuadIndexBuffer(); |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 277 | if (!vertices || !flushInfo.fVertexBuffer) { |
| 278 | SkDebugf("Could not allocate vertices\n"); |
| 279 | return; |
| 280 | } |
| 281 | |
Brian Salomon | 18923f9 | 2017-11-06 16:26:02 -0500 | [diff] [blame] | 282 | char* currVertex = reinterpret_cast<char*>(vertices); |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 283 | |
Robert Phillips | acf1790 | 2018-02-27 16:43:18 -0500 | [diff] [blame] | 284 | SkAutoGlyphCache autoGlyphCache; |
Jim Van Verth | 58c3cce | 2017-10-19 15:50:24 -0400 | [diff] [blame] | 285 | // each of these is a SubRun |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 286 | for (int i = 0; i < fGeoCount; i++) { |
joshualitt | 144c3c8 | 2015-11-30 12:30:13 -0800 | [diff] [blame] | 287 | const Geometry& args = fGeoData[i]; |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 288 | Blob* blob = args.fBlob; |
Brian Salomon | 18923f9 | 2017-11-06 16:26:02 -0500 | [diff] [blame] | 289 | GrAtlasTextBlob::VertexRegenerator regenerator( |
Robert Phillips | 934c3d0 | 2018-02-26 16:49:16 +0000 | [diff] [blame] | 290 | resourceProvider, blob, args.fRun, args.fSubRun, args.fViewMatrix, args.fX, args.fY, |
Robert Phillips | acf1790 | 2018-02-27 16:43:18 -0500 | [diff] [blame] | 291 | args.fColor, target->deferredUploadTarget(), glyphCache, fullAtlasManager, |
| 292 | &autoGlyphCache); |
Brian Salomon | 18923f9 | 2017-11-06 16:26:02 -0500 | [diff] [blame] | 293 | GrAtlasTextBlob::VertexRegenerator::Result result; |
| 294 | do { |
| 295 | result = regenerator.regenerate(); |
| 296 | // Copy regenerated vertices from the blob to our vertex buffer. |
| 297 | size_t vertexBytes = result.fGlyphsRegenerated * kVerticesPerGlyph * vertexStride; |
| 298 | if (args.fClipRect.isEmpty()) { |
| 299 | memcpy(currVertex, result.fFirstVertex, vertexBytes); |
| 300 | } else { |
Brian Salomon | 5c6ac64 | 2017-12-19 11:09:32 -0500 | [diff] [blame] | 301 | SkASSERT(!dfPerspective); |
Brian Salomon | 18923f9 | 2017-11-06 16:26:02 -0500 | [diff] [blame] | 302 | clip_quads(args.fClipRect, currVertex, result.fFirstVertex, vertexStride, |
| 303 | result.fGlyphsRegenerated); |
| 304 | } |
Brian Salomon | 5c6ac64 | 2017-12-19 11:09:32 -0500 | [diff] [blame] | 305 | if (this->usesDistanceFields() && !args.fViewMatrix.isIdentity()) { |
| 306 | // We always do the distance field view matrix transformation after copying rather |
| 307 | // than during blob vertex generation time in the blob as handling successive |
| 308 | // arbitrary transformations would be complicated and accumulate error. |
| 309 | if (args.fViewMatrix.hasPerspective()) { |
| 310 | auto* pos = reinterpret_cast<SkPoint3*>(currVertex); |
Brian Salomon | 7c2192b | 2018-01-08 09:47:57 -0500 | [diff] [blame] | 311 | SkMatrixPriv::MapHomogeneousPointsWithStride( |
| 312 | args.fViewMatrix, pos, vertexStride, pos, vertexStride, |
| 313 | result.fGlyphsRegenerated * kVerticesPerGlyph); |
Brian Salomon | 5c6ac64 | 2017-12-19 11:09:32 -0500 | [diff] [blame] | 314 | } else { |
| 315 | auto* pos = reinterpret_cast<SkPoint*>(currVertex); |
Brian Salomon | fa3783f | 2018-01-05 13:49:07 -0500 | [diff] [blame] | 316 | SkMatrixPriv::MapPointsWithStride( |
| 317 | args.fViewMatrix, pos, vertexStride, |
| 318 | result.fGlyphsRegenerated * kVerticesPerGlyph); |
Brian Salomon | 5c6ac64 | 2017-12-19 11:09:32 -0500 | [diff] [blame] | 319 | } |
| 320 | } |
Brian Salomon | 18923f9 | 2017-11-06 16:26:02 -0500 | [diff] [blame] | 321 | flushInfo.fGlyphsToFlush += result.fGlyphsRegenerated; |
| 322 | if (!result.fFinished) { |
| 323 | this->flush(target, &flushInfo); |
| 324 | } |
| 325 | currVertex += vertexBytes; |
| 326 | } while (!result.fFinished); |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 327 | } |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 328 | this->flush(target, &flushInfo); |
| 329 | } |
| 330 | |
Brian Salomon | e5b399e | 2017-07-19 13:50:54 -0400 | [diff] [blame] | 331 | void GrAtlasTextOp::flush(GrMeshDrawOp::Target* target, FlushInfo* flushInfo) const { |
Robert Phillips | acf1790 | 2018-02-27 16:43:18 -0500 | [diff] [blame] | 332 | auto fullAtlasManager = target->fullAtlasManager(); |
| 333 | SkASSERT(fRestrictedAtlasManager == fullAtlasManager); |
| 334 | |
Jim Van Verth | eafa64b | 2017-09-18 10:05:00 -0400 | [diff] [blame] | 335 | GrGeometryProcessor* gp = flushInfo->fGeometryProcessor.get(); |
| 336 | GrMaskFormat maskFormat = this->maskFormat(); |
Robert Phillips | f3690dd | 2018-02-20 15:18:59 -0500 | [diff] [blame] | 337 | |
| 338 | unsigned int numProxies; |
Robert Phillips | acf1790 | 2018-02-27 16:43:18 -0500 | [diff] [blame] | 339 | const sk_sp<GrTextureProxy>* proxies = fullAtlasManager->getProxies(maskFormat, &numProxies); |
Robert Phillips | f3690dd | 2018-02-20 15:18:59 -0500 | [diff] [blame] | 340 | if (gp->numTextureSamplers() != (int) numProxies) { |
Jim Van Verth | eafa64b | 2017-09-18 10:05:00 -0400 | [diff] [blame] | 341 | // During preparation the number of atlas pages has increased. |
| 342 | // Update the proxies used in the GP to match. |
| 343 | if (this->usesDistanceFields()) { |
| 344 | if (this->isLCD()) { |
| 345 | reinterpret_cast<GrDistanceFieldLCDTextGeoProc*>(gp)->addNewProxies( |
Robert Phillips | f3690dd | 2018-02-20 15:18:59 -0500 | [diff] [blame] | 346 | proxies, GrSamplerState::ClampBilerp()); |
Jim Van Verth | eafa64b | 2017-09-18 10:05:00 -0400 | [diff] [blame] | 347 | } else { |
| 348 | reinterpret_cast<GrDistanceFieldA8TextGeoProc*>(gp)->addNewProxies( |
Robert Phillips | f3690dd | 2018-02-20 15:18:59 -0500 | [diff] [blame] | 349 | proxies, GrSamplerState::ClampBilerp()); |
Jim Van Verth | eafa64b | 2017-09-18 10:05:00 -0400 | [diff] [blame] | 350 | } |
| 351 | } else { |
| 352 | reinterpret_cast<GrBitmapTextGeoProc*>(gp)->addNewProxies( |
Robert Phillips | f3690dd | 2018-02-20 15:18:59 -0500 | [diff] [blame] | 353 | proxies, GrSamplerState::ClampNearest()); |
Jim Van Verth | eafa64b | 2017-09-18 10:05:00 -0400 | [diff] [blame] | 354 | } |
| 355 | } |
| 356 | |
Chris Dalton | 3809bab | 2017-06-13 10:55:06 -0600 | [diff] [blame] | 357 | GrMesh mesh(GrPrimitiveType::kTriangles); |
cdalton | 397536c | 2016-03-25 12:15:03 -0700 | [diff] [blame] | 358 | int maxGlyphsPerDraw = |
Brian Salomon | 344ec42 | 2016-12-15 10:58:41 -0500 | [diff] [blame] | 359 | static_cast<int>(flushInfo->fIndexBuffer->gpuMemorySize() / sizeof(uint16_t) / 6); |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 360 | mesh.setIndexedPatterned(flushInfo->fIndexBuffer.get(), kIndicesPerGlyph, kVerticesPerGlyph, |
Chris Dalton | bca46e2 | 2017-05-15 11:03:26 -0600 | [diff] [blame] | 361 | flushInfo->fGlyphsToFlush, maxGlyphsPerDraw); |
Chris Dalton | 114a3c0 | 2017-05-26 15:17:19 -0600 | [diff] [blame] | 362 | mesh.setVertexData(flushInfo->fVertexBuffer.get(), flushInfo->fVertexOffset); |
Brian Salomon | 44acb5b | 2017-07-18 19:59:24 -0400 | [diff] [blame] | 363 | target->draw(flushInfo->fGeometryProcessor.get(), flushInfo->fPipeline, mesh); |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 364 | flushInfo->fVertexOffset += kVerticesPerGlyph * flushInfo->fGlyphsToFlush; |
| 365 | flushInfo->fGlyphsToFlush = 0; |
| 366 | } |
| 367 | |
Brian Salomon | 344ec42 | 2016-12-15 10:58:41 -0500 | [diff] [blame] | 368 | bool GrAtlasTextOp::onCombineIfPossible(GrOp* t, const GrCaps& caps) { |
| 369 | GrAtlasTextOp* that = t->cast<GrAtlasTextOp>(); |
Brian Salomon | 44acb5b | 2017-07-18 19:59:24 -0400 | [diff] [blame] | 370 | if (fProcessors != that->fProcessors) { |
| 371 | return false; |
| 372 | } |
| 373 | |
| 374 | if (!fCanCombineOnTouchOrOverlap && GrRectsTouchOrOverlap(this->bounds(), that->bounds())) { |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 375 | return false; |
| 376 | } |
| 377 | |
| 378 | if (fMaskType != that->fMaskType) { |
| 379 | return false; |
| 380 | } |
| 381 | |
Brian Salomon | 5c6ac64 | 2017-12-19 11:09:32 -0500 | [diff] [blame] | 382 | const SkMatrix& thisFirstMatrix = fGeoData[0].fViewMatrix; |
| 383 | const SkMatrix& thatFirstMatrix = that->fGeoData[0].fViewMatrix; |
| 384 | |
| 385 | if (this->usesLocalCoords() && !thisFirstMatrix.cheapEqualTo(thatFirstMatrix)) { |
| 386 | return false; |
| 387 | } |
| 388 | |
| 389 | if (this->usesDistanceFields()) { |
| 390 | if (fDFGPFlags != that->fDFGPFlags) { |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 391 | return false; |
| 392 | } |
| 393 | |
Jim Van Verth | bc2cdd1 | 2017-06-08 11:14:35 -0400 | [diff] [blame] | 394 | if (fLuminanceColor != that->fLuminanceColor) { |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 395 | return false; |
| 396 | } |
Brian Salomon | 5c6ac64 | 2017-12-19 11:09:32 -0500 | [diff] [blame] | 397 | } else { |
| 398 | if (kColorBitmapMask_MaskType == fMaskType && this->color() != that->color()) { |
| 399 | return false; |
| 400 | } |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 401 | } |
| 402 | |
Jim Van Verth | c8a65e3 | 2017-10-25 14:25:27 -0400 | [diff] [blame] | 403 | // Keep the batch vertex buffer size below 32K so we don't have to create a special one |
| 404 | // We use the largest possible vertex size for this |
| 405 | static const int kVertexSize = sizeof(SkPoint) + sizeof(SkColor) + 2 * sizeof(uint16_t); |
Jim Van Verth | 56c3714 | 2017-10-31 14:44:25 -0400 | [diff] [blame] | 406 | static const int kMaxGlyphs = 32768 / (kVerticesPerGlyph * kVertexSize); |
Jim Van Verth | c8a65e3 | 2017-10-25 14:25:27 -0400 | [diff] [blame] | 407 | if (this->fNumGlyphs + that->fNumGlyphs > kMaxGlyphs) { |
| 408 | return false; |
| 409 | } |
| 410 | |
Brian Salomon | 344ec42 | 2016-12-15 10:58:41 -0500 | [diff] [blame] | 411 | fNumGlyphs += that->numGlyphs(); |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 412 | |
Jim Van Verth | 56c3714 | 2017-10-31 14:44:25 -0400 | [diff] [blame] | 413 | // Reallocate space for geo data if necessary and then import that geo's data. |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 414 | int newGeoCount = that->fGeoCount + fGeoCount; |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 415 | |
Jim Van Verth | c8a65e3 | 2017-10-25 14:25:27 -0400 | [diff] [blame] | 416 | // We reallocate at a rate of 1.5x to try to get better total memory usage |
| 417 | if (newGeoCount > fGeoDataAllocSize) { |
Jim Van Verth | 56c3714 | 2017-10-31 14:44:25 -0400 | [diff] [blame] | 418 | int newAllocSize = fGeoDataAllocSize + fGeoDataAllocSize / 2; |
Jim Van Verth | c8a65e3 | 2017-10-25 14:25:27 -0400 | [diff] [blame] | 419 | while (newAllocSize < newGeoCount) { |
| 420 | newAllocSize += newAllocSize / 2; |
| 421 | } |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 422 | fGeoData.realloc(newAllocSize); |
Jim Van Verth | c8a65e3 | 2017-10-25 14:25:27 -0400 | [diff] [blame] | 423 | fGeoDataAllocSize = newAllocSize; |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 424 | } |
| 425 | |
Brian Salomon | 344ec42 | 2016-12-15 10:58:41 -0500 | [diff] [blame] | 426 | // We steal the ref on the blobs from the other AtlasTextOp and set its count to 0 so that |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 427 | // it doesn't try to unref them. |
Brian Salomon | 344ec42 | 2016-12-15 10:58:41 -0500 | [diff] [blame] | 428 | memcpy(&fGeoData[fGeoCount], that->fGeoData.get(), that->fGeoCount * sizeof(Geometry)); |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 429 | #ifdef SK_DEBUG |
| 430 | for (int i = 0; i < that->fGeoCount; ++i) { |
| 431 | that->fGeoData.get()[i].fBlob = (Blob*)0x1; |
| 432 | } |
| 433 | #endif |
| 434 | that->fGeoCount = 0; |
| 435 | fGeoCount = newGeoCount; |
| 436 | |
bsalomon | 88cf17d | 2016-07-08 06:40:56 -0700 | [diff] [blame] | 437 | this->joinBounds(*that); |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 438 | return true; |
| 439 | } |
| 440 | |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 441 | // TODO trying to figure out why lcd is so whack |
Jim Van Verth | 58c3cce | 2017-10-19 15:50:24 -0400 | [diff] [blame] | 442 | // (see comments in GrAtlasTextContext::ComputeCanonicalColor) |
Robert Phillips | acf1790 | 2018-02-27 16:43:18 -0500 | [diff] [blame] | 443 | sk_sp<GrGeometryProcessor> GrAtlasTextOp::setupDfProcessor( |
| 444 | GrRestrictedAtlasManager* restrictedAtlasManager) const { |
Robert Phillips | f3690dd | 2018-02-20 15:18:59 -0500 | [diff] [blame] | 445 | unsigned int numProxies; |
Robert Phillips | acf1790 | 2018-02-27 16:43:18 -0500 | [diff] [blame] | 446 | const sk_sp<GrTextureProxy>* p = restrictedAtlasManager->getProxies(this->maskFormat(), |
| 447 | &numProxies); |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 448 | bool isLCD = this->isLCD(); |
Brian Salomon | 5c6ac64 | 2017-12-19 11:09:32 -0500 | [diff] [blame] | 449 | |
| 450 | SkMatrix localMatrix = SkMatrix::I(); |
| 451 | if (this->usesLocalCoords()) { |
| 452 | // If this fails we'll just use I(). |
| 453 | bool result = fGeoData[0].fViewMatrix.invert(&localMatrix); |
| 454 | (void)result; |
| 455 | } |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 456 | |
| 457 | // see if we need to create a new effect |
| 458 | if (isLCD) { |
brianosman | 0586f5c | 2016-04-12 12:48:21 -0700 | [diff] [blame] | 459 | float redCorrection = fDistanceAdjustTable->getAdjustment( |
Jim Van Verth | 58c3cce | 2017-10-19 15:50:24 -0400 | [diff] [blame] | 460 | SkColorGetR(fLuminanceColor) >> kDistanceAdjustLumShift, |
Brian Salomon | 344ec42 | 2016-12-15 10:58:41 -0500 | [diff] [blame] | 461 | fUseGammaCorrectDistanceTable); |
brianosman | 0586f5c | 2016-04-12 12:48:21 -0700 | [diff] [blame] | 462 | float greenCorrection = fDistanceAdjustTable->getAdjustment( |
Jim Van Verth | 58c3cce | 2017-10-19 15:50:24 -0400 | [diff] [blame] | 463 | SkColorGetG(fLuminanceColor) >> kDistanceAdjustLumShift, |
Brian Salomon | 344ec42 | 2016-12-15 10:58:41 -0500 | [diff] [blame] | 464 | fUseGammaCorrectDistanceTable); |
brianosman | 0586f5c | 2016-04-12 12:48:21 -0700 | [diff] [blame] | 465 | float blueCorrection = fDistanceAdjustTable->getAdjustment( |
Jim Van Verth | 58c3cce | 2017-10-19 15:50:24 -0400 | [diff] [blame] | 466 | SkColorGetB(fLuminanceColor) >> kDistanceAdjustLumShift, |
Brian Salomon | 344ec42 | 2016-12-15 10:58:41 -0500 | [diff] [blame] | 467 | fUseGammaCorrectDistanceTable); |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 468 | GrDistanceFieldLCDTextGeoProc::DistanceAdjust widthAdjust = |
Brian Salomon | 344ec42 | 2016-12-15 10:58:41 -0500 | [diff] [blame] | 469 | GrDistanceFieldLCDTextGeoProc::DistanceAdjust::Make( |
| 470 | redCorrection, greenCorrection, blueCorrection); |
Brian Osman | 0906825 | 2018-01-03 09:57:29 -0500 | [diff] [blame] | 471 | return GrDistanceFieldLCDTextGeoProc::Make(p, GrSamplerState::ClampBilerp(), widthAdjust, |
| 472 | fDFGPFlags, localMatrix); |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 473 | } else { |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 474 | #ifdef SK_GAMMA_APPLY_TO_A8 |
Jim Van Verth | 90e89b3 | 2017-07-06 16:36:55 -0400 | [diff] [blame] | 475 | float correction = 0; |
| 476 | if (kAliasedDistanceField_MaskType != fMaskType) { |
Jim Van Verth | 58c3cce | 2017-10-19 15:50:24 -0400 | [diff] [blame] | 477 | U8CPU lum = SkColorSpaceLuminance::computeLuminance(SK_GAMMA_EXPONENT, |
| 478 | fLuminanceColor); |
Jim Van Verth | 90e89b3 | 2017-07-06 16:36:55 -0400 | [diff] [blame] | 479 | correction = fDistanceAdjustTable->getAdjustment(lum >> kDistanceAdjustLumShift, |
| 480 | fUseGammaCorrectDistanceTable); |
| 481 | } |
Brian Osman | 0906825 | 2018-01-03 09:57:29 -0500 | [diff] [blame] | 482 | return GrDistanceFieldA8TextGeoProc::Make(p, GrSamplerState::ClampBilerp(), |
Brian Salomon | 5c6ac64 | 2017-12-19 11:09:32 -0500 | [diff] [blame] | 483 | correction, fDFGPFlags, localMatrix); |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 484 | #else |
Brian Osman | 0906825 | 2018-01-03 09:57:29 -0500 | [diff] [blame] | 485 | return GrDistanceFieldA8TextGeoProc::Make(p, GrSamplerState::ClampBilerp(), |
Brian Salomon | 5c6ac64 | 2017-12-19 11:09:32 -0500 | [diff] [blame] | 486 | fDFGPFlags, localMatrix); |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 487 | #endif |
| 488 | } |
joshualitt | a751c97 | 2015-11-20 13:37:32 -0800 | [diff] [blame] | 489 | } |
joshualitt | ddd22d8 | 2016-02-16 06:47:52 -0800 | [diff] [blame] | 490 | |