Chromium Code Reviews| 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 SkGpuDevice; | 23 class SkGpuDevice; |
| 24 class SkTextBlob; | |
| 23 | 25 |
| 24 /* | 26 /* |
| 25 * This class wraps the state for a single text render | 27 * This class wraps the state for a single text render |
| 26 */ | 28 */ |
| 27 class GrTextContext { | 29 class GrTextContext { |
| 28 public: | 30 public: |
| 29 virtual ~GrTextContext(); | 31 virtual ~GrTextContext(); |
| 30 | 32 |
| 31 void drawText(GrRenderTarget* rt, const GrClip&, const GrPaint&, const SkPa int&, | 33 void drawText(GrRenderTarget* rt, const GrClip&, const GrPaint&, const SkPa int&, |
| 32 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, |
| 33 SkScalar y, const SkIRect& clipBounds); | 35 SkScalar y, const SkIRect& clipBounds); |
| 34 void drawPosText(GrRenderTarget* rt, const GrClip&, const GrPaint&, const Sk Paint&, | 36 void drawPosText(GrRenderTarget* rt, const GrClip&, const GrPaint&, const Sk Paint&, |
| 35 const SkMatrix& viewMatrix, | 37 const SkMatrix& viewMatrix, |
| 36 const char text[], size_t byteLength, | 38 const char text[], size_t byteLength, |
| 37 const SkScalar pos[], int scalarsPerPosition, | 39 const SkScalar pos[], int scalarsPerPosition, |
| 38 const SkPoint& offset, const SkIRect& clipBounds); | 40 const SkPoint& offset, const SkIRect& clipBounds); |
| 41 void drawTextBlob(GrRenderTarget*, const GrClip&, const SkPaint&, | |
|
robertphillips
2015/03/18 20:05:12
It is probably relevant that this is the viewMatri
| |
| 42 const SkMatrix&, const SkTextBlob*, SkScalar x, SkScalar y , | |
| 43 SkDrawFilter*, const SkIRect& clipBounds); | |
| 39 | 44 |
| 40 protected: | 45 protected: |
| 41 GrTextContext* fFallbackTextContext; | 46 GrTextContext* fFallbackTextContext; |
| 42 GrContext* fContext; | 47 GrContext* fContext; |
| 43 // TODO we probably don't really need to store a back pointer to the owning SkGpuDevice, except | 48 // TODO we probably don't really need to store a back pointer to the owning SkGpuDevice, except |
| 44 // we need to be able to call drawPath on it in the event no other text cont ext can draw the | 49 // we need to be able to call drawPath on it in the event no other text cont ext can draw the |
| 45 // text. We might be able to move this logic to context though. | 50 // text. We might be able to move this logic to context though. |
| 46 SkGpuDevice* fGpuDevice; | 51 SkGpuDevice* fGpuDevice; |
| 47 SkDeviceProperties fDeviceProperties; | 52 SkDeviceProperties fDeviceProperties; |
| 48 | 53 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 static GrFontScaler* GetGrFontScaler(SkGlyphCache* cache); | 85 static GrFontScaler* GetGrFontScaler(SkGlyphCache* cache); |
| 81 // sets extent in stopVector and returns glyph count | 86 // sets extent in stopVector and returns glyph count |
| 82 static int MeasureText(SkGlyphCache* cache, SkDrawCacheProc glyphCacheProc, | 87 static int MeasureText(SkGlyphCache* cache, SkDrawCacheProc glyphCacheProc, |
| 83 const char text[], size_t byteLength, SkVector* stopV ector); | 88 const char text[], size_t byteLength, SkVector* stopV ector); |
| 84 | 89 |
| 85 friend class GrDistanceFieldTextContext; | 90 friend class GrDistanceFieldTextContext; |
| 86 friend class GrStencilAndCoverTextContext; | 91 friend class GrStencilAndCoverTextContext; |
| 87 }; | 92 }; |
| 88 | 93 |
| 89 #endif | 94 #endif |
| OLD | NEW |