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

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: Replace magic number 32 with constant; fix comment in shader; fix Linux compiler error. Created 7 years, 1 month 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
« no previous file with comments | « src/device/xps/SkXPSDevice.cpp ('k') | src/gpu/GrDistanceFieldTextContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 }; 117 };
118 118
119 void GrBitmapTextContext::drawPackedGlyph(GrGlyph::PackedID packed, 119 void GrBitmapTextContext::drawPackedGlyph(GrGlyph::PackedID packed,
120 GrFixed vx, GrFixed vy, 120 GrFixed vx, GrFixed vy,
121 GrFontScaler* scaler) { 121 GrFontScaler* scaler) {
122 if (NULL == fDrawTarget) { 122 if (NULL == fDrawTarget) {
123 return; 123 return;
124 } 124 }
125 if (NULL == fStrike) { 125 if (NULL == fStrike) {
126 #if SK_DISTANCEFIELD_FONTS
127 fStrike = fContext->getFontCache()->getStrike(scaler, true);
128 #else
126 fStrike = fContext->getFontCache()->getStrike(scaler); 129 fStrike = fContext->getFontCache()->getStrike(scaler);
130 #endif
127 } 131 }
128 132
129 GrGlyph* glyph = fStrike->getGlyph(packed, scaler); 133 GrGlyph* glyph = fStrike->getGlyph(packed, scaler);
130 if (NULL == glyph || glyph->fBounds.isEmpty()) { 134 if (NULL == glyph || glyph->fBounds.isEmpty()) {
131 return; 135 return;
132 } 136 }
133 137
134 vx += SkIntToFixed(glyph->fBounds.fLeft); 138 vx += SkIntToFixed(glyph->fBounds.fLeft);
135 vy += SkIntToFixed(glyph->fBounds.fTop); 139 vy += SkIntToFixed(glyph->fBounds.fTop);
136 140
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 SkFixedToFloat(vx + width), 259 SkFixedToFloat(vx + width),
256 SkFixedToFloat(vy + height), 260 SkFixedToFloat(vy + height),
257 2 * sizeof(SkPoint)); 261 2 * sizeof(SkPoint));
258 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed X(tx)), 262 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed X(tx)),
259 SkFixedToFloat(texture->normalizeFixed Y(ty)), 263 SkFixedToFloat(texture->normalizeFixed Y(ty)),
260 SkFixedToFloat(texture->normalizeFixed X(tx + width)), 264 SkFixedToFloat(texture->normalizeFixed X(tx + width)),
261 SkFixedToFloat(texture->normalizeFixed Y(ty + height)), 265 SkFixedToFloat(texture->normalizeFixed Y(ty + height)),
262 2 * sizeof(SkPoint)); 266 2 * sizeof(SkPoint));
263 fCurrVertex += 4; 267 fCurrVertex += 4;
264 } 268 }
OLDNEW
« no previous file with comments | « src/device/xps/SkXPSDevice.cpp ('k') | src/gpu/GrDistanceFieldTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698