diff options
author | bsalomon <bsalomon@google.com> | 2016-05-11 10:38:05 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-11 10:38:06 -0700 |
commit | 0fd3c818612376afd54bad66d519feb7505b5d52 (patch) | |
tree | 1aeef7a524ccfd2abad35945cdbc2cffdfc925e8 /tools | |
parent | 6a51491b2491a646f2e378ccbae301136b6ec215 (diff) |
Make unit tests use generic testcontext rather than glcontext
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1971613003
Review-Url: https://codereview.chromium.org/1971613003
Diffstat (limited to 'tools')
-rw-r--r-- | tools/gpu/GrContextFactory.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/gpu/GrContextFactory.h b/tools/gpu/GrContextFactory.h index dc896a7bc8..ed8e645199 100644 --- a/tools/gpu/GrContextFactory.h +++ b/tools/gpu/GrContextFactory.h @@ -28,6 +28,8 @@ public: GrContext* grContext() const { return fGrContext; } + TestContext* testContext() const { return fTestContext; } + GLTestContext* glContext() const { SkASSERT(kOpenGL_GrBackend == fBackend); return static_cast<GLTestContext*>(fTestContext); @@ -93,6 +95,18 @@ public: kRequireSRGBSupport_ContextOptions = 0x2, }; + static ContextType NativeContextTypeForBackend(GrBackend backend) { + switch (backend) { + case kOpenGL_GrBackend: + return kNativeGL_ContextType; + case kVulkan_GrBackend: + return kVulkan_ContextType; + default: + SkFAIL("Unknown backend"); + return kNullGL_ContextType; + } + } + static bool IsRenderingContext(ContextType type) { switch (type) { case kNullGL_ContextType: |