Index: src/gpu/GrContext.cpp |
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp |
index 5baf72209385afdc210faaf90134a07abc8e3cde..ca98ffb416a7f6fec0364cedbc38b8abcda5c6f5 100755 |
--- a/src/gpu/GrContext.cpp |
+++ b/src/gpu/GrContext.cpp |
@@ -138,6 +138,7 @@ static int32_t next_id() { |
GrContext::GrContext() : fUniqueID(next_id()) { |
fGpu = NULL; |
+ fCaps = NULL; |
fResourceCache = NULL; |
fResourceProvider = NULL; |
fPathRendererChain = NULL; |
@@ -159,6 +160,7 @@ bool GrContext::init(GrBackend backend, GrBackendContext backendContext, |
} |
void GrContext::initCommon() { |
+ fCaps = SkRef(fGpu->caps()); |
fResourceCache = SkNEW(GrResourceCache); |
fResourceCache->setOverBudgetCallback(OverBudgetCB, this); |
fResourceProvider = SkNEW_ARGS(GrResourceProvider, (fGpu, fResourceCache)); |
@@ -177,6 +179,7 @@ void GrContext::initCommon() { |
GrContext::~GrContext() { |
if (!fGpu) { |
+ SkASSERT(!fCaps); |
return; |
} |
@@ -191,6 +194,7 @@ GrContext::~GrContext() { |
SkDELETE(fBatchFontCache); |
fGpu->unref(); |
+ fCaps->unref(); |
SkSafeUnref(fPathRendererChain); |
SkSafeUnref(fSoftwarePathRenderer); |
} |
@@ -258,18 +262,6 @@ GrTextContext* GrContext::createTextContext(GrRenderTarget* renderTarget, |
//////////////////////////////////////////////////////////////////////////////// |
-bool GrContext::shaderDerivativeSupport() const { |
- return fGpu->caps()->shaderCaps()->shaderDerivativeSupport(); |
-} |
- |
-bool GrContext::isConfigTexturable(GrPixelConfig config) const { |
- return fGpu->caps()->isConfigTexturable(config); |
-} |
- |
-bool GrContext::npotTextureTileSupport() const { |
- return fGpu->caps()->npotTextureTileSupport(); |
-} |
- |
void GrContext::OverBudgetCB(void* data) { |
SkASSERT(data); |
@@ -290,18 +282,6 @@ void GrContext::TextBlobCacheOverBudgetCB(void* data) { |
context->flush(); |
} |
-int GrContext::getMaxTextureSize() const { |
- return fGpu->caps()->maxTextureSize(); |
-} |
- |
-int GrContext::getMaxRenderTargetSize() const { |
- return fGpu->caps()->maxRenderTargetSize(); |
-} |
- |
-int GrContext::getMaxSampleCount() const { |
- return fGpu->caps()->maxSampleCount(); |
-} |
- |
//////////////////////////////////////////////////////////////////////////////// |
void GrContext::flush(int flagsBitfield) { |
@@ -687,13 +667,9 @@ GrPathRenderer* GrContext::getPathRenderer(const GrDrawTarget* target, |
} |
//////////////////////////////////////////////////////////////////////////////// |
-bool GrContext::isConfigRenderable(GrPixelConfig config, bool withMSAA) const { |
- return fGpu->caps()->isConfigRenderable(config, withMSAA); |
-} |
- |
int GrContext::getRecommendedSampleCount(GrPixelConfig config, |
SkScalar dpi) const { |
- if (!this->isConfigRenderable(config, true)) { |
+ if (!this->caps()->isConfigRenderable(config, true)) { |
return 0; |
} |
int chosenSampleCount = 0; |