OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 GrTextContext_DEFINED | 8 #ifndef GrTextContext_DEFINED |
9 #define GrTextContext_DEFINED | 9 #define GrTextContext_DEFINED |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 SkAutoTUnref<GrRenderTarget> fRenderTarget; | 44 SkAutoTUnref<GrRenderTarget> fRenderTarget; |
45 GrClip fClip; | 45 GrClip fClip; |
46 GrDrawTarget* fDrawTarget; | 46 GrDrawTarget* fDrawTarget; |
47 SkIRect fClipRect; | 47 SkIRect fClipRect; |
48 GrPaint fPaint; | 48 GrPaint fPaint; |
49 SkPaint fSkPaint; | 49 SkPaint fSkPaint; |
50 | 50 |
51 GrTextContext(GrContext*, const SkDeviceProperties&); | 51 GrTextContext(GrContext*, const SkDeviceProperties&); |
52 | 52 |
53 virtual bool canDraw(const SkPaint& paint, const SkMatrix& viewMatrix) = 0; | 53 virtual bool canDraw(const GrRenderTarget*, const SkPaint&, const SkMatrix&
viewMatrix) = 0; |
54 | 54 |
55 virtual void onDrawText(GrRenderTarget*, const GrClip&, const GrPaint&, cons
t SkPaint&, | 55 virtual void onDrawText(GrRenderTarget*, const GrClip&, const GrPaint&, cons
t SkPaint&, |
56 const SkMatrix& viewMatrix, const char text[], size_
t byteLength, | 56 const SkMatrix& viewMatrix, const char text[], size_
t byteLength, |
57 SkScalar x, SkScalar y) = 0; | 57 SkScalar x, SkScalar y) = 0; |
58 virtual void onDrawPosText(GrRenderTarget*, const GrClip&, const GrPaint&, c
onst SkPaint&, | 58 virtual void onDrawPosText(GrRenderTarget*, const GrClip&, const GrPaint&, c
onst SkPaint&, |
59 const SkMatrix& viewMatrix, | 59 const SkMatrix& viewMatrix, |
60 const char text[], size_t byteLength, | 60 const char text[], size_t byteLength, |
61 const SkScalar pos[], int scalarsPerPosition, | 61 const SkScalar pos[], int scalarsPerPosition, |
62 const SkPoint& offset) = 0; | 62 const SkPoint& offset) = 0; |
63 | 63 |
64 void init(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPaint&); | 64 void init(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPaint&); |
65 void finish() { fDrawTarget = NULL; } | 65 void finish() { fDrawTarget = NULL; } |
66 | 66 |
67 static GrFontScaler* GetGrFontScaler(SkGlyphCache* cache); | 67 static GrFontScaler* GetGrFontScaler(SkGlyphCache* cache); |
68 // sets extent in stopVector and returns glyph count | 68 // sets extent in stopVector and returns glyph count |
69 static int MeasureText(SkGlyphCache* cache, SkDrawCacheProc glyphCacheProc, | 69 static int MeasureText(SkGlyphCache* cache, SkDrawCacheProc glyphCacheProc, |
70 const char text[], size_t byteLength, SkVector* stopV
ector); | 70 const char text[], size_t byteLength, SkVector* stopV
ector); |
71 }; | 71 }; |
72 | 72 |
73 #endif | 73 #endif |
OLD | NEW |