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

Unified Diff: bench/nanobench.cpp

Issue 1490113005: Add config options to run different GPU APIs to dm and nanobench (Closed) Base URL: https://skia.googlesource.com/skia.git@commandbuffer-as-api-03-context-factory-glcontext-type
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | dm/DM.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/nanobench.cpp
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 11119be2e193b9900b84c7fb4c1981ea533c5388..638477ecf6fc8720af438cf07dde48b162fcb19f 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -28,6 +28,7 @@
#include "SkCanvas.h"
#include "SkCodec.h"
#include "SkCommonFlags.h"
+#include "SkCommonFlagsConfig.h"
#include "SkData.h"
#include "SkForceLinking.h"
#include "SkGraphics.h"
@@ -168,11 +169,10 @@ struct GPUTarget : public Target {
0;
SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType);
this->surface.reset(SkSurface::NewRenderTarget(gGrFactory->get(this->config.ctxType,
- kNone_GrGLStandard,
this->config.ctxOptions),
SkSurface::kNo_Budgeted, info,
this->config.samples, &props));
- this->gl = gGrFactory->getContextInfo(this->config.ctxType, kNone_GrGLStandard,
+ this->gl = gGrFactory->getContextInfo(this->config.ctxType,
this->config.ctxOptions)->fGLContext;
if (!this->surface.get()) {
return false;
@@ -390,7 +390,7 @@ static bool is_gpu_config_allowed(const char* name, GrContextFactory::GLContextT
if (!is_cpu_config_allowed(name)) {
return false;
}
- if (const GrContext* ctx = gGrFactory->get(ctxType, kNone_GrGLStandard, ctxOptions)) {
+ if (const GrContext* ctx = gGrFactory->get(ctxType, ctxOptions)) {
return sampleCnt <= ctx->caps()->maxSampleCount();
}
return false;
@@ -446,11 +446,13 @@ static void create_configs(SkTDArray<Config>* configs) {
GPU_CONFIG(gpudft, kNative_GLContextType, kNone_GLContextOptions, 0, true)
GPU_CONFIG(debug, kDebug_GLContextType, kNone_GLContextOptions, 0, false)
GPU_CONFIG(nullgpu, kNull_GLContextType, kNone_GLContextOptions, 0, false)
-#ifdef SK_ANGLE
+#if SK_ANGLE
+#ifdef SK_BUILD_FOR_WIN
GPU_CONFIG(angle, kANGLE_GLContextType, kNone_GLContextOptions, 0, false)
+#endif
GPU_CONFIG(angle-gl, kANGLE_GL_GLContextType, kNone_GLContextOptions, 0, false)
#endif
-#ifdef SK_COMMAND_BUFFER
+#if SK_COMMAND_BUFFER
GPU_CONFIG(commandbuffer, kCommandBuffer_GLContextType, kNone_GLContextOptions, 0, false)
#endif
#if SK_MESA
@@ -1166,7 +1168,7 @@ int nanobench_main() {
#if SK_SUPPORT_GPU
if (FLAGS_gpuStats && Benchmark::kGPU_Backend == configs[i].backend) {
GrContext* context = gGrFactory->get(configs[i].ctxType,
- kNone_GrGLStandard, configs[i].ctxOptions);
+ configs[i].ctxOptions);
context->printCacheStats();
context->printGpuStats();
}
« no previous file with comments | « no previous file | dm/DM.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698