Let text contexts fall back directly to paths
BUG=skia:
Review URL: https://codereview.chromium.org/1015173002
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 6a225c2..335b416 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -41,6 +41,7 @@
class GrVertexBufferAllocPool;
class GrStrokeInfo;
class GrSoftwarePathRenderer;
+class SkGpuDevice;
class SkStrokeRec;
class SK_API GrContext : public SkRefCnt {
@@ -201,16 +202,6 @@
*/
bool isResourceInCache(const GrUniqueKey& key) const;
- /**
- * Creates a new text rendering context that is optimal for the
- * render target and the context. Caller assumes the ownership
- * of the returned object. The returned object must be deleted
- * before the context is destroyed.
- */
- GrTextContext* createTextContext(GrRenderTarget*,
- const SkDeviceProperties&,
- bool enableDistanceFieldFonts);
-
///////////////////////////////////////////////////////////////////////////
// Textures
@@ -763,6 +754,20 @@
GrTexture* internalRefScratchTexture(const GrSurfaceDesc&, uint32_t flags);
/**
+ * Creates a new text rendering context that is optimal for the
+ * render target and the context. Caller assumes the ownership
+ * of the returned object. The returned object must be deleted
+ * before the context is destroyed.
+ * TODO we can possibly bury this behind context, but we need to be able to use the
+ * drawText_asPaths logic on SkGpuDevice
+ */
+ GrTextContext* createTextContext(GrRenderTarget*,
+ SkGpuDevice*,
+ const SkDeviceProperties&,
+ bool enableDistanceFieldFonts);
+
+
+ /**
* These functions create premul <-> unpremul effects if it is possible to generate a pair
* of effects that make a readToUPM->writeToPM->readToUPM cycle invariant. Otherwise, they
* return NULL.
@@ -776,6 +781,9 @@
*/
static void OverBudgetCB(void* data);
+ // TODO see note on createTextContext
+ friend class SkGpuDevice;
+
typedef SkRefCnt INHERITED;
};