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

Unified Diff: tools/gpu/GrContextFactory.h

Issue 1971613003: Make unit tests use generic testcontext rather than glcontext (Closed) Base URL: https://chromium.googlesource.com/skia.git@vknano
Patch Set: run deferredimage test on vk Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/ImageTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gpu/GrContextFactory.h
diff --git a/tools/gpu/GrContextFactory.h b/tools/gpu/GrContextFactory.h
index dc896a7bc8be32083cb399fa464807b2191b4594..ed8e6451999514aa001fb0870754a24b36282cd8 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:
« no previous file with comments | « tests/ImageTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698