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

Side by Side Diff: include/gpu/GrBitmapTextContext.h

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 | « no previous file | include/gpu/GrDistanceFieldTextContext.h » ('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 #ifndef GrBitmapTextContext_DEFINED 8 #ifndef GrBitmapTextContext_DEFINED
9 #define GrBitmapTextContext_DEFINED 9 #define GrBitmapTextContext_DEFINED
10 10
11 #include "GrTextContext.h" 11 #include "GrTextContext.h"
12 12
13 class GrTextStrike; 13 class GrTextStrike;
14 14
15 /* 15 /*
16 * This class implements GrTextContext using standard bitmap fonts 16 * This class implements GrTextContext using standard bitmap fonts
17 */ 17 */
18 class GrBitmapTextContext : public GrTextContext { 18 class GrBitmapTextContext : public GrTextContext {
19 public: 19 public:
20 GrBitmapTextContext(GrContext*, const GrPaint&, SkColor);
21 virtual ~GrBitmapTextContext();
22
23 virtual void drawPackedGlyph(GrGlyph::PackedID, GrFixed left, GrFixed top, 20 virtual void drawPackedGlyph(GrGlyph::PackedID, GrFixed left, GrFixed top,
24 GrFontScaler*) SK_OVERRIDE; 21 GrFontScaler*) SK_OVERRIDE;
25 22
26 private: 23 private:
24 GrBitmapTextContext(GrContext*, const GrPaint&, const SkPaint&);
25 virtual ~GrBitmapTextContext();
26 friend class GrTTextContextManager<GrBitmapTextContext>;
27
27 GrContext::AutoMatrix fAutoMatrix; 28 GrContext::AutoMatrix fAutoMatrix;
28 GrTextStrike* fStrike; 29 GrTextStrike* fStrike;
29 30
30 void flushGlyphs(); // automatically called by destructor 31 void flushGlyphs(); // automatically called by destructor
31 32
32 enum { 33 enum {
33 kMinRequestedGlyphs = 1, 34 kMinRequestedGlyphs = 1,
34 kDefaultRequestedGlyphs = 64, 35 kDefaultRequestedGlyphs = 64,
35 kMinRequestedVerts = kMinRequestedGlyphs * 4, 36 kMinRequestedVerts = kMinRequestedGlyphs * 4,
36 kDefaultRequestedVerts = kDefaultRequestedGlyphs * 4, 37 kDefaultRequestedVerts = kDefaultRequestedGlyphs * 4,
37 }; 38 };
38 39
39 SkColor fSkPaintColor;
40 SkPoint* fVertices; 40 SkPoint* fVertices;
41 int32_t fMaxVertices; 41 int32_t fMaxVertices;
42 GrTexture* fCurrTexture; 42 GrTexture* fCurrTexture;
43 int fCurrVertex; 43 int fCurrVertex;
44 }; 44 };
45 45
46 #endif 46 #endif
OLDNEW
« no previous file with comments | « no previous file | include/gpu/GrDistanceFieldTextContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698