Index: src/gpu/GrTextContext.h |
diff --git a/src/gpu/GrTextContext.h b/src/gpu/GrTextContext.h |
index d333c631413f751d3b89378f921b4dee815e9994..40a08b6b0d6754d9a93b690f173d0442954fc470 100644 |
--- a/src/gpu/GrTextContext.h |
+++ b/src/gpu/GrTextContext.h |
@@ -19,6 +19,7 @@ class GrClip; |
class GrContext; |
class GrDrawTarget; |
class GrFontScaler; |
+class SkGpuDevice; |
/* |
* This class wraps the state for a single text render |
@@ -27,18 +28,23 @@ class GrTextContext { |
public: |
virtual ~GrTextContext(); |
- bool drawText(GrRenderTarget* rt, const GrClip&, const GrPaint&, const SkPaint&, |
+ void drawText(GrRenderTarget* rt, const GrClip&, const GrPaint&, const SkPaint&, |
const SkMatrix& viewMatrix, const char text[], size_t byteLength, SkScalar x, |
- SkScalar y); |
- bool drawPosText(GrRenderTarget* rt, const GrClip&, const GrPaint&, const SkPaint&, |
+ SkScalar y, const SkIRect& clipBounds); |
+ void drawPosText(GrRenderTarget* rt, const GrClip&, const GrPaint&, const SkPaint&, |
const SkMatrix& viewMatrix, |
const char text[], size_t byteLength, |
const SkScalar pos[], int scalarsPerPosition, |
- const SkPoint& offset); |
+ const SkPoint& offset, const SkIRect& clipBounds); |
protected: |
GrTextContext* fFallbackTextContext; |
GrContext* fContext; |
+ // TODO we probably don't really need to store a back pointer to the owning SkGpuDevice, except |
+ // we need to be able to call drawPath on it in the event no other text context can draw the |
+ // text. We might be able to move this logic to context though. This is unreffed because |
+ // GrTextContext is completely owned by SkGpuDevice |
+ SkGpuDevice* fGpuDevice; |
SkDeviceProperties fDeviceProperties; |
SkAutoTUnref<GrRenderTarget> fRenderTarget; |
@@ -48,7 +54,7 @@ protected: |
GrPaint fPaint; |
SkPaint fSkPaint; |
- GrTextContext(GrContext*, const SkDeviceProperties&); |
+ GrTextContext(GrContext*, SkGpuDevice*, const SkDeviceProperties&); |
virtual bool canDraw(const SkPaint& paint, const SkMatrix& viewMatrix) = 0; |
@@ -61,6 +67,14 @@ protected: |
const SkScalar pos[], int scalarsPerPosition, |
const SkPoint& offset) = 0; |
+ void drawTextAsPath(const SkPaint& origPaint, const SkMatrix& viewMatrix, |
+ const char text[], size_t byteLength, SkScalar x, SkScalar y, |
+ const SkIRect& clipBounds); |
+ void drawPosTextAsPath(const SkPaint& origPaint, const SkMatrix& viewMatrix, |
+ const char text[], size_t byteLength, |
+ const SkScalar pos[], int scalarsPerPosition, |
+ const SkPoint& offset, const SkIRect& clipBounds); |
+ |
void init(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPaint&); |
void finish() { fDrawTarget = NULL; } |
@@ -68,6 +82,9 @@ protected: |
// sets extent in stopVector and returns glyph count |
static int MeasureText(SkGlyphCache* cache, SkDrawCacheProc glyphCacheProc, |
const char text[], size_t byteLength, SkVector* stopVector); |
+ |
+ friend class GrDistanceFieldTextContext; |
+ friend class GrStencilAndCoverTextContext; |
}; |
#endif |