blob: cd2067f4645eea2a5e3b86756f1d4a272659cdfc [file] [log] [blame]
joshualitt0a42e682015-12-10 13:20:58 -08001/*
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
13class GrClip;
14class GrContext;
15class GrDrawContext;
16class SkMatrix;
17struct SkIRect;
18class SkPaint;
19struct SkPoint;
20class 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 */
27class GrTextUtils {
28public:
29
30static 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
35static 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