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

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

Issue 79283004: Minor fixes for distance field fonts: (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Replace local identity matrix with global Created 7 years 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/core/SkDraw.cpp ('k') | src/gpu/SkGpuDevice.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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 126 #if SK_DISTANCEFIELD_FONTS
127 fStrike = fContext->getFontCache()->getStrike(scaler, true); 127 fStrike = fContext->getFontCache()->getStrike(scaler, false);
128 #else 128 #else
129 fStrike = fContext->getFontCache()->getStrike(scaler); 129 fStrike = fContext->getFontCache()->getStrike(scaler);
130 #endif 130 #endif
131 } 131 }
132 132
133 GrGlyph* glyph = fStrike->getGlyph(packed, scaler); 133 GrGlyph* glyph = fStrike->getGlyph(packed, scaler);
134 if (NULL == glyph || glyph->fBounds.isEmpty()) { 134 if (NULL == glyph || glyph->fBounds.isEmpty()) {
135 return; 135 return;
136 } 136 }
137 137
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 SkFixedToFloat(vx + width), 259 SkFixedToFloat(vx + width),
260 SkFixedToFloat(vy + height), 260 SkFixedToFloat(vy + height),
261 2 * sizeof(SkPoint)); 261 2 * sizeof(SkPoint));
262 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed X(tx)), 262 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed X(tx)),
263 SkFixedToFloat(texture->normalizeFixed Y(ty)), 263 SkFixedToFloat(texture->normalizeFixed Y(ty)),
264 SkFixedToFloat(texture->normalizeFixed X(tx + width)), 264 SkFixedToFloat(texture->normalizeFixed X(tx + width)),
265 SkFixedToFloat(texture->normalizeFixed Y(ty + height)), 265 SkFixedToFloat(texture->normalizeFixed Y(ty + height)),
266 2 * sizeof(SkPoint)); 266 2 * sizeof(SkPoint));
267 fCurrVertex += 4; 267 fCurrVertex += 4;
268 } 268 }
OLDNEW
« no previous file with comments | « src/core/SkDraw.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698