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

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

Issue 144283002: Add factory class for generating various flavors of GrTextContext. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add placement delete for ManagedTextContext Created 6 years, 11 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
« no previous file with comments | « src/gpu/GrBitmapTextContext.cpp ('k') | src/gpu/GrTextContext.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 "GrDistanceFieldTextContext.h" 8 #include "GrDistanceFieldTextContext.h"
9 #include "GrAtlas.h" 9 #include "GrAtlas.h"
10 #include "GrDrawTarget.h" 10 #include "GrDrawTarget.h"
(...skipping 10 matching lines...) Expand all
21 static const int kGlyphCoordsAttributeIndex = 1; 21 static const int kGlyphCoordsAttributeIndex = 1;
22 22
23 static const int kBaseDFFontSize = 32; 23 static const int kBaseDFFontSize = 32;
24 24
25 SK_CONF_DECLARE(bool, c_DumpFontCache, "gpu.dumpFontCache", false, 25 SK_CONF_DECLARE(bool, c_DumpFontCache, "gpu.dumpFontCache", false,
26 "Dump the contents of the font cache before every purge."); 26 "Dump the contents of the font cache before every purge.");
27 27
28 GrDistanceFieldTextContext::GrDistanceFieldTextContext(GrContext* context, 28 GrDistanceFieldTextContext::GrDistanceFieldTextContext(GrContext* context,
29 const GrPaint& grPaint, 29 const GrPaint& grPaint,
30 const SkPaint& skPaint) 30 const SkPaint& skPaint)
31 : GrTextContext(context, gr Paint), 31 : GrTextContext(context, gr Paint, skPaint) {
32 fSkPaint(skPaint) {
33 fStrike = NULL; 32 fStrike = NULL;
34 33
35 fCurrTexture = NULL; 34 fCurrTexture = NULL;
36 fCurrVertex = 0; 35 fCurrVertex = 0;
37 36
38 fVertices = NULL; 37 fVertices = NULL;
39 fMaxVertices = 0; 38 fMaxVertices = 0;
40 39
41 fTextRatio = fSkPaint.getTextSize()/kBaseDFFontSize; 40 fTextRatio = fSkPaint.getTextSize()/kBaseDFFontSize;
42 41
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 SkScalarToFixed(x) - (glyph.fAdvanceX >> a lignShift) 397 SkScalarToFixed(x) - (glyph.fAdvanceX >> a lignShift)
399 + SK_FixedHalf, //d1g.fHalfSampleX, 398 + SK_FixedHalf, //d1g.fHalfSampleX,
400 SkScalarToFixed(y) - (glyph.fAdvanceY >> a lignShift) 399 SkScalarToFixed(y) - (glyph.fAdvanceY >> a lignShift)
401 + SK_FixedHalf, //d1g.fHalfSampleY, 400 + SK_FixedHalf, //d1g.fHalfSampleY,
402 fontScaler); 401 fontScaler);
403 } 402 }
404 pos += scalarsPerPosition; 403 pos += scalarsPerPosition;
405 } 404 }
406 } 405 }
407 } 406 }
OLDNEW
« no previous file with comments | « src/gpu/GrBitmapTextContext.cpp ('k') | src/gpu/GrTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698