| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 GrTextContext_DEFINED | 8 #ifndef GrTextContext_DEFINED |
| 9 #define GrTextContext_DEFINED | 9 #define GrTextContext_DEFINED |
| 10 | 10 |
| 11 #include "GrClip.h" | 11 #include "GrClip.h" |
| 12 #include "GrGlyph.h" | 12 #include "GrGlyph.h" |
| 13 #include "GrPaint.h" | 13 #include "GrPaint.h" |
| 14 #include "SkDeviceProperties.h" | 14 #include "SkDeviceProperties.h" |
| 15 | 15 |
| 16 #include "SkPostConfig.h" | 16 #include "SkPostConfig.h" |
| 17 | 17 |
| 18 class GrClip; | 18 class GrClip; |
| 19 class GrContext; | 19 class GrContext; |
| 20 class GrDrawTarget; | 20 class GrDrawTarget; |
| 21 class GrFontScaler; | 21 class GrFontScaler; |
| 22 class SkDrawFilter; | 22 class SkDrawFilter; |
| 23 class SkGpuDevice; | 23 class SkGpuDevice; |
| 24 class SkTextBlob; | 24 class SkTextBlob; |
| 25 | 25 |
| 26 // For testing textblobs on GPU. | |
| 27 #define USE_BITMAP_TEXTBLOBS | |
| 28 | |
| 29 /* | 26 /* |
| 30 * This class wraps the state for a single text render | 27 * This class wraps the state for a single text render |
| 31 */ | 28 */ |
| 32 class GrTextContext { | 29 class GrTextContext { |
| 33 public: | 30 public: |
| 34 virtual ~GrTextContext(); | 31 virtual ~GrTextContext(); |
| 35 | 32 |
| 36 void drawText(GrRenderTarget* rt, const GrClip&, const GrPaint&, const SkPa
int&, | 33 void drawText(GrRenderTarget* rt, const GrClip&, const GrPaint&, const SkPa
int&, |
| 37 const SkMatrix& viewMatrix, const char text[], size_t byteLeng
th, SkScalar x, | 34 const SkMatrix& viewMatrix, const char text[], size_t byteLeng
th, SkScalar x, |
| 38 SkScalar y, const SkIRect& clipBounds); | 35 SkScalar y, const SkIRect& clipBounds); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 88 |
| 92 static GrFontScaler* GetGrFontScaler(SkGlyphCache* cache); | 89 static GrFontScaler* GetGrFontScaler(SkGlyphCache* cache); |
| 93 // sets extent in stopVector and returns glyph count | 90 // sets extent in stopVector and returns glyph count |
| 94 static int MeasureText(SkGlyphCache* cache, SkDrawCacheProc glyphCacheProc, | 91 static int MeasureText(SkGlyphCache* cache, SkDrawCacheProc glyphCacheProc, |
| 95 const char text[], size_t byteLength, SkVector* stopV
ector); | 92 const char text[], size_t byteLength, SkVector* stopV
ector); |
| 96 | 93 |
| 97 friend class BitmapTextBatch; | 94 friend class BitmapTextBatch; |
| 98 }; | 95 }; |
| 99 | 96 |
| 100 #endif | 97 #endif |
| OLD | NEW |