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

Unified Diff: tests/GrContextFactoryTest.cpp

Issue 1846603002: Enable gpusrgb config on bots. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: re-generate json Created 4 years, 9 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
Index: tests/GrContextFactoryTest.cpp
diff --git a/tests/GrContextFactoryTest.cpp b/tests/GrContextFactoryTest.cpp
index 7dc02a56e6b25e24035bebf5b185d529b013faa1..800b18cce0b8d29f59f2be9562b63ccd973fe09a 100644
--- a/tests/GrContextFactoryTest.cpp
+++ b/tests/GrContextFactoryTest.cpp
@@ -46,6 +46,29 @@ DEF_GPUTEST(GrContextFactory_NoPathRenderingUnlessNVPRRequested, reporter, /*fac
}
}
+DEF_GPUTEST(GrContextFactory_RequiredSRGBSupport, reporter, /*factory*/) {
+ // Test that if sRGB support is requested, the context always has that capability
+ // or the context creation fails. Also test that if the creation fails, a context
+ // created without that flag would not have had sRGB support.
+ GrContextFactory testFactory;
+ // Test that if sRGB is requested, 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,
+ GrContextFactory::kRequireSRGBSupport_GLContextOptions);
+
+ if (context) {
+ REPORTER_ASSERT(reporter, context->caps()->srgbSupport());
+ } else {
+ context = testFactory.get(glCtxType);
+ if (context) {
+ REPORTER_ASSERT(reporter, !context->caps()->srgbSupport());
+ }
+ }
+ }
+}
+
DEF_GPUTEST(GrContextFactory_abandon, reporter, /*factory*/) {
GrContextFactory testFactory;
for (int i = 0; i < GrContextFactory::kGLContextTypeCnt; ++i) {
« no previous file with comments | « src/gpu/GrContextFactory.cpp ('k') | tools/dm_flags.json » ('j') | tools/dm_flags.json » ('J')

Powered by Google App Engine
This is Rietveld 408576698