OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 GrStencilAndCoverTextContext_DEFINED | 8 #ifndef GrStencilAndCoverTextContext_DEFINED |
9 #define GrStencilAndCoverTextContext_DEFINED | 9 #define GrStencilAndCoverTextContext_DEFINED |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 * LCD text, even if the client provided positions for hinted glyphs, | 44 * LCD text, even if the client provided positions for hinted glyphs, |
45 * and renders from a canonically-sized, generic set of paths for the | 45 * and renders from a canonically-sized, generic set of paths for the |
46 * given typeface. In the future we should work out a system for the | 46 * given typeface. In the future we should work out a system for the |
47 * client to know it should not provide hinted glyph positions. This | 47 * client to know it should not provide hinted glyph positions. This |
48 * render mode also tries to use GPU stroking for fake bold, even when | 48 * render mode also tries to use GPU stroking for fake bold, even when |
49 * SK_USE_FREETYPE_EMBOLDEN is set. | 49 * SK_USE_FREETYPE_EMBOLDEN is set. |
50 */ | 50 */ |
51 kMaxPerformance_RenderMode, | 51 kMaxPerformance_RenderMode, |
52 }; | 52 }; |
53 | 53 |
54 GrPipelineBuilder fPipelineBuilder; | 54 GrPipelineBuilder fPipelineBuilder; |
55 GrPipelineBuilder::AutoRestoreEffects fStateRestore; | 55 GrPipelineBuilder::AutoRestoreFragmentProcessors fStateRestore; |
56 SkScalar fTextRatio; | 56 SkScalar fTextRatio; |
57 float fTextInverseRatio; | 57 float fTextInverseRatio; |
58 SkGlyphCache* fGlyphCache; | 58 SkGlyphCache* fGlyphCache; |
59 GrPathRange* fGlyphs; | 59 GrPathRange* fGlyphs; |
60 SkStrokeRec fStroke; | 60 SkStrokeRec fStroke; |
61 uint16_t fGlyphIndices[kGlyphBufferSize]; | 61 uint16_t fGlyphIndices[kGlyphBuff
erSize]; |
62 SkPoint fGlyphPositions[kGlyphBufferSize]; | 62 SkPoint fGlyphPositions[kGlyphBu
fferSize]; |
63 int fQueuedGlyphCount; | 63 int fQueuedGlyphCount; |
64 int fFallbackGlyphsIdx; | 64 int fFallbackGlyphsIdx; |
65 SkMatrix fContextInitialMatrix; | 65 SkMatrix fContextInitialMatrix; |
66 SkMatrix fViewMatrix; | 66 SkMatrix fViewMatrix; |
67 SkMatrix fLocalMatrix; | 67 SkMatrix fLocalMatrix; |
68 bool fUsingDeviceSpaceGlyphs; | 68 bool fUsingDeviceSpaceGlyphs; |
69 | 69 |
70 GrStencilAndCoverTextContext(GrContext*, const SkDeviceProperties&); | 70 GrStencilAndCoverTextContext(GrContext*, const SkDeviceProperties&); |
71 | 71 |
72 bool canDraw(const SkPaint& paint, const SkMatrix& viewMatrix) SK_OVERRIDE; | 72 bool canDraw(const SkPaint& paint, const SkMatrix& viewMatrix) SK_OVERRIDE; |
73 | 73 |
74 virtual void onDrawText(GrRenderTarget*, const GrClip&, const GrPaint&, cons
t SkPaint&, | 74 virtual void onDrawText(GrRenderTarget*, const GrClip&, const GrPaint&, cons
t SkPaint&, |
75 const SkMatrix& viewMatrix, | 75 const SkMatrix& viewMatrix, |
76 const char text[], size_t byteLength, | 76 const char text[], size_t byteLength, |
77 SkScalar x, SkScalar y) SK_OVERRIDE; | 77 SkScalar x, SkScalar y) SK_OVERRIDE; |
78 virtual void onDrawPosText(GrRenderTarget*, const GrClip&, const GrPaint&, c
onst SkPaint&, | 78 virtual void onDrawPosText(GrRenderTarget*, const GrClip&, const GrPaint&, c
onst SkPaint&, |
79 const SkMatrix& viewMatrix, | 79 const SkMatrix& viewMatrix, |
80 const char text[], size_t byteLength, | 80 const char text[], size_t byteLength, |
81 const SkScalar pos[], int scalarsPerPosition, | 81 const SkScalar pos[], int scalarsPerPosition, |
82 const SkPoint& offset) SK_OVERRIDE; | 82 const SkPoint& offset) SK_OVERRIDE; |
83 | 83 |
84 void init(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPaint&, | 84 void init(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPaint&, |
85 size_t textByteLength, RenderMode, const SkMatrix& viewMatrix); | 85 size_t textByteLength, RenderMode, const SkMatrix& viewMatrix); |
86 bool mapToFallbackContext(SkMatrix* inverse); | 86 bool mapToFallbackContext(SkMatrix* inverse); |
87 void appendGlyph(const SkGlyph&, const SkPoint&); | 87 void appendGlyph(const SkGlyph&, const SkPoint&); |
88 void flush(); | 88 void flush(); |
89 void finish(); | 89 void finish(); |
90 | 90 |
91 }; | 91 }; |
92 | 92 |
93 #endif | 93 #endif |
OLD | NEW |