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 10 matching lines...) Expand all Loading... |
21 class SkDrawFilter; | 21 class SkDrawFilter; |
22 class SkTextBlob; | 22 class SkTextBlob; |
23 | 23 |
24 /* | 24 /* |
25 * This class wraps the state for a single text render | 25 * This class wraps the state for a single text render |
26 */ | 26 */ |
27 class GrTextContext { | 27 class GrTextContext { |
28 public: | 28 public: |
29 virtual ~GrTextContext() {} | 29 virtual ~GrTextContext() {} |
30 | 30 |
31 virtual void drawText(GrDrawContext* dc, | 31 virtual void drawText(GrContext*, GrDrawContext* dc, |
32 const GrClip&, const GrPaint&, const SkPaint&, | 32 const GrClip&, const GrPaint&, const SkPaint&, |
33 const SkMatrix& viewMatrix, | 33 const SkMatrix& viewMatrix, |
34 const SkSurfaceProps& props, const char text[], size_t
byteLength, | 34 const SkSurfaceProps& props, const char text[], size_t
byteLength, |
35 SkScalar x, SkScalar y, const SkIRect& clipBounds) = 0
; | 35 SkScalar x, SkScalar y, const SkIRect& clipBounds) = 0
; |
36 virtual void drawPosText(GrDrawContext* dc, | 36 virtual void drawPosText(GrContext*, GrDrawContext* dc, |
37 const GrClip&, const GrPaint&, const SkPaint&, | 37 const GrClip&, const GrPaint&, const SkPaint&, |
38 const SkMatrix& viewMatrix, | 38 const SkMatrix& viewMatrix, |
39 const SkSurfaceProps& props, | 39 const SkSurfaceProps& props, |
40 const char text[], size_t byteLength, | 40 const char text[], size_t byteLength, |
41 const SkScalar pos[], int scalarsPerPosition, | 41 const SkScalar pos[], int scalarsPerPosition, |
42 const SkPoint& offset, const SkIRect& clipBounds) =
0; | 42 const SkPoint& offset, const SkIRect& clipBounds) =
0; |
43 virtual void drawTextBlob(GrDrawContext* dc, const GrClip&, | 43 virtual void drawTextBlob(GrContext*, GrDrawContext* dc, const GrClip&, |
44 const SkPaint&, const SkMatrix& viewMatrix, | 44 const SkPaint&, const SkMatrix& viewMatrix, |
45 const SkSurfaceProps& props, const SkTextBlob*, | 45 const SkSurfaceProps& props, const SkTextBlob*, |
46 SkScalar x, SkScalar y, | 46 SkScalar x, SkScalar y, |
47 SkDrawFilter*, const SkIRect& clipBounds) = 0; | 47 SkDrawFilter*, const SkIRect& clipBounds) = 0; |
48 | 48 |
49 static bool ShouldDisableLCD(const SkPaint& paint); | 49 static bool ShouldDisableLCD(const SkPaint& paint); |
50 | 50 |
51 protected: | 51 protected: |
52 GrContext* fContext; | |
53 | |
54 GrTextContext(GrContext*); | |
55 | |
56 static GrFontScaler* GetGrFontScaler(SkGlyphCache* cache); | 52 static GrFontScaler* GetGrFontScaler(SkGlyphCache* cache); |
57 static uint32_t FilterTextFlags(const SkSurfaceProps& surfaceProps, const Sk
Paint& paint); | 53 static uint32_t FilterTextFlags(const SkSurfaceProps& surfaceProps, const Sk
Paint& paint); |
58 | 54 |
59 friend class GrAtlasTextBatch; | 55 friend class GrAtlasTextBatch; |
60 friend class GrAtlasTextBlob; // for FilterTextFlags | 56 friend class GrAtlasTextBlob; // for FilterTextFlags |
61 friend class GrTextUtils; // for some static functions | 57 friend class GrTextUtils; // for some static functions |
62 }; | 58 }; |
63 | 59 |
64 #endif | 60 #endif |
OLD | NEW |