aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image/SkSurface_Gpu.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-02-01 18:02:35 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-02 00:16:28 +0000
commit85ae7159c9c8a9186a4c7e74304eabb35bca9a79 (patch)
tree8f1cf3aa71803889d1f2b1b84b43013395f188ac /src/image/SkSurface_Gpu.cpp
parente45d32abe13239e3482fc4a13f006ab72073252a (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/image/SkSurface_Gpu.cpp')
-rw-r--r--src/image/SkSurface_Gpu.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
index 8d81665511..8759f3eeed 100644
--- a/src/image/SkSurface_Gpu.cpp
+++ b/src/image/SkSurface_Gpu.cpp
@@ -334,7 +334,9 @@ bool validate_backend_texture(GrContext* ctx, const GrBackendTexture& tex, GrPix
return false;
}
- if (ctx->caps()->getRenderTargetSampleCount(sampleCnt, *config) != sampleCnt) {
+ // We don't require that the client gave us an exact valid sample cnt. However, it must be
+ // less than the max supported sample count and 1 if MSAA is unsupported for the color type.
+ if (!ctx->caps()->getRenderTargetSampleCount(sampleCnt, *config)) {
return false;
}