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

Unified Diff: tests/GrContextFactoryTest.cpp

Issue 1497713002: Skip dm GPU configs when context creation fails (Closed) Base URL: https://skia.googlesource.com/skia.git@master
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 | « tests/GLInterfaceValidationTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/GrContextFactoryTest.cpp
diff --git a/tests/GrContextFactoryTest.cpp b/tests/GrContextFactoryTest.cpp
index 79209c719fc2704466eeb1a2b5989971498145da..176391ef8d58416abae64803dcbeea8ff9617b14 100644
--- a/tests/GrContextFactoryTest.cpp
+++ b/tests/GrContextFactoryTest.cpp
@@ -10,8 +10,37 @@
#if SK_SUPPORT_GPU
#include "GrContextFactory.h"
+#include "GrCaps.h"
#include "Test.h"
-// TODO: test GrContextFactory.
+DEF_GPUTEST(GrContextFactory_NVPRContextTypeHasPathRenderingSupport, reporter, /*factory*/) {
+ // Test that if NVPR is requested, the context always has path rendering
+ // or the context creation fails.
+ GrContextFactory testFactory;
+ GrContext* context = testFactory.get(GrContextFactory::kNVPR_GLContextType);
+ if (context) {
+ REPORTER_ASSERT(
+ reporter,
+ context->caps()->shaderCaps()->pathRenderingSupport());
+ }
+}
+
+DEF_GPUTEST(GrContextFactory_NoPathRenderingUnlessNVPRRequested, reporter, /*factory*/) {
+ // Test that if NVPR is not requested, the context never has path rendering support.
+
+ GrContextFactory testFactory;
+ for (int i = 0; i <= GrContextFactory::kLastGLContextType; ++i) {
+ GrContextFactory::GLContextType glCtxType = (GrContextFactory::GLContextType)i;
+ if (glCtxType == GrContextFactory::kNVPR_GLContextType) {
+ continue;
+ }
+ GrContext* context = testFactory.get(glCtxType);
+ if (context) {
+ REPORTER_ASSERT(
+ reporter,
+ !context->caps()->shaderCaps()->pathRenderingSupport());
+ }
+ }
+}
#endif
« no previous file with comments | « tests/GLInterfaceValidationTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698