reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 1 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 2 | * Copyright 2010 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. |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 9 | |
tomhudson@google.com | 375ff85 | 2012-06-29 18:37:57 +0000 | [diff] [blame] | 10 | #include "GrTextContext.h" |
bsalomon@google.com | 86afc2a | 2011-02-16 16:12:19 +0000 | [diff] [blame] | 11 | #include "GrAtlas.h" |
| 12 | #include "GrContext.h" |
bsalomon@google.com | f4a9c82 | 2012-03-16 14:02:46 +0000 | [diff] [blame] | 13 | #include "GrDrawTarget.h" |
| 14 | #include "GrFontScaler.h" |
tomhudson@google.com | 375ff85 | 2012-06-29 18:37:57 +0000 | [diff] [blame] | 15 | #include "GrIndexBuffer.h" |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 16 | #include "GrTextStrike.h" |
| 17 | #include "GrTextStrike_impl.h" |
tomhudson@google.com | 375ff85 | 2012-06-29 18:37:57 +0000 | [diff] [blame] | 18 | #include "SkPath.h" |
sugoi@google.com | 5f74cf8 | 2012-12-17 21:16:45 +0000 | [diff] [blame] | 19 | #include "SkStrokeRec.h" |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 20 | |
bsalomon@google.com | c781888 | 2013-03-20 19:19:53 +0000 | [diff] [blame^] | 21 | // glyph rendering shares this stage with edge rendering (kEdgeEffectStage in GrContext) && SW path |
| 22 | // rendering (kPathMaskStage in GrSWMaskHelper) |
| 23 | static const int kGlyphMaskStage = GrPaint::kTotalStages; |
| 24 | static const int kGlyphCoordsAttributeIndex = 1; |
tomhudson@google.com | 375ff85 | 2012-06-29 18:37:57 +0000 | [diff] [blame] | 25 | |
| 26 | void GrTextContext::flushGlyphs() { |
tomhudson@google.com | cb325ce | 2012-07-11 14:41:19 +0000 | [diff] [blame] | 27 | if (NULL == fDrawTarget) { |
| 28 | return; |
| 29 | } |
| 30 | GrDrawState* drawState = fDrawTarget->drawState(); |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 31 | if (fCurrVertex > 0) { |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 32 | // setup our sampler state for our text texture/atlas |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 33 | GrAssert(GrIsALIGN4(fCurrVertex)); |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 34 | GrAssert(fCurrTexture); |
bsalomon@google.com | 0e354aa | 2012-10-08 20:44:25 +0000 | [diff] [blame] | 35 | GrTextureParams params(SkShader::kRepeat_TileMode, false); |
bsalomon@google.com | c781888 | 2013-03-20 19:19:53 +0000 | [diff] [blame^] | 36 | |
| 37 | // This effect could be stored with one of the cache objects (atlas?) |
| 38 | drawState->setEffect(kGlyphMaskStage, |
| 39 | GrSimpleTextureEffect::CreateWithCustomCoords(fCurrTexture, params), |
| 40 | kGlyphCoordsAttributeIndex)->unref(); |
bsalomon@google.com | 080773c | 2011-03-15 19:09:25 +0000 | [diff] [blame] | 41 | |
bsalomon@google.com | 669fdc4 | 2011-04-05 17:08:27 +0000 | [diff] [blame] | 42 | if (!GrPixelConfigIsAlphaOnly(fCurrTexture->config())) { |
bsalomon@google.com | c7448ce | 2012-10-05 19:04:13 +0000 | [diff] [blame] | 43 | if (kOne_GrBlendCoeff != fPaint.getSrcBlendCoeff() || |
| 44 | kISA_GrBlendCoeff != fPaint.getDstBlendCoeff() || |
bsalomon@google.com | 88becf4 | 2012-10-05 14:54:42 +0000 | [diff] [blame] | 45 | fPaint.hasColorStage()) { |
bsalomon@google.com | 080773c | 2011-03-15 19:09:25 +0000 | [diff] [blame] | 46 | GrPrintf("LCD Text will not draw correctly.\n"); |
| 47 | } |
| 48 | // setup blend so that we get mask * paintColor + (1-mask)*dstColor |
bsalomon@google.com | c7448ce | 2012-10-05 19:04:13 +0000 | [diff] [blame] | 49 | drawState->setBlendConstant(fPaint.getColor()); |
bsalomon@google.com | 4705954 | 2012-06-06 20:51:20 +0000 | [diff] [blame] | 50 | drawState->setBlendFunc(kConstC_GrBlendCoeff, kISC_GrBlendCoeff); |
bsalomon@google.com | 080773c | 2011-03-15 19:09:25 +0000 | [diff] [blame] | 51 | // don't modulate by the paint's color in the frag since we're |
| 52 | // already doing it via the blend const. |
bsalomon@google.com | 8f9cbd6 | 2011-12-09 15:55:34 +0000 | [diff] [blame] | 53 | drawState->setColor(0xffffffff); |
bsalomon@google.com | 080773c | 2011-03-15 19:09:25 +0000 | [diff] [blame] | 54 | } else { |
| 55 | // set back to normal in case we took LCD path previously. |
bsalomon@google.com | c7448ce | 2012-10-05 19:04:13 +0000 | [diff] [blame] | 56 | drawState->setBlendFunc(fPaint.getSrcBlendCoeff(), fPaint.getDstBlendCoeff()); |
| 57 | drawState->setColor(fPaint.getColor()); |
bsalomon@google.com | 080773c | 2011-03-15 19:09:25 +0000 | [diff] [blame] | 58 | } |
| 59 | |
bsalomon@google.com | 934c570 | 2012-03-20 21:17:58 +0000 | [diff] [blame] | 60 | int nGlyphs = fCurrVertex / 4; |
tomhudson@google.com | 375ff85 | 2012-06-29 18:37:57 +0000 | [diff] [blame] | 61 | fDrawTarget->setIndexSourceToBuffer(fContext->getQuadIndexBuffer()); |
bsalomon@google.com | 4705954 | 2012-06-06 20:51:20 +0000 | [diff] [blame] | 62 | fDrawTarget->drawIndexedInstances(kTriangles_GrPrimitiveType, |
bsalomon@google.com | 934c570 | 2012-03-20 21:17:58 +0000 | [diff] [blame] | 63 | nGlyphs, |
| 64 | 4, 6); |
tomhudson@google.com | 375ff85 | 2012-06-29 18:37:57 +0000 | [diff] [blame] | 65 | fDrawTarget->resetVertexSource(); |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 66 | fVertices = NULL; |
tomhudson@google.com | 375ff85 | 2012-06-29 18:37:57 +0000 | [diff] [blame] | 67 | fMaxVertices = 0; |
| 68 | fCurrVertex = 0; |
| 69 | GrSafeSetNull(fCurrTexture); |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 70 | } |
tomhudson@google.com | cb325ce | 2012-07-11 14:41:19 +0000 | [diff] [blame] | 71 | drawState->disableStages(); |
| 72 | fDrawTarget = NULL; |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 73 | } |
| 74 | |
bsalomon@google.com | 0e354aa | 2012-10-08 20:44:25 +0000 | [diff] [blame] | 75 | GrTextContext::GrTextContext(GrContext* context, const GrPaint& paint) : fPaint(paint) { |
tomhudson@google.com | 375ff85 | 2012-06-29 18:37:57 +0000 | [diff] [blame] | 76 | fContext = context; |
bsalomon@google.com | f4a9c82 | 2012-03-16 14:02:46 +0000 | [diff] [blame] | 77 | fStrike = NULL; |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 78 | |
tomhudson@google.com | 375ff85 | 2012-06-29 18:37:57 +0000 | [diff] [blame] | 79 | fCurrTexture = NULL; |
| 80 | fCurrVertex = 0; |
| 81 | |
robertphillips@google.com | beb1af7 | 2012-07-26 18:52:16 +0000 | [diff] [blame] | 82 | const GrClipData* clipData = context->getClip(); |
| 83 | |
robertphillips@google.com | 641f8b1 | 2012-07-31 19:15:58 +0000 | [diff] [blame] | 84 | GrRect devConservativeBound; |
| 85 | clipData->fClipStack->getConservativeBounds( |
| 86 | -clipData->fOrigin.fX, |
| 87 | -clipData->fOrigin.fY, |
| 88 | context->getRenderTarget()->width(), |
| 89 | context->getRenderTarget()->height(), |
| 90 | &devConservativeBound); |
robertphillips@google.com | beb1af7 | 2012-07-26 18:52:16 +0000 | [diff] [blame] | 91 | |
robertphillips@google.com | 641f8b1 | 2012-07-31 19:15:58 +0000 | [diff] [blame] | 92 | devConservativeBound.roundOut(&fClipRect); |
robertphillips@google.com | beb1af7 | 2012-07-26 18:52:16 +0000 | [diff] [blame] | 93 | |
bsalomon@google.com | 858804d | 2012-10-15 14:25:50 +0000 | [diff] [blame] | 94 | fAutoMatrix.setIdentity(fContext, &fPaint); |
bsalomon@google.com | 3914958 | 2011-06-13 21:55:32 +0000 | [diff] [blame] | 95 | |
tomhudson@google.com | cb325ce | 2012-07-11 14:41:19 +0000 | [diff] [blame] | 96 | fDrawTarget = NULL; |
bsalomon@google.com | 7d34d2e | 2011-01-24 17:41:47 +0000 | [diff] [blame] | 97 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 98 | fVertices = NULL; |
tomhudson@google.com | 375ff85 | 2012-06-29 18:37:57 +0000 | [diff] [blame] | 99 | fMaxVertices = 0; |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 100 | } |
| 101 | |
tomhudson@google.com | 375ff85 | 2012-06-29 18:37:57 +0000 | [diff] [blame] | 102 | GrTextContext::~GrTextContext() { |
| 103 | this->flushGlyphs(); |
| 104 | if (fDrawTarget) { |
| 105 | fDrawTarget->drawState()->disableStages(); |
| 106 | } |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 107 | } |
| 108 | |
tomhudson@google.com | 375ff85 | 2012-06-29 18:37:57 +0000 | [diff] [blame] | 109 | void GrTextContext::flush() { |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 110 | this->flushGlyphs(); |
| 111 | } |
| 112 | |
tomhudson@google.com | 375ff85 | 2012-06-29 18:37:57 +0000 | [diff] [blame] | 113 | void GrTextContext::drawPackedGlyph(GrGlyph::PackedID packed, |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 114 | GrFixed vx, GrFixed vy, |
| 115 | GrFontScaler* scaler) { |
| 116 | if (NULL == fStrike) { |
| 117 | fStrike = fContext->getFontCache()->getStrike(scaler); |
| 118 | } |
| 119 | |
| 120 | GrGlyph* glyph = fStrike->getGlyph(packed, scaler); |
| 121 | if (NULL == glyph || glyph->fBounds.isEmpty()) { |
| 122 | return; |
| 123 | } |
| 124 | |
bsalomon@google.com | 8171288 | 2012-11-01 17:12:34 +0000 | [diff] [blame] | 125 | vx += SkIntToFixed(glyph->fBounds.fLeft); |
| 126 | vy += SkIntToFixed(glyph->fBounds.fTop); |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 127 | |
| 128 | // keep them as ints until we've done the clip-test |
| 129 | GrFixed width = glyph->fBounds.width(); |
| 130 | GrFixed height = glyph->fBounds.height(); |
| 131 | |
| 132 | // check if we clipped out |
| 133 | if (true || NULL == glyph->fAtlas) { |
| 134 | int x = vx >> 16; |
| 135 | int y = vy >> 16; |
| 136 | if (fClipRect.quickReject(x, y, x + width, y + height)) { |
bsalomon@google.com | b9086a0 | 2012-11-01 18:02:54 +0000 | [diff] [blame] | 137 | // SkCLZ(3); // so we can set a break-point in the debugger |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 138 | return; |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | if (NULL == glyph->fAtlas) { |
| 143 | if (fStrike->getGlyphAtlas(glyph, scaler)) { |
| 144 | goto HAS_ATLAS; |
| 145 | } |
reed@google.com | 0ebe81a | 2011-04-04 20:06:59 +0000 | [diff] [blame] | 146 | |
| 147 | // before we purge the cache, we must flush any accumulated draws |
| 148 | this->flushGlyphs(); |
bsalomon@google.com | 193395c | 2012-03-30 17:35:12 +0000 | [diff] [blame] | 149 | fContext->flush(); |
reed@google.com | 313e403 | 2010-12-22 22:16:59 +0000 | [diff] [blame] | 150 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 151 | // try to purge |
| 152 | fContext->getFontCache()->purgeExceptFor(fStrike); |
| 153 | if (fStrike->getGlyphAtlas(glyph, scaler)) { |
| 154 | goto HAS_ATLAS; |
| 155 | } |
| 156 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 157 | if (NULL == glyph->fPath) { |
tomhudson@google.com | c377baf | 2012-07-09 20:17:56 +0000 | [diff] [blame] | 158 | SkPath* path = SkNEW(SkPath); |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 159 | if (!scaler->getGlyphPath(glyph->glyphID(), path)) { |
| 160 | // flag the glyph as being dead? |
| 161 | delete path; |
| 162 | return; |
| 163 | } |
| 164 | glyph->fPath = path; |
| 165 | } |
reed@google.com | 07f3ee1 | 2011-05-16 17:21:57 +0000 | [diff] [blame] | 166 | |
bsalomon@google.com | 3cbaa2d | 2012-10-12 14:51:52 +0000 | [diff] [blame] | 167 | GrContext::AutoMatrix am; |
bsalomon@google.com | b9086a0 | 2012-11-01 18:02:54 +0000 | [diff] [blame] | 168 | SkMatrix translate; |
bsalomon@google.com | 8171288 | 2012-11-01 17:12:34 +0000 | [diff] [blame] | 169 | translate.setTranslate(SkFixedToScalar(vx - SkIntToFixed(glyph->fBounds.fLeft)), |
| 170 | SkFixedToScalar(vy - SkIntToFixed(glyph->fBounds.fTop))); |
bsalomon@google.com | 3cbaa2d | 2012-10-12 14:51:52 +0000 | [diff] [blame] | 171 | GrPaint tmpPaint(fPaint); |
| 172 | am.setPreConcat(fContext, translate, &tmpPaint); |
sugoi@google.com | 5f74cf8 | 2012-12-17 21:16:45 +0000 | [diff] [blame] | 173 | SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle); |
| 174 | fContext->drawPath(tmpPaint, *glyph->fPath, stroke); |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 175 | return; |
| 176 | } |
| 177 | |
| 178 | HAS_ATLAS: |
| 179 | GrAssert(glyph->fAtlas); |
| 180 | |
bsalomon@google.com | 8598328 | 2013-02-07 22:00:29 +0000 | [diff] [blame] | 181 | // now promote them to fixed (TODO: Rethink using fixed pt). |
bsalomon@google.com | 8171288 | 2012-11-01 17:12:34 +0000 | [diff] [blame] | 182 | width = SkIntToFixed(width); |
| 183 | height = SkIntToFixed(height); |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 184 | |
| 185 | GrTexture* texture = glyph->fAtlas->texture(); |
tomhudson@google.com | 375ff85 | 2012-06-29 18:37:57 +0000 | [diff] [blame] | 186 | GrAssert(texture); |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 187 | |
tomhudson@google.com | 375ff85 | 2012-06-29 18:37:57 +0000 | [diff] [blame] | 188 | if (fCurrTexture != texture || fCurrVertex + 4 > fMaxVertices) { |
| 189 | this->flushGlyphs(); |
| 190 | fCurrTexture = texture; |
| 191 | fCurrTexture->ref(); |
| 192 | } |
| 193 | |
| 194 | if (NULL == fVertices) { |
jvanverth@google.com | 9b855c7 | 2013-03-01 18:21:22 +0000 | [diff] [blame] | 195 | // position + texture coord |
| 196 | static const GrVertexAttrib kVertexAttribs[] = { |
jvanverth@google.com | 3b0d631 | 2013-03-01 20:30:01 +0000 | [diff] [blame] | 197 | {kVec2f_GrVertexAttribType, 0}, |
| 198 | {kVec2f_GrVertexAttribType, sizeof(GrPoint)} |
jvanverth@google.com | 9b855c7 | 2013-03-01 18:21:22 +0000 | [diff] [blame] | 199 | }; |
bsalomon@google.com | c781888 | 2013-03-20 19:19:53 +0000 | [diff] [blame^] | 200 | static const GrAttribBindings kAttribBindings = 0; |
jvanverth@google.com | 9b855c7 | 2013-03-01 18:21:22 +0000 | [diff] [blame] | 201 | |
| 202 | // If we need to reserve vertices allow the draw target to suggest |
tomhudson@google.com | 375ff85 | 2012-06-29 18:37:57 +0000 | [diff] [blame] | 203 | // a number of verts to reserve and whether to perform a flush. |
| 204 | fMaxVertices = kMinRequestedVerts; |
jvanverth@google.com | b75b0a0 | 2013-02-05 20:33:30 +0000 | [diff] [blame] | 205 | bool flush = false; |
| 206 | fDrawTarget = fContext->getTextTarget(fPaint); |
| 207 | if (NULL != fDrawTarget) { |
jvanverth@google.com | 9b855c7 | 2013-03-01 18:21:22 +0000 | [diff] [blame] | 208 | fDrawTarget->drawState()->setVertexAttribs(kVertexAttribs, SK_ARRAY_COUNT(kVertexAttribs)); |
jvanverth@google.com | b75b0a0 | 2013-02-05 20:33:30 +0000 | [diff] [blame] | 209 | flush = fDrawTarget->geometryHints(&fMaxVertices, NULL); |
skia.committer@gmail.com | ae68392 | 2013-02-06 07:01:54 +0000 | [diff] [blame] | 210 | } |
tomhudson@google.com | 375ff85 | 2012-06-29 18:37:57 +0000 | [diff] [blame] | 211 | if (flush) { |
| 212 | this->flushGlyphs(); |
| 213 | fContext->flush(); |
bsalomon@google.com | f3a7bc7 | 2013-02-05 21:32:06 +0000 | [diff] [blame] | 214 | // flushGlyphs() will reset fDrawTarget to NULL. |
| 215 | fDrawTarget = fContext->getTextTarget(fPaint); |
jvanverth@google.com | 9b855c7 | 2013-03-01 18:21:22 +0000 | [diff] [blame] | 216 | fDrawTarget->drawState()->setVertexAttribs(kVertexAttribs, SK_ARRAY_COUNT(kVertexAttribs)); |
tomhudson@google.com | 375ff85 | 2012-06-29 18:37:57 +0000 | [diff] [blame] | 217 | } |
jvanverth@google.com | 9b855c7 | 2013-03-01 18:21:22 +0000 | [diff] [blame] | 218 | fDrawTarget->drawState()->setAttribIndex(GrDrawState::kPosition_AttribIndex, 0); |
jvanverth@google.com | 9b855c7 | 2013-03-01 18:21:22 +0000 | [diff] [blame] | 219 | fDrawTarget->drawState()->setAttribBindings(kAttribBindings); |
tomhudson@google.com | cb325ce | 2012-07-11 14:41:19 +0000 | [diff] [blame] | 220 | fMaxVertices = kDefaultRequestedVerts; |
| 221 | // ignore return, no point in flushing again. |
bsalomon@google.com | f3a7bc7 | 2013-02-05 21:32:06 +0000 | [diff] [blame] | 222 | fDrawTarget->geometryHints(&fMaxVertices, NULL); |
tomhudson@google.com | 375ff85 | 2012-06-29 18:37:57 +0000 | [diff] [blame] | 223 | |
| 224 | int maxQuadVertices = 4 * fContext->getQuadIndexBuffer()->maxQuads(); |
| 225 | if (fMaxVertices < kMinRequestedVerts) { |
| 226 | fMaxVertices = kDefaultRequestedVerts; |
| 227 | } else if (fMaxVertices > maxQuadVertices) { |
| 228 | // don't exceed the limit of the index buffer |
| 229 | fMaxVertices = maxQuadVertices; |
| 230 | } |
| 231 | bool success = fDrawTarget->reserveVertexAndIndexSpace( |
tomhudson@google.com | 375ff85 | 2012-06-29 18:37:57 +0000 | [diff] [blame] | 232 | fMaxVertices, |
| 233 | 0, |
| 234 | GrTCast<void**>(&fVertices), |
| 235 | NULL); |
| 236 | GrAlwaysAssert(success); |
jvanverth@google.com | 9b855c7 | 2013-03-01 18:21:22 +0000 | [diff] [blame] | 237 | GrAssert(2*sizeof(GrPoint) == fDrawTarget->getDrawState().getVertexSize()); |
tomhudson@google.com | 375ff85 | 2012-06-29 18:37:57 +0000 | [diff] [blame] | 238 | } |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 239 | |
bsalomon@google.com | 8171288 | 2012-11-01 17:12:34 +0000 | [diff] [blame] | 240 | GrFixed tx = SkIntToFixed(glyph->fAtlasLocation.fX); |
| 241 | GrFixed ty = SkIntToFixed(glyph->fAtlasLocation.fY); |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 242 | |
bsalomon@google.com | 8598328 | 2013-02-07 22:00:29 +0000 | [diff] [blame] | 243 | fVertices[2*fCurrVertex].setRectFan(SkFixedToFloat(vx), |
| 244 | SkFixedToFloat(vy), |
| 245 | SkFixedToFloat(vx + width), |
| 246 | SkFixedToFloat(vy + height), |
| 247 | 2 * sizeof(SkPoint)); |
| 248 | fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixedX(tx)), |
| 249 | SkFixedToFloat(texture->normalizeFixedY(ty)), |
| 250 | SkFixedToFloat(texture->normalizeFixedX(tx + width)), |
| 251 | SkFixedToFloat(texture->normalizeFixedY(ty + height)), |
| 252 | 2 * sizeof(SkPoint)); |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 253 | fCurrVertex += 4; |
| 254 | } |