joshualitt | 0a42e68 | 2015-12-10 13:20:58 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef GrTextUtils_DEFINED |
| 9 | #define GrTextUtils_DEFINED |
| 10 | |
| 11 | #include "SkScalar.h" |
| 12 | |
| 13 | class GrClip; |
| 14 | class GrContext; |
| 15 | class GrDrawContext; |
| 16 | class SkMatrix; |
| 17 | struct SkIRect; |
| 18 | class SkPaint; |
| 19 | struct SkPoint; |
| 20 | class SkSurfaceProps; |
| 21 | |
| 22 | /* |
| 23 | * A class to house a bunch of common text utilities. This class should *ONLY* have static |
| 24 | * functions. It is not a namespace only because we wish to friend SkPaint |
| 25 | * |
| 26 | */ |
| 27 | class GrTextUtils { |
| 28 | public: |
| 29 | |
| 30 | static void DrawTextAsPath(GrContext*, GrDrawContext*, const GrClip& clip, |
| 31 | const SkPaint& origPaint, const SkMatrix& viewMatrix, |
| 32 | const char text[], size_t byteLength, SkScalar x, SkScalar y, |
| 33 | const SkIRect& clipBounds); |
| 34 | |
| 35 | static void DrawPosTextAsPath(GrContext* context, |
| 36 | GrDrawContext* dc, |
| 37 | const SkSurfaceProps& props, |
| 38 | const GrClip& clip, |
| 39 | const SkPaint& origPaint, const SkMatrix& viewMatrix, |
| 40 | const char text[], size_t byteLength, |
| 41 | const SkScalar pos[], int scalarsPerPosition, |
| 42 | const SkPoint& offset, const SkIRect& clipBounds); |
| 43 | }; |
| 44 | |
| 45 | #endif |