OLD | NEW |
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 GrDistanceFieldTextContext_DEFINED | 8 #ifndef GrDistanceFieldTextContext_DEFINED |
9 #define GrDistanceFieldTextContext_DEFINED | 9 #define GrDistanceFieldTextContext_DEFINED |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 void* fVertices; | 44 void* fVertices; |
45 int fCurrVertex; | 45 int fCurrVertex; |
46 int fAllocVertexCount; | 46 int fAllocVertexCount; |
47 int fTotalVertexCount; | 47 int fTotalVertexCount; |
48 GrTexture* fCurrTexture; | 48 GrTexture* fCurrTexture; |
49 SkRect fVertexBounds; | 49 SkRect fVertexBounds; |
50 SkMatrix fViewMatrix; | 50 SkMatrix fViewMatrix; |
51 | 51 |
52 GrDistanceFieldTextContext(GrContext*, SkGpuDevice*, const SkDevicePropertie
s&, bool enable); | 52 GrDistanceFieldTextContext(GrContext*, SkGpuDevice*, const SkDevicePropertie
s&, bool enable); |
53 | 53 |
54 bool canDraw(const SkPaint& paint, const SkMatrix& viewMatrix) SK_OVERRIDE; | 54 bool canDraw(const GrRenderTarget*, const GrClip&, const GrPaint&, |
| 55 const SkPaint&, const SkMatrix& viewMatrix) SK_OVERRIDE; |
55 | 56 |
56 virtual void onDrawText(GrRenderTarget*, const GrClip&, const GrPaint&, cons
t SkPaint&, | 57 void onDrawText(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPain
t&, |
57 const SkMatrix& viewMatrix, | 58 const SkMatrix& viewMatrix, |
58 const char text[], size_t byteLength, | 59 const char text[], size_t byteLength, |
59 SkScalar x, SkScalar y, const SkIRect& regionClipBou
nds) SK_OVERRIDE; | 60 SkScalar x, SkScalar y, const SkIRect& regionClipBounds) SK_
OVERRIDE; |
60 virtual void onDrawPosText(GrRenderTarget*, const GrClip&, const GrPaint&, c
onst SkPaint&, | 61 void onDrawPosText(GrRenderTarget*, const GrClip&, const GrPaint&, const SkP
aint&, |
61 const SkMatrix& viewMatrix, | 62 const SkMatrix& viewMatrix, |
62 const char text[], size_t byteLength, | 63 const char text[], size_t byteLength, |
63 const SkScalar pos[], int scalarsPerPosition, | 64 const SkScalar pos[], int scalarsPerPosition, |
64 const SkPoint& offset, const SkIRect& regionClipB
ounds) SK_OVERRIDE; | 65 const SkPoint& offset, const SkIRect& regionClipBounds) S
K_OVERRIDE; |
65 | 66 |
66 void init(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPaint&, | 67 void init(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPaint&, |
67 const SkIRect& regionClipBounds); | 68 const SkIRect& regionClipBounds); |
68 bool appendGlyph(GrGlyph::PackedID, SkScalar left, SkScalar top, GrFontScale
r*); | 69 bool appendGlyph(GrGlyph::PackedID, SkScalar left, SkScalar top, GrFontScale
r*); |
69 bool uploadGlyph(GrGlyph*, GrFontScaler*); | 70 bool uploadGlyph(GrGlyph*, GrFontScaler*); |
70 void setupCoverageEffect(const SkColor& filteredColor); | 71 void setupCoverageEffect(const SkColor& filteredColor); |
71 void flush(); // automatically called by destructor | 72 void flush(); // automatically called by destructor |
72 void finish(); | 73 void finish(); |
73 }; | 74 }; |
74 | 75 |
75 #endif | 76 #endif |
OLD | NEW |