diff options
author | Brian Salomon <bsalomon@google.com> | 2018-02-01 18:02:35 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-02-02 00:16:28 +0000 |
commit | 85ae7159c9c8a9186a4c7e74304eabb35bca9a79 (patch) | |
tree | 8f1cf3aa71803889d1f2b1b84b43013395f188ac /src/gpu/GrContext.cpp | |
parent | e45d32abe13239e3482fc4a13f006ab72073252a (diff) |
Add new GrContext queries for imagability, surfacability, and max sample count of color types
Bug: skia:7538
Change-Id: I235fc1aa947ba57faa7aef5e7e7ce9241b315fff
Reviewed-on: https://skia-review.googlesource.com/99704
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/GrContext.cpp')
-rw-r--r-- | src/gpu/GrContext.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index 0d481ac6ef..05908f4889 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -420,6 +420,18 @@ size_t GrContext::getResourceCachePurgeableBytes() const { //////////////////////////////////////////////////////////////////////////////// +bool GrContext::colorTypeSupportedAsImage(SkColorType colorType) const { + GrPixelConfig config = SkImageInfo2GrPixelConfig(colorType, nullptr, *this->caps()); + return this->caps()->isConfigTexturable(config); +} + +int GrContext::maxSurfaceSampleCountForColorType(SkColorType colorType) const { + GrPixelConfig config = SkImageInfo2GrPixelConfig(colorType, nullptr, *this->caps()); + return this->caps()->maxRenderTargetSampleCount(config); +} + +//////////////////////////////////////////////////////////////////////////////// + void GrContext::TextBlobCacheOverBudgetCB(void* data) { SkASSERT(data); // TextBlobs are drawn at the SkGpuDevice level, therefore they cannot rely on |