OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include <ctype.h> | 8 #include <ctype.h> |
9 | 9 |
10 #include "nanobench.h" | 10 #include "nanobench.h" |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 #if SK_SUPPORT_GPU | 400 #if SK_SUPPORT_GPU |
401 if (const auto* gpuConfig = config->asConfigGpu()) { | 401 if (const auto* gpuConfig = config->asConfigGpu()) { |
402 if (!FLAGS_gpu) | 402 if (!FLAGS_gpu) |
403 return; | 403 return; |
404 | 404 |
405 auto ctxOptions = GrContextFactory::kNone_ContextOptions; | 405 auto ctxOptions = GrContextFactory::kNone_ContextOptions; |
406 if (gpuConfig->getUseNVPR()) { | 406 if (gpuConfig->getUseNVPR()) { |
407 ctxOptions = static_cast<GrContextFactory::ContextOptions>( | 407 ctxOptions = static_cast<GrContextFactory::ContextOptions>( |
408 ctxOptions | GrContextFactory::kEnableNVPR_ContextOptions); | 408 ctxOptions | GrContextFactory::kEnableNVPR_ContextOptions); |
409 } | 409 } |
| 410 if (gpuConfig->getUseInstanced()) { |
| 411 ctxOptions = static_cast<GrContextFactory::ContextOptions>( |
| 412 ctxOptions | GrContextFactory::kUseInstanced_ContextOptions); |
| 413 } |
410 if (SkColorAndColorSpaceAreGammaCorrect(gpuConfig->getColorType(), | 414 if (SkColorAndColorSpaceAreGammaCorrect(gpuConfig->getColorType(), |
411 gpuConfig->getColorSpace())) { | 415 gpuConfig->getColorSpace())) { |
412 ctxOptions = static_cast<GrContextFactory::ContextOptions>( | 416 ctxOptions = static_cast<GrContextFactory::ContextOptions>( |
413 ctxOptions | GrContextFactory::kRequireSRGBSupport_ContextOption
s); | 417 ctxOptions | GrContextFactory::kRequireSRGBSupport_ContextOption
s); |
414 } | 418 } |
415 const auto ctxType = gpuConfig->getContextType(); | 419 const auto ctxType = gpuConfig->getContextType(); |
416 const auto sampleCount = gpuConfig->getSamples(); | 420 const auto sampleCount = gpuConfig->getSamples(); |
417 | 421 |
418 if (const GrContext* ctx = gGrFactory->get(ctxType, ctxOptions)) { | 422 if (const GrContext* ctx = gGrFactory->get(ctxType, ctxOptions)) { |
419 const auto maxSampleCount = ctx->caps()->maxSampleCount(); | 423 const auto maxSampleCount = ctx->caps()->maxSampleCount(); |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1297 | 1301 |
1298 return 0; | 1302 return 0; |
1299 } | 1303 } |
1300 | 1304 |
1301 #if !defined SK_BUILD_FOR_IOS | 1305 #if !defined SK_BUILD_FOR_IOS |
1302 int main(int argc, char** argv) { | 1306 int main(int argc, char** argv) { |
1303 SkCommandLineFlags::Parse(argc, argv); | 1307 SkCommandLineFlags::Parse(argc, argv); |
1304 return nanobench_main(); | 1308 return nanobench_main(); |
1305 } | 1309 } |
1306 #endif | 1310 #endif |
OLD | NEW |