| 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 "GrBatchAtlas.h" | 13 #include "GrBatchAtlas.h" |
| 14 #include "GrBatchFontCache.h" | 14 #include "GrBatchFontCache.h" |
| 15 #include "GrGeometryProcessor.h" | 15 #include "GrGeometryProcessor.h" |
| 16 #include "SkDescriptor.h" | 16 #include "SkDescriptor.h" |
| 17 #include "GrMemoryPool.h" | 17 #include "GrMemoryPool.h" |
| 18 #include "SkMaskFilter.h" | 18 #include "SkMaskFilter.h" |
| 19 #include "SkTextBlob.h" | 19 #include "SkTextBlob.h" |
| 20 #include "SkTInternalLList.h" | 20 #include "SkTInternalLList.h" |
| 21 | 21 |
| 22 #ifdef GR_TEST_UTILS | 22 #ifdef GR_TEST_UTILS |
| 23 #include "GrBatchTest.h" | 23 #include "GrBatchTest.h" |
| 24 #endif | 24 #endif |
| 25 | 25 |
| 26 class BitmapTextBatch; | 26 class BitmapTextBatch; |
| 27 class GrDrawContext; |
| 27 class GrPipelineBuilder; | 28 class GrPipelineBuilder; |
| 28 class GrTextBlobCache; | 29 class GrTextBlobCache; |
| 29 | 30 |
| 30 /* | 31 /* |
| 31 * This class implements GrTextContext using standard bitmap fonts, and can also
process textblobs. | 32 * This class implements GrTextContext using standard bitmap fonts, and can also
process textblobs. |
| 32 * TODO replace GrBitmapTextContext | 33 * TODO replace GrBitmapTextContext |
| 33 */ | 34 */ |
| 34 class GrAtlasTextContext : public GrTextContext { | 35 class GrAtlasTextContext : public GrTextContext { |
| 35 public: | 36 public: |
| 36 static GrAtlasTextContext* Create(GrContext*, SkGpuDevice*, const SkDevicePr
operties&, | 37 static GrAtlasTextContext* Create(GrContext*, SkGpuDevice*, const SkDevicePr
operties&, |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 size_t vertexStride, bool useVertexColor, | 272 size_t vertexStride, bool useVertexColor, |
| 272 GrGlyph*); | 273 GrGlyph*); |
| 273 | 274 |
| 274 inline void flushRunAsPaths(const SkTextBlob::RunIterator&, const SkPaint&,
SkDrawFilter*, | 275 inline void flushRunAsPaths(const SkTextBlob::RunIterator&, const SkPaint&,
SkDrawFilter*, |
| 275 const SkMatrix& viewMatrix, const SkIRect& clipB
ounds, SkScalar x, | 276 const SkMatrix& viewMatrix, const SkIRect& clipB
ounds, SkScalar x, |
| 276 SkScalar y); | 277 SkScalar y); |
| 277 inline BitmapTextBatch* createBatch(BitmapTextBlob*, const PerSubRunInfo&, | 278 inline BitmapTextBatch* createBatch(BitmapTextBlob*, const PerSubRunInfo&, |
| 278 int glyphCount, int run, int subRun, | 279 int glyphCount, int run, int subRun, |
| 279 GrColor, SkScalar transX, SkScalar trans
Y, | 280 GrColor, SkScalar transX, SkScalar trans
Y, |
| 280 const SkPaint&); | 281 const SkPaint&); |
| 281 inline void flushRun(GrDrawTarget*, GrPipelineBuilder*, BitmapTextBlob*, int
run, GrColor, | 282 inline void flushRun(GrDrawContext*, GrPipelineBuilder*, BitmapTextBlob*, in
t run, GrColor, |
| 282 SkScalar transX, SkScalar transY, const SkPaint&); | 283 SkScalar transX, SkScalar transY, const SkPaint&); |
| 283 inline void flushBigGlyphs(BitmapTextBlob* cacheBlob, GrRenderTarget* rt, | 284 inline void flushBigGlyphs(BitmapTextBlob* cacheBlob, GrRenderTarget* rt, |
| 284 const SkPaint& skPaint, | 285 const SkPaint& skPaint, |
| 285 SkScalar transX, SkScalar transY, const SkIRect&
clipBounds); | 286 SkScalar transX, SkScalar transY, const SkIRect&
clipBounds); |
| 286 | 287 |
| 287 // We have to flush SkTextBlobs differently from drawText / drawPosText | 288 // We have to flush SkTextBlobs differently from drawText / drawPosText |
| 288 void flush(GrDrawTarget*, const SkTextBlob*, BitmapTextBlob*, GrRenderTarget
*, const SkPaint&, | 289 void flush(GrDrawContext*, const SkTextBlob*, BitmapTextBlob*, GrRenderTarge
t*, const SkPaint&, |
| 289 const GrPaint&, SkDrawFilter*, const GrClip&, const SkMatrix& vie
wMatrix, | 290 const GrPaint&, SkDrawFilter*, const GrClip&, const SkMatrix& vie
wMatrix, |
| 290 const SkIRect& clipBounds, SkScalar x, SkScalar y, SkScalar trans
X, SkScalar transY); | 291 const SkIRect& clipBounds, SkScalar x, SkScalar y, SkScalar trans
X, SkScalar transY); |
| 291 void flush(GrDrawTarget*, BitmapTextBlob*, GrRenderTarget*, const SkPaint&, | 292 void flush(GrDrawContext*, BitmapTextBlob*, GrRenderTarget*, const SkPaint&, |
| 292 const GrPaint&, const GrClip&, const SkIRect& clipBounds); | 293 const GrPaint&, const GrClip&, const SkIRect& clipBounds); |
| 293 | 294 |
| 294 // A helper for drawing BitmapText in a run of distance fields | 295 // A helper for drawing BitmapText in a run of distance fields |
| 295 inline void fallbackDrawPosText(BitmapTextBlob*, int runIndex, | 296 inline void fallbackDrawPosText(BitmapTextBlob*, int runIndex, |
| 296 GrRenderTarget*, const GrClip&, | 297 GrRenderTarget*, const GrClip&, |
| 297 const GrPaint&, | 298 const GrPaint&, |
| 298 const SkPaint&, const SkMatrix& viewMatrix, | 299 const SkPaint&, const SkMatrix& viewMatrix, |
| 299 const SkTDArray<char>& fallbackTxt, | 300 const SkTDArray<char>& fallbackTxt, |
| 300 const SkTDArray<SkScalar>& fallbackPos, | 301 const SkTDArray<SkScalar>& fallbackPos, |
| 301 int scalarsPerPosition, | 302 int scalarsPerPosition, |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 friend class BitmapTextBatch; | 389 friend class BitmapTextBatch; |
| 389 | 390 |
| 390 #ifdef GR_TEST_UTILS | 391 #ifdef GR_TEST_UTILS |
| 391 BATCH_TEST_FRIEND(TextBlobBatch); | 392 BATCH_TEST_FRIEND(TextBlobBatch); |
| 392 #endif | 393 #endif |
| 393 | 394 |
| 394 typedef GrTextContext INHERITED; | 395 typedef GrTextContext INHERITED; |
| 395 }; | 396 }; |
| 396 | 397 |
| 397 #endif | 398 #endif |
| OLD | NEW |