Index: src/gpu/GrContext.cpp |
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp |
index 2bb085b6bcff9e8a1eef0a264078bfc51d44890b..5baf72209385afdc210faaf90134a07abc8e3cde 100755 |
--- a/src/gpu/GrContext.cpp |
+++ b/src/gpu/GrContext.cpp |
@@ -138,7 +138,6 @@ |
GrContext::GrContext() : fUniqueID(next_id()) { |
fGpu = NULL; |
- fCaps = NULL; |
fResourceCache = NULL; |
fResourceProvider = NULL; |
fPathRendererChain = NULL; |
@@ -174,13 +173,10 @@ |
fBatchFontCache = SkNEW_ARGS(GrBatchFontCache, (this)); |
fTextBlobCache.reset(SkNEW_ARGS(GrTextBlobCache, (TextBlobCacheOverBudgetCB, this))); |
- |
- fCaps = SkRef(fGpu->caps()); |
} |
GrContext::~GrContext() { |
if (!fGpu) { |
- SkASSERT(!fCaps); |
return; |
} |
@@ -195,7 +191,6 @@ |
SkDELETE(fBatchFontCache); |
fGpu->unref(); |
- fCaps->unref(); |
SkSafeUnref(fPathRendererChain); |
SkSafeUnref(fSoftwarePathRenderer); |
} |
@@ -263,6 +258,18 @@ |
//////////////////////////////////////////////////////////////////////////////// |
+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); |
@@ -281,6 +288,18 @@ |
// drawPath on SkGpuDevice |
GrContext* context = reinterpret_cast<GrContext*>(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(); |
} |
//////////////////////////////////////////////////////////////////////////////// |
@@ -668,9 +687,13 @@ |
} |
//////////////////////////////////////////////////////////////////////////////// |
+bool GrContext::isConfigRenderable(GrPixelConfig config, bool withMSAA) const { |
+ return fGpu->caps()->isConfigRenderable(config, withMSAA); |
+} |
+ |
int GrContext::getRecommendedSampleCount(GrPixelConfig config, |
SkScalar dpi) const { |
- if (!this->caps()->isConfigRenderable(config, true)) { |
+ if (!this->isConfigRenderable(config, true)) { |
return 0; |
} |
int chosenSampleCount = 0; |