| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrAtlasTextContext_DEFINED | 8 #ifndef GrAtlasTextContext_DEFINED |
| 9 #define GrAtlasTextContext_DEFINED | 9 #define GrAtlasTextContext_DEFINED |
| 10 | 10 |
| 11 #include "GrTextContext.h" | 11 #include "GrTextContext.h" |
| 12 | 12 |
| 13 #include "GrAtlasTextBlob.h" | 13 #include "GrAtlasTextBlob.h" |
| 14 #include "GrGeometryProcessor.h" | 14 #include "GrGeometryProcessor.h" |
| 15 #include "SkTextBlob.h" | 15 #include "SkTextBlob.h" |
| 16 | 16 |
| 17 #ifdef GR_TEST_UTILS | 17 #ifdef GR_TEST_UTILS |
| 18 #include "GrBatchTest.h" | 18 #include "GrBatchTest.h" |
| 19 #endif | 19 #endif |
| 20 | 20 |
| 21 class GrDrawBatch; |
| 21 class GrDrawContext; | 22 class GrDrawContext; |
| 22 class GrDrawTarget; | 23 class GrDrawTarget; |
| 23 class GrPipelineBuilder; | 24 class GrPipelineBuilder; |
| 24 class GrTextBlobCache; | 25 class GrTextBlobCache; |
| 25 class SkGlyph; | 26 class SkGlyph; |
| 26 | 27 |
| 27 /* | 28 /* |
| 28 * This class implements GrTextContext using standard bitmap fonts, and can also
process textblobs. | 29 * This class implements GrTextContext using standard bitmap fonts, and can also
process textblobs. |
| 29 * TODO replace GrBitmapTextContext | 30 * TODO replace GrBitmapTextContext |
| 30 */ | 31 */ |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 inline void appendGlyphCommon(GrAtlasTextBlob*, Run*, Run::SubRunInfo*, | 69 inline void appendGlyphCommon(GrAtlasTextBlob*, Run*, Run::SubRunInfo*, |
| 69 const SkRect& positions, GrColor color, | 70 const SkRect& positions, GrColor color, |
| 70 size_t vertexStride, bool useVertexColor, | 71 size_t vertexStride, bool useVertexColor, |
| 71 GrGlyph*); | 72 GrGlyph*); |
| 72 | 73 |
| 73 inline void flushRunAsPaths(GrRenderTarget*, | 74 inline void flushRunAsPaths(GrRenderTarget*, |
| 74 const SkTextBlob::RunIterator&, const GrClip& cl
ip, | 75 const SkTextBlob::RunIterator&, const GrClip& cl
ip, |
| 75 const SkPaint&, SkDrawFilter*, | 76 const SkPaint&, SkDrawFilter*, |
| 76 const SkMatrix& viewMatrix, const SkIRect& clipB
ounds, SkScalar x, | 77 const SkMatrix& viewMatrix, const SkIRect& clipB
ounds, SkScalar x, |
| 77 SkScalar y); | 78 SkScalar y); |
| 78 inline GrBatch* createBatch(GrAtlasTextBlob*, const PerSubRunInfo&, | 79 inline GrDrawBatch* createBatch(GrAtlasTextBlob*, const PerSubRunInfo&, |
| 79 int glyphCount, int run, int subRun, | 80 int glyphCount, int run, int subRun, |
| 80 GrColor, SkScalar transX, SkScalar transY, | 81 GrColor, SkScalar transX, SkScalar transY, |
| 81 const SkPaint&); | 82 const SkPaint&); |
| 82 inline void flushRun(GrPipelineBuilder*, GrAtlasTextBlob*, int run, GrColor, | 83 inline void flushRun(GrPipelineBuilder*, GrAtlasTextBlob*, int run, GrColor, |
| 83 SkScalar transX, SkScalar transY, const SkPaint&); | 84 SkScalar transX, SkScalar transY, const SkPaint&); |
| 84 inline void flushBigGlyphs(GrAtlasTextBlob* cacheBlob, GrRenderTarget*, | 85 inline void flushBigGlyphs(GrAtlasTextBlob* cacheBlob, GrRenderTarget*, |
| 85 const GrClip& clip, const SkPaint& skPaint, | 86 const GrClip& clip, const SkPaint& skPaint, |
| 86 SkScalar transX, SkScalar transY, const SkIRect&
clipBounds); | 87 SkScalar transX, SkScalar transY, const SkIRect&
clipBounds); |
| 87 | 88 |
| 88 // We have to flush SkTextBlobs differently from drawText / drawPosText | 89 // We have to flush SkTextBlobs differently from drawText / drawPosText |
| 89 void flush(const SkTextBlob*, GrAtlasTextBlob*, GrRenderTarget*, | 90 void flush(const SkTextBlob*, GrAtlasTextBlob*, GrRenderTarget*, |
| 90 const SkPaint&, const GrPaint&, SkDrawFilter*, const GrClip&, | 91 const SkPaint&, const GrPaint&, SkDrawFilter*, const GrClip&, |
| 91 const SkMatrix& viewMatrix, const SkIRect& clipBounds, SkScalar x
, SkScalar y, | 92 const SkMatrix& viewMatrix, const SkIRect& clipBounds, SkScalar x
, SkScalar y, |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 }; | 180 }; |
| 180 | 181 |
| 181 GrBatchTextStrike* fCurrStrike; | 182 GrBatchTextStrike* fCurrStrike; |
| 182 GrTextBlobCache* fCache; | 183 GrTextBlobCache* fCache; |
| 183 SkAutoTUnref<DistanceAdjustTable> fDistanceAdjustTable; | 184 SkAutoTUnref<DistanceAdjustTable> fDistanceAdjustTable; |
| 184 | 185 |
| 185 friend class GrTextBlobCache; | 186 friend class GrTextBlobCache; |
| 186 friend class TextBatch; | 187 friend class TextBatch; |
| 187 | 188 |
| 188 #ifdef GR_TEST_UTILS | 189 #ifdef GR_TEST_UTILS |
| 189 BATCH_TEST_FRIEND(TextBlobBatch); | 190 DRAW_BATCH_TEST_FRIEND(TextBlobBatch); |
| 190 #endif | 191 #endif |
| 191 | 192 |
| 192 typedef GrTextContext INHERITED; | 193 typedef GrTextContext INHERITED; |
| 193 }; | 194 }; |
| 194 | 195 |
| 195 #endif | 196 #endif |
| OLD | NEW |