| 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 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 static bool ShouldDisableLCD(const SkPaint& paint); | 46 static bool ShouldDisableLCD(const SkPaint& paint); |
| 47 | 47 |
| 48 protected: | 48 protected: |
| 49 GrTextContext* fFallbackTextContext; | 49 GrTextContext* fFallbackTextContext; |
| 50 GrContext* fContext; | 50 GrContext* fContext; |
| 51 SkSurfaceProps fSurfaceProps; | 51 SkSurfaceProps fSurfaceProps; |
| 52 | 52 |
| 53 GrTextContext(GrContext*, const SkSurfaceProps&); | 53 GrTextContext(GrContext*, const SkSurfaceProps&); |
| 54 | 54 |
| 55 virtual bool canDraw(const GrRenderTarget*, const GrClip&, const GrPaint&, | 55 virtual bool canDraw(const SkPaint&, const SkMatrix& viewMatrix) = 0; |
| 56 const SkPaint&, const SkMatrix& viewMatrix) = 0; | |
| 57 | 56 |
| 58 virtual void onDrawText(GrDrawContext*, GrRenderTarget*, const GrClip&, | 57 virtual void onDrawText(GrDrawContext*, GrRenderTarget*, const GrClip&, |
| 59 const GrPaint&, const SkPaint&, | 58 const GrPaint&, const SkPaint&, |
| 60 const SkMatrix& viewMatrix, const char text[], size_
t byteLength, | 59 const SkMatrix& viewMatrix, const char text[], size_
t byteLength, |
| 61 SkScalar x, SkScalar y, const SkIRect& clipBounds) =
0; | 60 SkScalar x, SkScalar y, const SkIRect& clipBounds) =
0; |
| 62 virtual void onDrawPosText(GrDrawContext*, GrRenderTarget*, const GrClip&, | 61 virtual void onDrawPosText(GrDrawContext*, GrRenderTarget*, const GrClip&, |
| 63 const GrPaint&, const SkPaint&, | 62 const GrPaint&, const SkPaint&, |
| 64 const SkMatrix& viewMatrix, | 63 const SkMatrix& viewMatrix, |
| 65 const char text[], size_t byteLength, | 64 const char text[], size_t byteLength, |
| 66 const SkScalar pos[], int scalarsPerPosition, | 65 const SkScalar pos[], int scalarsPerPosition, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 79 static GrFontScaler* GetGrFontScaler(SkGlyphCache* cache); | 78 static GrFontScaler* GetGrFontScaler(SkGlyphCache* cache); |
| 80 // sets extent in stopVector and returns glyph count | 79 // sets extent in stopVector and returns glyph count |
| 81 static int MeasureText(SkGlyphCache* cache, SkDrawCacheProc glyphCacheProc, | 80 static int MeasureText(SkGlyphCache* cache, SkDrawCacheProc glyphCacheProc, |
| 82 const char text[], size_t byteLength, SkVector* stopV
ector); | 81 const char text[], size_t byteLength, SkVector* stopV
ector); |
| 83 static uint32_t FilterTextFlags(const SkSurfaceProps& surfaceProps, const Sk
Paint& paint); | 82 static uint32_t FilterTextFlags(const SkSurfaceProps& surfaceProps, const Sk
Paint& paint); |
| 84 | 83 |
| 85 friend class GrAtlasTextBatch; | 84 friend class GrAtlasTextBatch; |
| 86 }; | 85 }; |
| 87 | 86 |
| 88 #endif | 87 #endif |
| OLD | NEW |