| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 const GrPaint&, const SkPaint&, | 59 const GrPaint&, const SkPaint&, |
| 60 const SkMatrix& viewMatrix, const char text[], size_
t byteLength, | 60 const SkMatrix& viewMatrix, const char text[], size_
t byteLength, |
| 61 SkScalar x, SkScalar y, const SkIRect& clipBounds) =
0; | 61 SkScalar x, SkScalar y, const SkIRect& clipBounds) =
0; |
| 62 virtual void onDrawPosText(GrDrawContext*, GrRenderTarget*, const GrClip&, | 62 virtual void onDrawPosText(GrDrawContext*, GrRenderTarget*, const GrClip&, |
| 63 const GrPaint&, const SkPaint&, | 63 const GrPaint&, const SkPaint&, |
| 64 const SkMatrix& viewMatrix, | 64 const SkMatrix& viewMatrix, |
| 65 const char text[], size_t byteLength, | 65 const char text[], size_t byteLength, |
| 66 const SkScalar pos[], int scalarsPerPosition, | 66 const SkScalar pos[], int scalarsPerPosition, |
| 67 const SkPoint& offset, const SkIRect& clipBounds)
= 0; | 67 const SkPoint& offset, const SkIRect& clipBounds)
= 0; |
| 68 | 68 |
| 69 void drawTextAsPath(GrDrawContext*, GrRenderTarget*, const GrClip& clip, | 69 void drawTextAsPath(GrDrawContext*, const GrClip& clip, |
| 70 const SkPaint& origPaint, const SkMatrix& viewMatrix, | 70 const SkPaint& origPaint, const SkMatrix& viewMatrix, |
| 71 const char text[], size_t byteLength, SkScalar x, SkScal
ar y, | 71 const char text[], size_t byteLength, SkScalar x, SkScal
ar y, |
| 72 const SkIRect& clipBounds); | 72 const SkIRect& clipBounds); |
| 73 void drawPosTextAsPath(GrDrawContext*, GrRenderTarget*, const GrClip& clip, | 73 void drawPosTextAsPath(GrDrawContext*, const GrClip& clip, |
| 74 const SkPaint& origPaint, const SkMatrix& viewMatrix, | 74 const SkPaint& origPaint, const SkMatrix& viewMatrix, |
| 75 const char text[], size_t byteLength, | 75 const char text[], size_t byteLength, |
| 76 const SkScalar pos[], int scalarsPerPosition, | 76 const SkScalar pos[], int scalarsPerPosition, |
| 77 const SkPoint& offset, const SkIRect& clipBounds); | 77 const SkPoint& offset, const SkIRect& clipBounds); |
| 78 | 78 |
| 79 static GrFontScaler* GetGrFontScaler(SkGlyphCache* cache); | 79 static GrFontScaler* GetGrFontScaler(SkGlyphCache* cache); |
| 80 // sets extent in stopVector and returns glyph count | 80 // sets extent in stopVector and returns glyph count |
| 81 static int MeasureText(SkGlyphCache* cache, SkDrawCacheProc glyphCacheProc, | 81 static int MeasureText(SkGlyphCache* cache, SkDrawCacheProc glyphCacheProc, |
| 82 const char text[], size_t byteLength, SkVector* stopV
ector); | 82 const char text[], size_t byteLength, SkVector* stopV
ector); |
| 83 static uint32_t FilterTextFlags(const SkSurfaceProps& surfaceProps, const Sk
Paint& paint); | 83 static uint32_t FilterTextFlags(const SkSurfaceProps& surfaceProps, const Sk
Paint& paint); |
| 84 | 84 |
| 85 friend class GrAtlasTextBatch; | 85 friend class GrAtlasTextBatch; |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 #endif | 88 #endif |
| OLD | NEW |