Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: src/gpu/GrBitmapTextContext.cpp

Issue 41213003: Hook in rough distance field support for fonts (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 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 #include "GrBitmapTextContext.h" 8 #include "GrBitmapTextContext.h"
9 #include "GrAtlas.h" 9 #include "GrAtlas.h"
10 #include "GrDrawTarget.h" 10 #include "GrDrawTarget.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 }; 101 };
102 102
103 void GrBitmapTextContext::drawPackedGlyph(GrGlyph::PackedID packed, 103 void GrBitmapTextContext::drawPackedGlyph(GrGlyph::PackedID packed,
104 GrFixed vx, GrFixed vy, 104 GrFixed vx, GrFixed vy,
105 GrFontScaler* scaler) { 105 GrFontScaler* scaler) {
106 if (NULL == fDrawTarget) { 106 if (NULL == fDrawTarget) {
107 return; 107 return;
108 } 108 }
109 if (NULL == fStrike) { 109 if (NULL == fStrike) {
110 fStrike = fContext->getFontCache()->getStrike(scaler); 110 fStrike = fContext->getFontCache()->getStrike(scaler, false);
111 } 111 }
112 112
113 GrGlyph* glyph = fStrike->getGlyph(packed, scaler); 113 GrGlyph* glyph = fStrike->getGlyph(packed, scaler);
114 if (NULL == glyph || glyph->fBounds.isEmpty()) { 114 if (NULL == glyph || glyph->fBounds.isEmpty()) {
115 return; 115 return;
116 } 116 }
117 117
118 vx += SkIntToFixed(glyph->fBounds.fLeft); 118 vx += SkIntToFixed(glyph->fBounds.fLeft);
119 vy += SkIntToFixed(glyph->fBounds.fTop); 119 vy += SkIntToFixed(glyph->fBounds.fTop);
120 120
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 SkFixedToFloat(vx + width), 239 SkFixedToFloat(vx + width),
240 SkFixedToFloat(vy + height), 240 SkFixedToFloat(vy + height),
241 2 * sizeof(SkPoint)); 241 2 * sizeof(SkPoint));
242 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed X(tx)), 242 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed X(tx)),
243 SkFixedToFloat(texture->normalizeFixed Y(ty)), 243 SkFixedToFloat(texture->normalizeFixed Y(ty)),
244 SkFixedToFloat(texture->normalizeFixed X(tx + width)), 244 SkFixedToFloat(texture->normalizeFixed X(tx + width)),
245 SkFixedToFloat(texture->normalizeFixed Y(ty + height)), 245 SkFixedToFloat(texture->normalizeFixed Y(ty + height)),
246 2 * sizeof(SkPoint)); 246 2 * sizeof(SkPoint));
247 fCurrVertex += 4; 247 fCurrVertex += 4;
248 } 248 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698