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 29 matching lines...) Expand all Loading... | |
40 const SkMatrix& viewMatrix, const SkTextBlob*, | 40 const SkMatrix& viewMatrix, const SkTextBlob*, |
41 SkScalar x, SkScalar y, | 41 SkScalar x, SkScalar y, |
42 SkDrawFilter*, const SkIRect& clipBounds); | 42 SkDrawFilter*, const SkIRect& clipBounds); |
43 | 43 |
44 static bool ShouldDisableLCD(const SkPaint& paint); | 44 static bool ShouldDisableLCD(const SkPaint& paint); |
45 | 45 |
46 protected: | 46 protected: |
47 GrTextContext* fFallbackTextContext; | 47 GrTextContext* fFallbackTextContext; |
48 GrContext* fContext; | 48 GrContext* fContext; |
49 SkDeviceProperties fDeviceProperties; | 49 SkDeviceProperties fDeviceProperties; |
50 bool fUseDFT; | |
50 | 51 |
52 GrDrawContext* fDrawContext; // owning drawContext | |
51 SkAutoTUnref<GrRenderTarget> fRenderTarget; | 53 SkAutoTUnref<GrRenderTarget> fRenderTarget; |
52 GrClip fClip; | 54 GrClip fClip; |
53 SkIRect fClipRect; | 55 SkIRect fClipRect; |
54 SkIRect fRegionClipBounds; | 56 SkIRect fRegionClipBounds; |
55 GrPaint fPaint; | 57 GrPaint fPaint; |
56 SkPaint fSkPaint; | 58 SkPaint fSkPaint; |
57 | 59 |
58 GrTextContext(GrContext*, const SkDeviceProperties&); | 60 GrTextContext(GrContext*, GrDrawContext*, const SkDeviceProperties&, bool us eDFT); |
bsalomon
2015/06/11 01:47:57
Seems odd for the base class to know about DF. Is
| |
59 | 61 |
60 virtual bool canDraw(const GrRenderTarget*, const GrClip&, const GrPaint&, | 62 virtual bool canDraw(const GrRenderTarget*, const GrClip&, const GrPaint&, |
61 const SkPaint&, const SkMatrix& viewMatrix) = 0; | 63 const SkPaint&, const SkMatrix& viewMatrix) = 0; |
62 | 64 |
63 virtual void onDrawText(GrDrawContext*, GrRenderTarget*, const GrClip&, | 65 virtual void onDrawText(GrRenderTarget*, const GrClip&, |
64 const GrPaint&, const SkPaint&, | 66 const GrPaint&, const SkPaint&, |
65 const SkMatrix& viewMatrix, const char text[], size_ t byteLength, | 67 const SkMatrix& viewMatrix, const char text[], size_ t byteLength, |
66 SkScalar x, SkScalar y, const SkIRect& clipBounds) = 0; | 68 SkScalar x, SkScalar y, const SkIRect& clipBounds) = 0; |
67 virtual void onDrawPosText(GrDrawContext*, GrRenderTarget*, const GrClip&, | 69 virtual void onDrawPosText(GrRenderTarget*, const GrClip&, |
68 const GrPaint&, const SkPaint&, | 70 const GrPaint&, const SkPaint&, |
69 const SkMatrix& viewMatrix, | 71 const SkMatrix& viewMatrix, |
70 const char text[], size_t byteLength, | 72 const char text[], size_t byteLength, |
71 const SkScalar pos[], int scalarsPerPosition, | 73 const SkScalar pos[], int scalarsPerPosition, |
72 const SkPoint& offset, const SkIRect& clipBounds) = 0; | 74 const SkPoint& offset, const SkIRect& clipBounds) = 0; |
73 | 75 |
74 void drawTextAsPath(GrDrawContext*, GrRenderTarget*, const GrClip& clip, | 76 void drawTextAsPath(GrRenderTarget*, const GrClip& clip, |
75 const SkPaint& origPaint, const SkMatrix& viewMatrix, | 77 const SkPaint& origPaint, const SkMatrix& viewMatrix, |
76 const char text[], size_t byteLength, SkScalar x, SkScal ar y, | 78 const char text[], size_t byteLength, SkScalar x, SkScal ar y, |
77 const SkIRect& clipBounds); | 79 const SkIRect& clipBounds); |
78 void drawPosTextAsPath(GrDrawContext*, GrRenderTarget*, const GrClip& clip, | 80 void drawPosTextAsPath(GrRenderTarget*, const GrClip& clip, |
79 const SkPaint& origPaint, const SkMatrix& viewMatrix, | 81 const SkPaint& origPaint, const SkMatrix& viewMatrix, |
80 const char text[], size_t byteLength, | 82 const char text[], size_t byteLength, |
81 const SkScalar pos[], int scalarsPerPosition, | 83 const SkScalar pos[], int scalarsPerPosition, |
82 const SkPoint& offset, const SkIRect& clipBounds); | 84 const SkPoint& offset, const SkIRect& clipBounds); |
83 | 85 |
84 void init(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPaint&, | 86 void init(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPaint&, |
85 const SkIRect& regionClipBounds); | 87 const SkIRect& regionClipBounds); |
86 | 88 |
87 static GrFontScaler* GetGrFontScaler(SkGlyphCache* cache); | 89 static GrFontScaler* GetGrFontScaler(SkGlyphCache* cache); |
88 // sets extent in stopVector and returns glyph count | 90 // sets extent in stopVector and returns glyph count |
89 static int MeasureText(SkGlyphCache* cache, SkDrawCacheProc glyphCacheProc, | 91 static int MeasureText(SkGlyphCache* cache, SkDrawCacheProc glyphCacheProc, |
90 const char text[], size_t byteLength, SkVector* stopV ector); | 92 const char text[], size_t byteLength, SkVector* stopV ector); |
91 static uint32_t FilterTextFlags(const SkDeviceProperties& devProps, const Sk Paint& paint); | 93 static uint32_t FilterTextFlags(const SkDeviceProperties& devProps, const Sk Paint& paint); |
92 | 94 |
93 friend class BitmapTextBatch; | 95 friend class BitmapTextBatch; |
94 }; | 96 }; |
95 | 97 |
96 #endif | 98 #endif |
OLD | NEW |