Index: tests/GrContextFactoryTest.cpp |
diff --git a/tests/GrContextFactoryTest.cpp b/tests/GrContextFactoryTest.cpp |
index 79209c719fc2704466eeb1a2b5989971498145da..ad83a344d8ad2fddabb16da0b8cf78de7ffe4d43 100644 |
--- a/tests/GrContextFactoryTest.cpp |
+++ b/tests/GrContextFactoryTest.cpp |
@@ -10,8 +10,24 @@ |
#if SK_SUPPORT_GPU |
#include "GrContextFactory.h" |
+#include "GrCaps.h" |
#include "Test.h" |
-// TODO: test GrContextFactory. |
+DEF_GPUTEST(GrContextFactoryNVPRContextOptions, reporter, /*factory*/) { |
+ GrContextFactory testFactory; |
+ // Test that if NVPR is possible, caps are in sync. |
+ for (int i = 0; i < GrContextFactory::kGLContextTypeCnt; ++i) { |
+ GrContextFactory::GLContextType glCtxType = static_cast<GrContextFactory::GLContextType>(i); |
+ GrContext* context = testFactory.get(glCtxType, |
+ kNone_GrGLStandard, |
+ GrContextFactory::kEnableNVPR_GLContextOptions); |
+ if (!context) { |
+ continue; |
+ } |
+ REPORTER_ASSERT( |
+ reporter, |
+ context->caps()->shaderCaps()->pathRenderingSupport()); |
+ } |
+} |
#endif |