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

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

Issue 150743002: Replace factory generation of TextContexts with persistent objects. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: And an if statement Created 6 years, 10 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 | « include/gpu/SkGpuDevice.h ('k') | src/gpu/GrBitmapTextContext.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 #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&, const SkPaint&, const SkDevi ceProperties&); 20 GrBitmapTextContext(GrContext*, const SkDeviceProperties&);
21 virtual ~GrBitmapTextContext(); 21 virtual ~GrBitmapTextContext();
22 22
23 virtual void drawText(const char text[], size_t byteLength, SkScalar x, SkSc alar y) SK_OVERRIDE; 23 virtual void drawText(const GrPaint&, const SkPaint&, const char text[], siz e_t byteLength,
24 virtual void drawPosText(const char text[], size_t byteLength, 24 SkScalar x, SkScalar y) SK_OVERRIDE;
25 virtual void drawPosText(const GrPaint&, const SkPaint&,
26 const char text[], size_t byteLength,
25 const SkScalar pos[], SkScalar constY, 27 const SkScalar pos[], SkScalar constY,
26 int scalarsPerPosition) SK_OVERRIDE; 28 int scalarsPerPosition) SK_OVERRIDE;
27 29
28 static bool CanDraw(const SkPaint& paint, const SkMatrix& ctm); 30 virtual bool canDraw(const SkPaint& paint) SK_OVERRIDE;
29 31
30 private: 32 private:
31 GrTextStrike* fStrike; 33 GrTextStrike* fStrike;
32 34
35 void init(const GrPaint&, const SkPaint&);
33 void drawPackedGlyph(GrGlyph::PackedID, GrFixed left, GrFixed top, GrFontSca ler*); 36 void drawPackedGlyph(GrGlyph::PackedID, GrFixed left, GrFixed top, GrFontSca ler*);
34 void flushGlyphs(); // automatically called by destructor 37 void flushGlyphs(); // automatically called by destructor
38 void finish();
35 39
36 enum { 40 enum {
37 kMinRequestedGlyphs = 1, 41 kMinRequestedGlyphs = 1,
38 kDefaultRequestedGlyphs = 64, 42 kDefaultRequestedGlyphs = 64,
39 kMinRequestedVerts = kMinRequestedGlyphs * 4, 43 kMinRequestedVerts = kMinRequestedGlyphs * 4,
40 kDefaultRequestedVerts = kDefaultRequestedGlyphs * 4, 44 kDefaultRequestedVerts = kDefaultRequestedGlyphs * 4,
41 }; 45 };
42 46
43 SkPoint* fVertices; 47 SkPoint* fVertices;
44 int32_t fMaxVertices; 48 int32_t fMaxVertices;
45 GrTexture* fCurrTexture; 49 GrTexture* fCurrTexture;
46 int fCurrVertex; 50 int fCurrVertex;
47 }; 51 };
48 52
49 #endif 53 #endif
OLDNEW
« no previous file with comments | « include/gpu/SkGpuDevice.h ('k') | src/gpu/GrBitmapTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698