Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Unified Diff: src/gpu/GrContext.cpp

Issue 1164443002: Revert of Add direct getter for GrCaps to GrContext. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrClipMaskManager.cpp ('k') | src/gpu/GrCoordTransform.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/gpu/GrClipMaskManager.cpp ('k') | src/gpu/GrCoordTransform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698