OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 | 9 |
10 #include "GrTextContext.h" | 10 #include "GrTextContext.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 int nGlyphs = fCurrVertex / 4; | 61 int nGlyphs = fCurrVertex / 4; |
62 fDrawTarget->setIndexSourceToBuffer(fContext->getQuadIndexBuffer()); | 62 fDrawTarget->setIndexSourceToBuffer(fContext->getQuadIndexBuffer()); |
63 fDrawTarget->drawIndexedInstances(kTriangles_GrPrimitiveType, | 63 fDrawTarget->drawIndexedInstances(kTriangles_GrPrimitiveType, |
64 nGlyphs, | 64 nGlyphs, |
65 4, 6); | 65 4, 6); |
66 fDrawTarget->resetVertexSource(); | 66 fDrawTarget->resetVertexSource(); |
67 fVertices = NULL; | 67 fVertices = NULL; |
68 fMaxVertices = 0; | 68 fMaxVertices = 0; |
69 fCurrVertex = 0; | 69 fCurrVertex = 0; |
70 GrSafeSetNull(fCurrTexture); | 70 SkSafeSetNull(fCurrTexture); |
71 } | 71 } |
72 } | 72 } |
73 | 73 |
74 GrTextContext::GrTextContext(GrContext* context, const GrPaint& paint) : fPaint(
paint) { | 74 GrTextContext::GrTextContext(GrContext* context, const GrPaint& paint) : fPaint(
paint) { |
75 fContext = context; | 75 fContext = context; |
76 fStrike = NULL; | 76 fStrike = NULL; |
77 | 77 |
78 fCurrTexture = NULL; | 78 fCurrTexture = NULL; |
79 fCurrVertex = 0; | 79 fCurrVertex = 0; |
80 | 80 |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 SkFixedToFloat(vx + width), | 248 SkFixedToFloat(vx + width), |
249 SkFixedToFloat(vy + height), | 249 SkFixedToFloat(vy + height), |
250 2 * sizeof(SkPoint)); | 250 2 * sizeof(SkPoint)); |
251 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed
X(tx)), | 251 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed
X(tx)), |
252 SkFixedToFloat(texture->normalizeFixed
Y(ty)), | 252 SkFixedToFloat(texture->normalizeFixed
Y(ty)), |
253 SkFixedToFloat(texture->normalizeFixed
X(tx + width)), | 253 SkFixedToFloat(texture->normalizeFixed
X(tx + width)), |
254 SkFixedToFloat(texture->normalizeFixed
Y(ty + height)), | 254 SkFixedToFloat(texture->normalizeFixed
Y(ty + height)), |
255 2 * sizeof(SkPoint)); | 255 2 * sizeof(SkPoint)); |
256 fCurrVertex += 4; | 256 fCurrVertex += 4; |
257 } | 257 } |
OLD | NEW |