diff options
Diffstat (limited to 'tools/skpbench')
-rw-r--r-- | tools/skpbench/skpbench.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/skpbench/skpbench.cpp b/tools/skpbench/skpbench.cpp index 8898da25d5..c0ead46155 100644 --- a/tools/skpbench/skpbench.cpp +++ b/tools/skpbench/skpbench.cpp @@ -7,6 +7,8 @@ #include "GpuTimer.h" #include "GrContextFactory.h" +#include "SkGr.h" + #include "SkCanvas.h" #include "SkCommonFlagsPathRenderer.h" #include "SkOSFile.h" @@ -287,9 +289,13 @@ int main(int argc, char** argv) { exitf(ExitErr::kUnavailable, "render target size %ix%i not supported by platform (max: %i)", width, height, ctx->caps()->maxRenderTargetSize()); } - if (ctx->caps()->maxSampleCount() < config->getSamples()) { - exitf(ExitErr::kUnavailable, "sample count %i not supported by platform (max: %i)", - config->getSamples(), ctx->caps()->maxSampleCount()); + GrPixelConfig grPixConfig = SkImageInfo2GrPixelConfig(config->getColorType(), + config->getColorSpace(), + *ctx->caps()); + int supportedSampleCount = ctx->caps()->getSampleCount(config->getSamples(), grPixConfig); + if (supportedSampleCount != config->getSamples()) { + exitf(ExitErr::kUnavailable, "sample count %i not supported by platform", + config->getSamples()); } sk_gpu_test::TestContext* testCtx = ctxInfo.testContext(); if (!testCtx) { |