blob: ea9fd031e7eb49cc11d1bc6d335b56665ed835f3 [file] [log] [blame]
Romain Guy9f5dab32012-09-04 12:55:44 -07001/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Romain Guya3dc55f2012-09-28 13:55:44 -070017#define LOG_TAG "OpenGLRenderer"
18
Romain Guy9f5dab32012-09-04 12:55:44 -070019#include <cutils/compiler.h>
20
Romain Guye3a9b242013-01-08 11:15:30 -080021#include <utils/JenkinsHash.h>
22
Romain Guy14c40b42013-01-08 18:03:07 -080023#include <SkGlyph.h>
Romain Guy9f5dab32012-09-04 12:55:44 -070024#include <SkUtils.h>
25
26#include "Debug.h"
27#include "FontUtil.h"
28#include "Font.h"
29#include "FontRenderer.h"
30#include "Properties.h"
31
32namespace android {
33namespace uirenderer {
34
35///////////////////////////////////////////////////////////////////////////////
36// Font
37///////////////////////////////////////////////////////////////////////////////
38
Romain Guye3a9b242013-01-08 11:15:30 -080039Font::Font(FontRenderer* state, const Font::FontDescription& desc) :
40 mState(state), mDescription(desc) {
Romain Guy9f5dab32012-09-04 12:55:44 -070041}
42
Romain Guye3a9b242013-01-08 11:15:30 -080043Font::FontDescription::FontDescription(const SkPaint* paint, const mat4& matrix) {
44 mFontId = SkTypeface::UniqueID(paint->getTypeface());
45 mFontSize = paint->getTextSize();
46 mFlags = 0;
47 if (paint->isFakeBoldText()) {
48 mFlags |= Font::kFakeBold;
49 }
50 mItalicStyle = paint->getTextSkewX();
51 mScaleX = paint->getTextScaleX();
52 mStyle = paint->getStyle();
53 mStrokeWidth = paint->getStrokeWidth();
Romain Guyb969a0d2013-02-05 14:38:40 -080054 mAntiAliasing = paint->isAntiAlias();
Romain Guyc74f45a2013-02-26 19:10:14 -080055 mLookupTransform[SkMatrix::kMScaleX] = matrix.data[mat4::kScaleX];
56 mLookupTransform[SkMatrix::kMScaleY] = matrix.data[mat4::kScaleY];
57 mLookupTransform[SkMatrix::kMSkewX] = matrix.data[mat4::kSkewX];
58 mLookupTransform[SkMatrix::kMSkewY] = matrix.data[mat4::kSkewY];
Romain Guye3a9b242013-01-08 11:15:30 -080059}
Romain Guy9f5dab32012-09-04 12:55:44 -070060
61Font::~Font() {
Romain Guy9b1204b2012-09-04 15:22:57 -070062 mState->removeFont(this);
Romain Guy9f5dab32012-09-04 12:55:44 -070063
64 for (uint32_t i = 0; i < mCachedGlyphs.size(); i++) {
65 delete mCachedGlyphs.valueAt(i);
66 }
67}
68
Romain Guye3a9b242013-01-08 11:15:30 -080069hash_t Font::FontDescription::hash() const {
70 uint32_t hash = JenkinsHashMix(0, mFontId);
71 hash = JenkinsHashMix(hash, android::hash_type(mFontSize));
72 hash = JenkinsHashMix(hash, android::hash_type(mFlags));
73 hash = JenkinsHashMix(hash, android::hash_type(mItalicStyle));
74 hash = JenkinsHashMix(hash, android::hash_type(mScaleX));
75 hash = JenkinsHashMix(hash, android::hash_type(mStyle));
76 hash = JenkinsHashMix(hash, android::hash_type(mStrokeWidth));
Romain Guyb969a0d2013-02-05 14:38:40 -080077 hash = JenkinsHashMix(hash, int(mAntiAliasing));
Romain Guyc74f45a2013-02-26 19:10:14 -080078 hash = JenkinsHashMix(hash, android::hash_type(mLookupTransform[SkMatrix::kMScaleX]));
79 hash = JenkinsHashMix(hash, android::hash_type(mLookupTransform[SkMatrix::kMScaleY]));
80 hash = JenkinsHashMix(hash, android::hash_type(mLookupTransform[SkMatrix::kMSkewX]));
81 hash = JenkinsHashMix(hash, android::hash_type(mLookupTransform[SkMatrix::kMSkewY]));
Romain Guye3a9b242013-01-08 11:15:30 -080082 return JenkinsHashWhiten(hash);
83}
84
85int Font::FontDescription::compare(const Font::FontDescription& lhs,
86 const Font::FontDescription& rhs) {
87 int deltaInt = int(lhs.mFontId) - int(rhs.mFontId);
88 if (deltaInt != 0) return deltaInt;
89
90 if (lhs.mFontSize < rhs.mFontSize) return -1;
91 if (lhs.mFontSize > rhs.mFontSize) return +1;
92
93 if (lhs.mItalicStyle < rhs.mItalicStyle) return -1;
94 if (lhs.mItalicStyle > rhs.mItalicStyle) return +1;
95
96 deltaInt = int(lhs.mFlags) - int(rhs.mFlags);
97 if (deltaInt != 0) return deltaInt;
98
99 if (lhs.mScaleX < rhs.mScaleX) return -1;
100 if (lhs.mScaleX > rhs.mScaleX) return +1;
101
102 deltaInt = int(lhs.mStyle) - int(rhs.mStyle);
103 if (deltaInt != 0) return deltaInt;
104
105 if (lhs.mStrokeWidth < rhs.mStrokeWidth) return -1;
106 if (lhs.mStrokeWidth > rhs.mStrokeWidth) return +1;
107
Romain Guyb969a0d2013-02-05 14:38:40 -0800108 deltaInt = int(lhs.mAntiAliasing) - int(rhs.mAntiAliasing);
109 if (deltaInt != 0) return deltaInt;
110
Romain Guyc74f45a2013-02-26 19:10:14 -0800111 if (lhs.mLookupTransform[SkMatrix::kMScaleX] <
112 rhs.mLookupTransform[SkMatrix::kMScaleX]) return -1;
113 if (lhs.mLookupTransform[SkMatrix::kMScaleX] >
114 rhs.mLookupTransform[SkMatrix::kMScaleX]) return +1;
115
116 if (lhs.mLookupTransform[SkMatrix::kMScaleY] <
117 rhs.mLookupTransform[SkMatrix::kMScaleY]) return -1;
118 if (lhs.mLookupTransform[SkMatrix::kMScaleY] >
119 rhs.mLookupTransform[SkMatrix::kMScaleY]) return +1;
120
121 if (lhs.mLookupTransform[SkMatrix::kMSkewX] <
122 rhs.mLookupTransform[SkMatrix::kMSkewX]) return -1;
123 if (lhs.mLookupTransform[SkMatrix::kMSkewX] >
124 rhs.mLookupTransform[SkMatrix::kMSkewX]) return +1;
125
126 if (lhs.mLookupTransform[SkMatrix::kMSkewY] <
127 rhs.mLookupTransform[SkMatrix::kMSkewY]) return -1;
128 if (lhs.mLookupTransform[SkMatrix::kMSkewY] >
129 rhs.mLookupTransform[SkMatrix::kMSkewY]) return +1;
130
Romain Guye3a9b242013-01-08 11:15:30 -0800131 return 0;
132}
133
Romain Guy80872462012-09-04 16:42:01 -0700134void Font::invalidateTextureCache(CacheTexture* cacheTexture) {
Romain Guy9f5dab32012-09-04 12:55:44 -0700135 for (uint32_t i = 0; i < mCachedGlyphs.size(); i++) {
136 CachedGlyphInfo* cachedGlyph = mCachedGlyphs.valueAt(i);
Romain Guy521dc512012-09-04 19:10:33 -0700137 if (!cacheTexture || cachedGlyph->mCacheTexture == cacheTexture) {
Romain Guy9f5dab32012-09-04 12:55:44 -0700138 cachedGlyph->mIsValid = false;
139 }
140 }
141}
142
143void Font::measureCachedGlyph(CachedGlyphInfo *glyph, int x, int y,
144 uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, const float* pos) {
145 int nPenX = x + glyph->mBitmapLeft;
146 int nPenY = y + glyph->mBitmapTop;
147
148 int width = (int) glyph->mBitmapWidth;
149 int height = (int) glyph->mBitmapHeight;
150
151 if (bounds->bottom > nPenY) {
152 bounds->bottom = nPenY;
153 }
154 if (bounds->left > nPenX) {
155 bounds->left = nPenX;
156 }
157 if (bounds->right < nPenX + width) {
158 bounds->right = nPenX + width;
159 }
160 if (bounds->top < nPenY + height) {
161 bounds->top = nPenY + height;
162 }
163}
164
165void Font::drawCachedGlyph(CachedGlyphInfo* glyph, int x, int y,
166 uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, const float* pos) {
Romain Guye3a9b242013-01-08 11:15:30 -0800167 float nPenX = x + glyph->mBitmapLeft;
168 float nPenY = y + (glyph->mBitmapTop + glyph->mBitmapHeight);
169
170 float width = (float) glyph->mBitmapWidth;
171 float height = (float) glyph->mBitmapHeight;
Romain Guy9f5dab32012-09-04 12:55:44 -0700172
173 float u1 = glyph->mBitmapMinU;
174 float u2 = glyph->mBitmapMaxU;
175 float v1 = glyph->mBitmapMinV;
176 float v2 = glyph->mBitmapMaxV;
177
Romain Guy9f5dab32012-09-04 12:55:44 -0700178 mState->appendMeshQuad(nPenX, nPenY, u1, v2,
179 nPenX + width, nPenY, u2, v2,
180 nPenX + width, nPenY - height, u2, v1,
181 nPenX, nPenY - height, u1, v1, glyph->mCacheTexture);
182}
183
184void Font::drawCachedGlyphBitmap(CachedGlyphInfo* glyph, int x, int y,
185 uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, const float* pos) {
186 int nPenX = x + glyph->mBitmapLeft;
187 int nPenY = y + glyph->mBitmapTop;
188
189 uint32_t endX = glyph->mStartX + glyph->mBitmapWidth;
190 uint32_t endY = glyph->mStartY + glyph->mBitmapHeight;
191
Romain Guy80872462012-09-04 16:42:01 -0700192 CacheTexture* cacheTexture = glyph->mCacheTexture;
193 uint32_t cacheWidth = cacheTexture->getWidth();
194 const uint8_t* cacheBuffer = cacheTexture->getTexture();
Romain Guy9f5dab32012-09-04 12:55:44 -0700195
196 uint32_t cacheX = 0, cacheY = 0;
197 int32_t bX = 0, bY = 0;
198 for (cacheX = glyph->mStartX, bX = nPenX; cacheX < endX; cacheX++, bX++) {
199 for (cacheY = glyph->mStartY, bY = nPenY; cacheY < endY; cacheY++, bY++) {
Romain Guy9f5dab32012-09-04 12:55:44 -0700200 uint8_t tempCol = cacheBuffer[cacheY * cacheWidth + cacheX];
201 bitmap[bY * bitmapW + bX] = tempCol;
202 }
203 }
204}
205
206void Font::drawCachedGlyph(CachedGlyphInfo* glyph, float x, float hOffset, float vOffset,
207 SkPathMeasure& measure, SkPoint* position, SkVector* tangent) {
208 const float halfWidth = glyph->mBitmapWidth * 0.5f;
209 const float height = glyph->mBitmapHeight;
210
211 vOffset += glyph->mBitmapTop + height;
212
213 SkPoint destination[4];
Romain Guye67307c2013-02-11 18:01:20 -0800214 bool ok = measure.getPosTan(x + hOffset + glyph->mBitmapLeft + halfWidth, position, tangent);
215 if (!ok) {
216 ALOGW("The path for drawTextOnPath is empty or null");
217 }
Romain Guy9f5dab32012-09-04 12:55:44 -0700218
219 // Move along the tangent and offset by the normal
220 destination[0].set(-tangent->fX * halfWidth - tangent->fY * vOffset,
221 -tangent->fY * halfWidth + tangent->fX * vOffset);
222 destination[1].set(tangent->fX * halfWidth - tangent->fY * vOffset,
223 tangent->fY * halfWidth + tangent->fX * vOffset);
224 destination[2].set(destination[1].fX + tangent->fY * height,
225 destination[1].fY - tangent->fX * height);
226 destination[3].set(destination[0].fX + tangent->fY * height,
227 destination[0].fY - tangent->fX * height);
228
229 const float u1 = glyph->mBitmapMinU;
230 const float u2 = glyph->mBitmapMaxU;
231 const float v1 = glyph->mBitmapMinV;
232 const float v2 = glyph->mBitmapMaxV;
233
234 mState->appendRotatedMeshQuad(
235 position->fX + destination[0].fX,
236 position->fY + destination[0].fY, u1, v2,
237 position->fX + destination[1].fX,
238 position->fY + destination[1].fY, u2, v2,
239 position->fX + destination[2].fX,
240 position->fY + destination[2].fY, u2, v1,
241 position->fX + destination[3].fX,
242 position->fY + destination[3].fY, u1, v1,
243 glyph->mCacheTexture);
244}
245
246CachedGlyphInfo* Font::getCachedGlyph(SkPaint* paint, glyph_t textUnit, bool precaching) {
247 CachedGlyphInfo* cachedGlyph = NULL;
248 ssize_t index = mCachedGlyphs.indexOfKey(textUnit);
249 if (index >= 0) {
250 cachedGlyph = mCachedGlyphs.valueAt(index);
Romain Guyc74f45a2013-02-26 19:10:14 -0800251
252 // Is the glyph still in texture cache?
253 if (!cachedGlyph->mIsValid) {
254 const SkGlyph& skiaGlyph = GET_METRICS(paint, textUnit, &mDescription.mLookupTransform);
255 updateGlyphCache(paint, skiaGlyph, cachedGlyph, precaching);
256 }
Romain Guy9f5dab32012-09-04 12:55:44 -0700257 } else {
258 cachedGlyph = cacheGlyph(paint, textUnit, precaching);
259 }
260
Romain Guy9f5dab32012-09-04 12:55:44 -0700261 return cachedGlyph;
262}
263
Romain Guy9f5dab32012-09-04 12:55:44 -0700264void Font::render(SkPaint* paint, const char *text, uint32_t start, uint32_t len,
265 int numGlyphs, int x, int y, const float* positions) {
266 render(paint, text, start, len, numGlyphs, x, y, FRAMEBUFFER, NULL,
267 0, 0, NULL, positions);
268}
269
270void Font::render(SkPaint* paint, const char *text, uint32_t start, uint32_t len,
271 int numGlyphs, SkPath* path, float hOffset, float vOffset) {
272 if (numGlyphs == 0 || text == NULL || len == 0) {
273 return;
274 }
275
276 text += start;
277
278 int glyphsCount = 0;
279 SkFixed prevRsbDelta = 0;
280
281 float penX = 0.0f;
282
283 SkPoint position;
284 SkVector tangent;
285
286 SkPathMeasure measure(*path, false);
287 float pathLength = SkScalarToFloat(measure.getLength());
288
289 if (paint->getTextAlign() != SkPaint::kLeft_Align) {
290 float textWidth = SkScalarToFloat(paint->measureText(text, len));
291 float pathOffset = pathLength;
292 if (paint->getTextAlign() == SkPaint::kCenter_Align) {
293 textWidth *= 0.5f;
294 pathOffset *= 0.5f;
295 }
296 penX += pathOffset - textWidth;
297 }
298
299 while (glyphsCount < numGlyphs && penX < pathLength) {
300 glyph_t glyph = GET_GLYPH(text);
301
302 if (IS_END_OF_STRING(glyph)) {
303 break;
304 }
305
306 CachedGlyphInfo* cachedGlyph = getCachedGlyph(paint, glyph);
307 penX += SkFixedToFloat(AUTO_KERN(prevRsbDelta, cachedGlyph->mLsbDelta));
308 prevRsbDelta = cachedGlyph->mRsbDelta;
309
310 if (cachedGlyph->mIsValid) {
311 drawCachedGlyph(cachedGlyph, penX, hOffset, vOffset, measure, &position, &tangent);
312 }
313
314 penX += SkFixedToFloat(cachedGlyph->mAdvanceX);
315
316 glyphsCount++;
317 }
318}
319
320void Font::measure(SkPaint* paint, const char* text, uint32_t start, uint32_t len,
321 int numGlyphs, Rect *bounds, const float* positions) {
322 if (bounds == NULL) {
323 ALOGE("No return rectangle provided to measure text");
324 return;
325 }
326 bounds->set(1e6, -1e6, -1e6, 1e6);
327 render(paint, text, start, len, numGlyphs, 0, 0, MEASURE, NULL, 0, 0, bounds, positions);
328}
329
330void Font::precache(SkPaint* paint, const char* text, int numGlyphs) {
331
332 if (numGlyphs == 0 || text == NULL) {
333 return;
334 }
335 int glyphsCount = 0;
336
337 while (glyphsCount < numGlyphs) {
338 glyph_t glyph = GET_GLYPH(text);
339
340 // Reached the end of the string
341 if (IS_END_OF_STRING(glyph)) {
342 break;
343 }
344
345 CachedGlyphInfo* cachedGlyph = getCachedGlyph(paint, glyph, true);
346
347 glyphsCount++;
348 }
349}
350
351void Font::render(SkPaint* paint, const char* text, uint32_t start, uint32_t len,
352 int numGlyphs, int x, int y, RenderMode mode, uint8_t *bitmap,
353 uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, const float* positions) {
354 if (numGlyphs == 0 || text == NULL || len == 0) {
355 return;
356 }
357
358 static RenderGlyph gRenderGlyph[] = {
359 &android::uirenderer::Font::drawCachedGlyph,
360 &android::uirenderer::Font::drawCachedGlyphBitmap,
361 &android::uirenderer::Font::measureCachedGlyph
362 };
363 RenderGlyph render = gRenderGlyph[mode];
364
365 text += start;
366 int glyphsCount = 0;
367
Romain Guye3a9b242013-01-08 11:15:30 -0800368 const SkPaint::Align align = paint->getTextAlign();
Romain Guy9f5dab32012-09-04 12:55:44 -0700369
Romain Guye3a9b242013-01-08 11:15:30 -0800370 while (glyphsCount < numGlyphs) {
371 glyph_t glyph = GET_GLYPH(text);
Romain Guy9f5dab32012-09-04 12:55:44 -0700372
Romain Guye3a9b242013-01-08 11:15:30 -0800373 // Reached the end of the string
374 if (IS_END_OF_STRING(glyph)) {
375 break;
Romain Guy9f5dab32012-09-04 12:55:44 -0700376 }
Romain Guy9f5dab32012-09-04 12:55:44 -0700377
Romain Guye3a9b242013-01-08 11:15:30 -0800378 CachedGlyphInfo* cachedGlyph = getCachedGlyph(paint, glyph);
Romain Guy9f5dab32012-09-04 12:55:44 -0700379
Romain Guye3a9b242013-01-08 11:15:30 -0800380 // If it's still not valid, we couldn't cache it, so we shouldn't draw garbage
381 if (cachedGlyph->mIsValid) {
Romain Guyc74f45a2013-02-26 19:10:14 -0800382 float penX = x + positions[(glyphsCount << 1)];
383 float penY = y + positions[(glyphsCount << 1) + 1];
Romain Guye3a9b242013-01-08 11:15:30 -0800384
Romain Guyc74f45a2013-02-26 19:10:14 -0800385 if (!mTransform.isIdentity()) {
386 mTransform.mapPoint(penX, penY);
Romain Guy9f5dab32012-09-04 12:55:44 -0700387 }
388
Romain Guyc74f45a2013-02-26 19:10:14 -0800389 (*this.*render)(cachedGlyph, roundf(penX), roundf(penY),
Romain Guye3a9b242013-01-08 11:15:30 -0800390 bitmap, bitmapW, bitmapH, bounds, positions);
Romain Guy9f5dab32012-09-04 12:55:44 -0700391 }
Romain Guye3a9b242013-01-08 11:15:30 -0800392
393 glyphsCount++;
Romain Guy9f5dab32012-09-04 12:55:44 -0700394 }
395}
396
397void Font::updateGlyphCache(SkPaint* paint, const SkGlyph& skiaGlyph, CachedGlyphInfo* glyph,
398 bool precaching) {
399 glyph->mAdvanceX = skiaGlyph.fAdvanceX;
400 glyph->mAdvanceY = skiaGlyph.fAdvanceY;
401 glyph->mBitmapLeft = skiaGlyph.fLeft;
402 glyph->mBitmapTop = skiaGlyph.fTop;
403 glyph->mLsbDelta = skiaGlyph.fLsbDelta;
404 glyph->mRsbDelta = skiaGlyph.fRsbDelta;
405
406 uint32_t startX = 0;
407 uint32_t startY = 0;
408
409 // Get the bitmap for the glyph
Romain Guyb969a0d2013-02-05 14:38:40 -0800410 if (!skiaGlyph.fImage) {
Romain Guyc74f45a2013-02-26 19:10:14 -0800411 paint->findImage(skiaGlyph, &mDescription.mLookupTransform);
Romain Guyb969a0d2013-02-05 14:38:40 -0800412 }
Romain Guy9f5dab32012-09-04 12:55:44 -0700413 mState->cacheBitmap(skiaGlyph, glyph, &startX, &startY, precaching);
414
415 if (!glyph->mIsValid) {
416 return;
417 }
418
419 uint32_t endX = startX + skiaGlyph.fWidth;
420 uint32_t endY = startY + skiaGlyph.fHeight;
421
422 glyph->mStartX = startX;
423 glyph->mStartY = startY;
424 glyph->mBitmapWidth = skiaGlyph.fWidth;
425 glyph->mBitmapHeight = skiaGlyph.fHeight;
426
Romain Guy80872462012-09-04 16:42:01 -0700427 uint32_t cacheWidth = glyph->mCacheTexture->getWidth();
428 uint32_t cacheHeight = glyph->mCacheTexture->getHeight();
Romain Guy9f5dab32012-09-04 12:55:44 -0700429
430 glyph->mBitmapMinU = startX / (float) cacheWidth;
431 glyph->mBitmapMinV = startY / (float) cacheHeight;
432 glyph->mBitmapMaxU = endX / (float) cacheWidth;
433 glyph->mBitmapMaxV = endY / (float) cacheHeight;
434
Romain Guy9b1204b2012-09-04 15:22:57 -0700435 mState->setTextureDirty();
Romain Guy9f5dab32012-09-04 12:55:44 -0700436}
437
438CachedGlyphInfo* Font::cacheGlyph(SkPaint* paint, glyph_t glyph, bool precaching) {
439 CachedGlyphInfo* newGlyph = new CachedGlyphInfo();
440 mCachedGlyphs.add(glyph, newGlyph);
441
Romain Guyc74f45a2013-02-26 19:10:14 -0800442 const SkGlyph& skiaGlyph = GET_METRICS(paint, glyph, &mDescription.mLookupTransform);
Romain Guy9f5dab32012-09-04 12:55:44 -0700443 newGlyph->mGlyphIndex = skiaGlyph.fID;
444 newGlyph->mIsValid = false;
445
446 updateGlyphCache(paint, skiaGlyph, newGlyph, precaching);
447
448 return newGlyph;
449}
450
Romain Guye3a9b242013-01-08 11:15:30 -0800451Font* Font::create(FontRenderer* state, const SkPaint* paint, const mat4& matrix) {
452 FontDescription description(paint, matrix);
453 Font* font = state->mActiveFonts.get(description);
Romain Guy9f5dab32012-09-04 12:55:44 -0700454
Romain Guye3a9b242013-01-08 11:15:30 -0800455 if (font) {
Romain Guyc74f45a2013-02-26 19:10:14 -0800456 font->mTransform.load(matrix);
Romain Guye3a9b242013-01-08 11:15:30 -0800457 return font;
Romain Guy9f5dab32012-09-04 12:55:44 -0700458 }
459
Romain Guye3a9b242013-01-08 11:15:30 -0800460 Font* newFont = new Font(state, description);
461 state->mActiveFonts.put(description, newFont);
Romain Guy9f5dab32012-09-04 12:55:44 -0700462 return newFont;
463}
464
465}; // namespace uirenderer
466}; // namespace android