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 "GrGeometryProcessor.h" | 13 #include "GrGeometryProcessor.h" |
14 #include "GrMemoryPool.h" | 14 #include "GrMemoryPool.h" |
15 #include "SkDescriptor.h" | 15 #include "SkDescriptor.h" |
16 #include "SkTHash.h" | 16 #include "SkTHash.h" |
17 | 17 |
18 class GrBatchTextStrike; | 18 class GrBatchTextStrike; |
19 class GrPipelineBuilder; | 19 class GrPipelineBuilder; |
20 | 20 |
21 /* | 21 /* |
22 * This class implements GrTextContext using standard bitmap fonts, and can also
process textblobs. | 22 * This class implements GrTextContext using standard bitmap fonts, and can also
process textblobs. |
23 * TODO replace GrBitmapTextContext | 23 * TODO replace GrBitmapTextContext |
24 */ | 24 */ |
25 class GrBitmapTextContextB : public GrTextContext { | 25 class GrAtlasTextContext : public GrTextContext { |
26 public: | 26 public: |
27 static GrBitmapTextContextB* Create(GrContext*, SkGpuDevice*, const SkDevice
Properties&); | 27 static GrAtlasTextContext* Create(GrContext*, SkGpuDevice*, const SkDevicePr
operties&); |
28 | 28 |
29 virtual ~GrBitmapTextContextB(); | 29 virtual ~GrAtlasTextContext(); |
30 | 30 |
31 private: | 31 private: |
32 GrBitmapTextContextB(GrContext*, SkGpuDevice*, const SkDeviceProperties&); | 32 GrAtlasTextContext(GrContext*, SkGpuDevice*, const SkDeviceProperties&); |
33 | 33 |
34 bool canDraw(const GrRenderTarget*, const GrClip&, const GrPaint&, | 34 bool canDraw(const GrRenderTarget*, const GrClip&, const GrPaint&, |
35 const SkPaint&, const SkMatrix& viewMatrix) override; | 35 const SkPaint&, const SkMatrix& viewMatrix) override; |
36 | 36 |
37 void onDrawText(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPain
t&, | 37 void onDrawText(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPain
t&, |
38 const SkMatrix& viewMatrix, const char text[], size_t byteLe
ngth, | 38 const SkMatrix& viewMatrix, const char text[], size_t byteLe
ngth, |
39 SkScalar x, SkScalar y, const SkIRect& regionClipBounds) ove
rride; | 39 SkScalar x, SkScalar y, const SkIRect& regionClipBounds) ove
rride; |
40 void onDrawPosText(GrRenderTarget*, const GrClip&, const GrPaint&, const SkP
aint&, | 40 void onDrawPosText(GrRenderTarget*, const GrClip&, const GrPaint&, const SkP
aint&, |
41 const SkMatrix& viewMatrix, | 41 const SkMatrix& viewMatrix, |
42 const char text[], size_t byteLength, | 42 const char text[], size_t byteLength, |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 // TODO use real cache | 174 // TODO use real cache |
175 static void ClearCacheEntry(uint32_t key, BitmapTextBlob**); | 175 static void ClearCacheEntry(uint32_t key, BitmapTextBlob**); |
176 SkTHashMap<uint32_t, BitmapTextBlob*, BitmapTextBlob::Hash> fCache; | 176 SkTHashMap<uint32_t, BitmapTextBlob*, BitmapTextBlob::Hash> fCache; |
177 | 177 |
178 friend class BitmapTextBatch; | 178 friend class BitmapTextBatch; |
179 | 179 |
180 typedef GrTextContext INHERITED; | 180 typedef GrTextContext INHERITED; |
181 }; | 181 }; |
182 | 182 |
183 #endif | 183 #endif |
OLD | NEW |