Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(424)

Side by Side Diff: bench/nanobench.cpp

Issue 1149773005: Add direct getter for GrCaps to GrContext. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: init caps in the right place Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | include/gpu/GrContext.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « no previous file | include/gpu/GrContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698