| 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 BitmapTextBatch; | |
| 22 class GrDrawContext; | 21 class GrDrawContext; |
| 23 class GrDrawTarget; | 22 class GrDrawTarget; |
| 24 class GrPipelineBuilder; | 23 class GrPipelineBuilder; |
| 25 class GrTextBlobCache; | 24 class GrTextBlobCache; |
| 26 | 25 |
| 27 /* | 26 /* |
| 28 * This class implements GrTextContext using standard bitmap fonts, and can also
process textblobs. | 27 * This class implements GrTextContext using standard bitmap fonts, and can also
process textblobs. |
| 29 * TODO replace GrBitmapTextContext | 28 * TODO replace GrBitmapTextContext |
| 30 */ | 29 */ |
| 31 class GrAtlasTextContext : public GrTextContext { | 30 class GrAtlasTextContext : public GrTextContext { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 inline void appendGlyphCommon(GrAtlasTextBlob*, Run*, Run::SubRunInfo*, | 67 inline void appendGlyphCommon(GrAtlasTextBlob*, Run*, Run::SubRunInfo*, |
| 69 const SkRect& positions, GrColor color, | 68 const SkRect& positions, GrColor color, |
| 70 size_t vertexStride, bool useVertexColor, | 69 size_t vertexStride, bool useVertexColor, |
| 71 GrGlyph*); | 70 GrGlyph*); |
| 72 | 71 |
| 73 inline void flushRunAsPaths(GrRenderTarget*, | 72 inline void flushRunAsPaths(GrRenderTarget*, |
| 74 const SkTextBlob::RunIterator&, const GrClip& cl
ip, | 73 const SkTextBlob::RunIterator&, const GrClip& cl
ip, |
| 75 const SkPaint&, SkDrawFilter*, | 74 const SkPaint&, SkDrawFilter*, |
| 76 const SkMatrix& viewMatrix, const SkIRect& clipB
ounds, SkScalar x, | 75 const SkMatrix& viewMatrix, const SkIRect& clipB
ounds, SkScalar x, |
| 77 SkScalar y); | 76 SkScalar y); |
| 78 inline BitmapTextBatch* createBatch(GrAtlasTextBlob*, const PerSubRunInfo&, | 77 inline GrBatch* createBatch(GrAtlasTextBlob*, const PerSubRunInfo&, |
| 79 int glyphCount, int run, int subRun, | 78 int glyphCount, int run, int subRun, |
| 80 GrColor, SkScalar transX, SkScalar trans
Y, | 79 GrColor, SkScalar transX, SkScalar transY, |
| 81 const SkPaint&); | 80 const SkPaint&); |
| 82 inline void flushRun(GrPipelineBuilder*, GrAtlasTextBlob*, int run, GrColor, | 81 inline void flushRun(GrPipelineBuilder*, GrAtlasTextBlob*, int run, GrColor, |
| 83 SkScalar transX, SkScalar transY, const SkPaint&); | 82 SkScalar transX, SkScalar transY, const SkPaint&); |
| 84 inline void flushBigGlyphs(GrAtlasTextBlob* cacheBlob, GrRenderTarget*, | 83 inline void flushBigGlyphs(GrAtlasTextBlob* cacheBlob, GrRenderTarget*, |
| 85 const GrClip& clip, const SkPaint& skPaint, | 84 const GrClip& clip, const SkPaint& skPaint, |
| 86 SkScalar transX, SkScalar transY, const SkIRect&
clipBounds); | 85 SkScalar transX, SkScalar transY, const SkIRect&
clipBounds); |
| 87 | 86 |
| 88 // We have to flush SkTextBlobs differently from drawText / drawPosText | 87 // We have to flush SkTextBlobs differently from drawText / drawPosText |
| 89 void flush(const SkTextBlob*, GrAtlasTextBlob*, GrRenderTarget*, | 88 void flush(const SkTextBlob*, GrAtlasTextBlob*, GrRenderTarget*, |
| 90 const SkPaint&, const GrPaint&, SkDrawFilter*, const GrClip&, | 89 const SkPaint&, const GrPaint&, SkDrawFilter*, const GrClip&, |
| 91 const SkMatrix& viewMatrix, const SkIRect& clipBounds, SkScalar x
, SkScalar y, | 90 const SkMatrix& viewMatrix, const SkIRect& clipBounds, SkScalar x
, SkScalar y, |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 void buildDistanceAdjustTable(); | 175 void buildDistanceAdjustTable(); |
| 177 | 176 |
| 178 SkScalar* fTable; | 177 SkScalar* fTable; |
| 179 }; | 178 }; |
| 180 | 179 |
| 181 GrBatchTextStrike* fCurrStrike; | 180 GrBatchTextStrike* fCurrStrike; |
| 182 GrTextBlobCache* fCache; | 181 GrTextBlobCache* fCache; |
| 183 SkAutoTUnref<DistanceAdjustTable> fDistanceAdjustTable; | 182 SkAutoTUnref<DistanceAdjustTable> fDistanceAdjustTable; |
| 184 | 183 |
| 185 friend class GrTextBlobCache; | 184 friend class GrTextBlobCache; |
| 186 friend class BitmapTextBatch; | 185 friend class TextBatch; |
| 187 | 186 |
| 188 #ifdef GR_TEST_UTILS | 187 #ifdef GR_TEST_UTILS |
| 189 BATCH_TEST_FRIEND(TextBlobBatch); | 188 BATCH_TEST_FRIEND(TextBlobBatch); |
| 190 #endif | 189 #endif |
| 191 | 190 |
| 192 typedef GrTextContext INHERITED; | 191 typedef GrTextContext INHERITED; |
| 193 }; | 192 }; |
| 194 | 193 |
| 195 #endif | 194 #endif |
| OLD | NEW |