Index: include/gpu/GrTextContext.h |
diff --git a/include/gpu/GrTextContext.h b/include/gpu/GrTextContext.h |
index 1539df09a019e5b0227acf7003ee41f6011502ff..1eaaabbb33fc3df99317753650f55d3175cc668a 100644 |
--- a/include/gpu/GrTextContext.h |
+++ b/include/gpu/GrTextContext.h |
@@ -14,7 +14,7 @@ |
#include "SkPostConfig.h" |
-class GrContext; |
+class SkGpuDevice; |
class GrDrawTarget; |
class GrFontScaler; |
@@ -24,15 +24,21 @@ class GrFontScaler; |
class GrTextContext { |
public: |
virtual ~GrTextContext() {} |
- virtual void drawPackedGlyph(GrGlyph::PackedID, GrFixed left, GrFixed top, |
- GrFontScaler*) = 0; |
+ virtual void drawText(const char text[], size_t byteLength, SkScalar x, SkScalar y) = 0; |
+ virtual void drawPosText(const char text[], size_t byteLength, |
+ const SkScalar pos[], SkScalar constY, |
+ int scalarsPerPosition) = 0; |
protected: |
- GrTextContext(GrContext*, const GrPaint&, const SkPaint&); |
+ GrTextContext(SkGpuDevice*, const GrPaint&, const SkPaint&); |
+ static GrFontScaler* GetGrFontScaler(SkGlyphCache* cache); |
+ static void MeasureText(SkGlyphCache* cache, SkDrawCacheProc glyphCacheProc, |
+ const char text[], size_t byteLength, SkVector* stopVector); |
+ |
GrPaint fPaint; |
SkPaint fSkPaint; |
- GrContext* fContext; |
+ SkGpuDevice* fDevice; |
GrDrawTarget* fDrawTarget; |
SkIRect fClipRect; |
@@ -45,7 +51,7 @@ protected: |
class GrTextContextManager { |
public: |
virtual ~GrTextContextManager() {} |
- virtual GrTextContext* create(GrContext* context, const GrPaint& grPaint, |
+ virtual GrTextContext* create(SkGpuDevice* device, const GrPaint& grPaint, |
const SkPaint& skPaint) = 0; |
}; |
@@ -56,11 +62,11 @@ private: |
public: |
~ManagedTextContext() {} |
- ManagedTextContext(GrContext* context, |
+ ManagedTextContext(SkGpuDevice* device, |
bsalomon
2014/01/27 21:51:25
Is this just to get at the device properties? I'd
jvanverth1
2014/01/28 18:05:33
Done.
|
const GrPaint& grPaint, |
const SkPaint& skPaint, |
GrTTextContextManager<TextContextClass>* manager) : |
- TextContextClass(context, grPaint, skPaint) { |
+ TextContextClass(device, grPaint, skPaint) { |
fManager = manager; |
} |
@@ -89,12 +95,12 @@ public: |
sk_free(fAllocation); |
} |
- GrTextContext* create(GrContext* context, const GrPaint& grPaint, |
+ GrTextContext* create(SkGpuDevice* device, const GrPaint& grPaint, |
const SkPaint& skPaint) { |
// add check for usePath here? |
SkASSERT(!fUsed); |
ManagedTextContext* obj = SkNEW_PLACEMENT_ARGS(fAllocation, ManagedTextContext, |
- (context, grPaint, skPaint, this)); |
+ (device, grPaint, skPaint, this)); |
fUsed = true; |
return obj; |
} |