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

Unified Diff: tests/GrContextFactoryTest.cpp

Issue 1448883002: Make NVPR a GL context option instead of a GL context (Closed) Base URL: https://skia.googlesource.com/skia.git@commandbuffer-as-api-02-other-tests-refactor
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
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

Powered by Google App Engine
This is Rietveld 408576698