Index: include/gpu/GrContext.h |
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h |
index acd7b1ad911ee3e1ce92d5f40a8e846fdc66f243..c7cfa762a3951f4f737be05ff507f8a6d9ce5e02 100644 |
--- a/include/gpu/GrContext.h |
+++ b/include/gpu/GrContext.h |
@@ -43,7 +43,6 @@ class GrTextureParams; |
class GrVertexBuffer; |
class GrStrokeInfo; |
class GrSoftwarePathRenderer; |
-class SkGpuDevice; |
class SK_API GrContext : public SkRefCnt { |
public: |
@@ -177,8 +176,8 @@ public: |
* |
* @return a draw context |
*/ |
- GrDrawContext* drawContext() { |
- return fDrawingMgr.drawContext(); |
+ GrDrawContext* drawContext(const SkDeviceProperties* devProps = NULL, bool useDFT = false) { |
+ return fDrawingMgr.drawContext(devProps, useDFT); |
} |
/////////////////////////////////////////////////////////////////////////// |
@@ -396,9 +395,8 @@ private: |
// the DAG. |
class DrawingMgr { |
public: |
- DrawingMgr() |
- : fDrawTarget(NULL) |
- , fDrawContext(NULL) { |
+ DrawingMgr() : fDrawTarget(NULL) { |
+ sk_bzero(fDrawContext, sizeof(fDrawContext)); |
} |
~DrawingMgr(); |
@@ -414,14 +412,18 @@ private: |
// Callers should take a ref if they rely on the GrDrawContext sticking around. |
// NULL will be returned if the context has been abandoned. |
- GrDrawContext* drawContext(); |
+ GrDrawContext* drawContext(const SkDeviceProperties* devProps, bool useDFT); |
private: |
friend class GrContext; // for access to fDrawTarget for testing |
+ static const int kNumContextFlavors = 5; |
jvanverth1
2015/06/09 19:22:38
It's not clear that these "flavors" are pixel geom
robertphillips
2015/06/09 19:26:20
I agree - should be fixed in PS #3.
|
+ static const int kNumDFTOptions = 2; |
+ |
+ GrContext* fContext; |
GrDrawTarget* fDrawTarget; |
- GrDrawContext* fDrawContext; |
+ GrDrawContext* fDrawContext[kNumContextFlavors][kNumDFTOptions]; |
}; |
DrawingMgr fDrawingMgr; |
@@ -430,18 +432,6 @@ private: |
void initCommon(); |
/** |
- * 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 bury this behind context! |
- */ |
- GrTextContext* createTextContext(GrRenderTarget*, |
- 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. |
@@ -461,9 +451,6 @@ private: |
*/ |
static void TextBlobCacheOverBudgetCB(void* data); |
- // TODO see note on createTextContext |
- friend class SkGpuDevice; |
- |
typedef SkRefCnt INHERITED; |
}; |