| 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 25 matching lines...) Expand all Loading... |
| 36 #include "SkString.h" | 36 #include "SkString.h" |
| 37 #include "SkSurface.h" | 37 #include "SkSurface.h" |
| 38 #include "SkTaskGroup.h" | 38 #include "SkTaskGroup.h" |
| 39 | 39 |
| 40 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK | 40 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK |
| 41 #include "nanobenchAndroid.h" | 41 #include "nanobenchAndroid.h" |
| 42 #endif | 42 #endif |
| 43 | 43 |
| 44 #if SK_SUPPORT_GPU | 44 #if SK_SUPPORT_GPU |
| 45 #include "gl/GrGLDefines.h" | 45 #include "gl/GrGLDefines.h" |
| 46 #include "GrCaps.h" |
| 46 #include "GrContextFactory.h" | 47 #include "GrContextFactory.h" |
| 47 SkAutoTDelete<GrContextFactory> gGrFactory; | 48 SkAutoTDelete<GrContextFactory> gGrFactory; |
| 48 #endif | 49 #endif |
| 49 | 50 |
| 50 struct GrContextOptions; | 51 struct GrContextOptions; |
| 51 | 52 |
| 52 __SK_FORCE_IMAGE_DECODER_LINKING; | 53 __SK_FORCE_IMAGE_DECODER_LINKING; |
| 53 | 54 |
| 54 static const int kAutoTuneLoops = 0; | 55 static const int kAutoTuneLoops = 0; |
| 55 | 56 |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 return false; | 366 return false; |
| 366 } | 367 } |
| 367 | 368 |
| 368 #if SK_SUPPORT_GPU | 369 #if SK_SUPPORT_GPU |
| 369 static bool is_gpu_config_allowed(const char* name, GrContextFactory::GLContextT
ype ctxType, | 370 static bool is_gpu_config_allowed(const char* name, GrContextFactory::GLContextT
ype ctxType, |
| 370 int sampleCnt) { | 371 int sampleCnt) { |
| 371 if (!is_cpu_config_allowed(name)) { | 372 if (!is_cpu_config_allowed(name)) { |
| 372 return false; | 373 return false; |
| 373 } | 374 } |
| 374 if (const GrContext* ctx = gGrFactory->get(ctxType)) { | 375 if (const GrContext* ctx = gGrFactory->get(ctxType)) { |
| 375 return sampleCnt <= ctx->getMaxSampleCount(); | 376 return sampleCnt <= ctx->caps()->maxSampleCount(); |
| 376 } | 377 } |
| 377 return false; | 378 return false; |
| 378 } | 379 } |
| 379 #endif | 380 #endif |
| 380 | 381 |
| 381 #if SK_SUPPORT_GPU | 382 #if SK_SUPPORT_GPU |
| 382 #define kBogusGLContextType GrContextFactory::kNative_GLContextType | 383 #define kBogusGLContextType GrContextFactory::kNative_GLContextType |
| 383 #else | 384 #else |
| 384 #define kBogusGLContextType 0 | 385 #define kBogusGLContextType 0 |
| 385 #endif | 386 #endif |
| (...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1028 | 1029 |
| 1029 return 0; | 1030 return 0; |
| 1030 } | 1031 } |
| 1031 | 1032 |
| 1032 #if !defined SK_BUILD_FOR_IOS | 1033 #if !defined SK_BUILD_FOR_IOS |
| 1033 int main(int argc, char** argv) { | 1034 int main(int argc, char** argv) { |
| 1034 SkCommandLineFlags::Parse(argc, argv); | 1035 SkCommandLineFlags::Parse(argc, argv); |
| 1035 return nanobench_main(); | 1036 return nanobench_main(); |
| 1036 } | 1037 } |
| 1037 #endif | 1038 #endif |
| OLD | NEW |