| 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" |
| 11 #include "GrAtlas.h" | 11 #include "GrAtlas.h" |
| 12 #include "GrContext.h" | 12 #include "GrContext.h" |
| 13 #include "GrDrawTarget.h" | 13 #include "GrDrawTarget.h" |
| 14 #include "GrFontScaler.h" | 14 #include "GrFontScaler.h" |
| 15 #include "GrIndexBuffer.h" | 15 #include "GrIndexBuffer.h" |
| 16 #include "GrTextStrike.h" | 16 #include "GrTextStrike.h" |
| 17 #include "GrTextStrike_impl.h" | 17 #include "GrTextStrike_impl.h" |
| 18 #include "SkPath.h" | 18 #include "SkPath.h" |
| 19 #include "SkStrokeRec.h" | 19 #include "SkStrokeRec.h" |
| 20 | 20 |
| 21 enum { | 21 enum { |
| 22 // glyph rendering shares this stage with edge rendering |
| 23 // (kEdgeEffectStage in GrContext) && SW path rendering |
| 24 // (kPathMaskStage in GrSWMaskHelper) |
| 22 kGlyphMaskStage = GrPaint::kTotalStages, | 25 kGlyphMaskStage = GrPaint::kTotalStages, |
| 23 }; | 26 }; |
| 24 | 27 |
| 25 void GrTextContext::flushGlyphs() { | 28 void GrTextContext::flushGlyphs() { |
| 26 if (NULL == fDrawTarget) { | 29 if (NULL == fDrawTarget) { |
| 27 return; | 30 return; |
| 28 } | 31 } |
| 29 GrDrawState* drawState = fDrawTarget->drawState(); | 32 GrDrawState* drawState = fDrawTarget->drawState(); |
| 30 if (fCurrVertex > 0) { | 33 if (fCurrVertex > 0) { |
| 31 // setup our sampler state for our text texture/atlas | 34 // setup our sampler state for our text texture/atlas |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 SkFixedToFloat(vx + width), | 244 SkFixedToFloat(vx + width), |
| 242 SkFixedToFloat(vy + height), | 245 SkFixedToFloat(vy + height), |
| 243 2 * sizeof(SkPoint)); | 246 2 * sizeof(SkPoint)); |
| 244 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed
X(tx)), | 247 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed
X(tx)), |
| 245 SkFixedToFloat(texture->normalizeFixed
Y(ty)), | 248 SkFixedToFloat(texture->normalizeFixed
Y(ty)), |
| 246 SkFixedToFloat(texture->normalizeFixed
X(tx + width)), | 249 SkFixedToFloat(texture->normalizeFixed
X(tx + width)), |
| 247 SkFixedToFloat(texture->normalizeFixed
Y(ty + height)), | 250 SkFixedToFloat(texture->normalizeFixed
Y(ty + height)), |
| 248 2 * sizeof(SkPoint)); | 251 2 * sizeof(SkPoint)); |
| 249 fCurrVertex += 4; | 252 fCurrVertex += 4; |
| 250 } | 253 } |
| OLD | NEW |