diff options
author | bsalomon <bsalomon@google.com> | 2016-03-30 08:35:09 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-30 08:35:09 -0700 |
commit | fe3456cb006110d045b26ff3f8681b893a757b58 (patch) | |
tree | 8d07fbc43230b807d0cf7174c79d5757c397b07f /bench | |
parent | b4a7f144b41dbe8341d26abb71d87b13d072a5cf (diff) |
Move SkGLContext and some GrGLInterface implementations to skgputest module
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1815823002
CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot
Review URL: https://codereview.chromium.org/1815823002
Diffstat (limited to 'bench')
-rw-r--r-- | bench/nanobench.cpp | 19 | ||||
-rw-r--r-- | bench/nanobench.h | 4 |
2 files changed, 13 insertions, 10 deletions
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp index c0f674fc59..235de02f57 100644 --- a/bench/nanobench.cpp +++ b/bench/nanobench.cpp @@ -56,6 +56,9 @@ #include "gl/GrGLDefines.h" #include "GrCaps.h" #include "GrContextFactory.h" + #include "gl/GrGLUtil.h" + using sk_gpu_test::GrContextFactory; + using sk_gpu_test::GLContext; SkAutoTDelete<GrContextFactory> gGrFactory; #endif @@ -155,21 +158,21 @@ bool Target::capturePixels(SkBitmap* bmp) { #if SK_SUPPORT_GPU struct GPUTarget : public Target { explicit GPUTarget(const Config& c) : Target(c), gl(nullptr) { } - SkGLContext* gl; + GLContext* gl; void setup() override { this->gl->makeCurrent(); // Make sure we're done with whatever came before. - SK_GL(*this->gl, Finish()); + GR_GL_CALL(this->gl->gl(), Finish()); } void endTiming() override { if (this->gl) { - SK_GL(*this->gl, Flush()); + GR_GL_CALL(this->gl->gl(), Flush()); this->gl->waitOnSyncOrSwap(); } } void fence() override { - SK_GL(*this->gl, Finish()); + GR_GL_CALL(this->gl->gl(), Finish()); } bool needsFrameTiming(int* maxFrameLag) const override { @@ -200,16 +203,16 @@ struct GPUTarget : public Target { } void fillOptions(ResultsWriter* log) override { const GrGLubyte* version; - SK_GL_RET(*this->gl, version, GetString(GR_GL_VERSION)); + GR_GL_CALL_RET(this->gl->gl(), version, GetString(GR_GL_VERSION)); log->configOption("GL_VERSION", (const char*)(version)); - SK_GL_RET(*this->gl, version, GetString(GR_GL_RENDERER)); + GR_GL_CALL_RET(this->gl->gl(), version, GetString(GR_GL_RENDERER)); log->configOption("GL_RENDERER", (const char*) version); - SK_GL_RET(*this->gl, version, GetString(GR_GL_VENDOR)); + GR_GL_CALL_RET(this->gl->gl(), version, GetString(GR_GL_VENDOR)); log->configOption("GL_VENDOR", (const char*) version); - SK_GL_RET(*this->gl, version, GetString(GR_GL_SHADING_LANGUAGE_VERSION)); + GR_GL_CALL_RET(this->gl->gl(), version, GetString(GR_GL_SHADING_LANGUAGE_VERSION)); log->configOption("GL_SHADING_LANGUAGE_VERSION", (const char*) version); } }; diff --git a/bench/nanobench.h b/bench/nanobench.h index 5e4efbf077..844811e26d 100644 --- a/bench/nanobench.h +++ b/bench/nanobench.h @@ -29,8 +29,8 @@ struct Config { SkColorProfileType profile; int samples; #if SK_SUPPORT_GPU - GrContextFactory::GLContextType ctxType; - GrContextFactory::GLContextOptions ctxOptions; + sk_gpu_test::GrContextFactory::GLContextType ctxType; + sk_gpu_test::GrContextFactory::GLContextOptions ctxOptions; bool useDFText; #else int bogusInt; |