aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/GrContextFactoryTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/GrContextFactoryTest.cpp')
-rw-r--r--tests/GrContextFactoryTest.cpp43
1 files changed, 21 insertions, 22 deletions
diff --git a/tests/GrContextFactoryTest.cpp b/tests/GrContextFactoryTest.cpp
index 1514d67717..29f68366c3 100644
--- a/tests/GrContextFactoryTest.cpp
+++ b/tests/GrContextFactoryTest.cpp
@@ -17,12 +17,12 @@
using namespace sk_gpu_test;
-DEF_GPUTEST(GrContextFactory_NVPRContextOptionHasPathRenderingSupport, reporter, /*factory*/) {
+DEF_GPUTEST(GrContextFactory_NVPRContextOptionHasPathRenderingSupport, reporter, options) {
// Test that if NVPR is requested, the context always has path rendering
// or the context creation fails.
- GrContextFactory testFactory;
- // Test that if NVPR is possible, caps are in sync.
for (int i = 0; i < GrContextFactory::kContextTypeCnt; ++i) {
+ GrContextFactory testFactory(options);
+ // Test that if NVPR is possible, caps are in sync.
GrContextFactory::ContextType ctxType = static_cast<GrContextFactory::ContextType>(i);
GrContext* context = testFactory.get(ctxType,
GrContextFactory::ContextOverrides::kRequireNVPRSupport);
@@ -35,11 +35,11 @@ DEF_GPUTEST(GrContextFactory_NVPRContextOptionHasPathRenderingSupport, reporter,
}
}
-DEF_GPUTEST(GrContextFactory_NoPathRenderingIfNVPRDisabled, reporter, /*factory*/) {
+DEF_GPUTEST(GrContextFactory_NoPathRenderingIfNVPRDisabled, reporter, options) {
// Test that if NVPR is explicitly disabled, the context has no path rendering support.
- GrContextFactory testFactory;
for (int i = 0; i <= GrContextFactory::kLastContextType; ++i) {
+ GrContextFactory testFactory(options);
GrContextFactory::ContextType ctxType = (GrContextFactory::ContextType)i;
GrContext* context =
testFactory.get(ctxType, GrContextFactory::ContextOverrides::kDisableNVPR);
@@ -51,13 +51,13 @@ DEF_GPUTEST(GrContextFactory_NoPathRenderingIfNVPRDisabled, reporter, /*factory*
}
}
-DEF_GPUTEST(GrContextFactory_RequiredSRGBSupport, reporter, /*factory*/) {
+DEF_GPUTEST(GrContextFactory_RequiredSRGBSupport, reporter, options) {
// 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::kContextTypeCnt; ++i) {
+ GrContextFactory testFactory(options);
+ // Test that if sRGB is requested, caps are in sync.
GrContextFactory::ContextType ctxType = static_cast<GrContextFactory::ContextType>(i);
GrContext* context =
testFactory.get(ctxType, GrContextFactory::ContextOverrides::kRequireSRGBSupport);
@@ -73,9 +73,9 @@ DEF_GPUTEST(GrContextFactory_RequiredSRGBSupport, reporter, /*factory*/) {
}
}
-DEF_GPUTEST(GrContextFactory_abandon, reporter, /*factory*/) {
- GrContextFactory testFactory;
+DEF_GPUTEST(GrContextFactory_abandon, reporter, options) {
for (int i = 0; i < GrContextFactory::kContextTypeCnt; ++i) {
+ GrContextFactory testFactory(options);
GrContextFactory::ContextType ctxType = (GrContextFactory::ContextType) i;
ContextInfo info1 = testFactory.getContextInfo(ctxType);
if (!info1.grContext()) {
@@ -98,10 +98,9 @@ DEF_GPUTEST(GrContextFactory_abandon, reporter, /*factory*/) {
}
}
-DEF_GPUTEST(GrContextFactory_sharedContexts, reporter, /*factory*/) {
- GrContextFactory testFactory;
-
+DEF_GPUTEST(GrContextFactory_sharedContexts, reporter, options) {
for (int i = 0; i < GrContextFactory::kContextTypeCnt; ++i) {
+ GrContextFactory testFactory(options);
GrContextFactory::ContextType ctxType = static_cast<GrContextFactory::ContextType>(i);
ContextInfo info1 = testFactory.getContextInfo(ctxType);
if (!info1.grContext()) {
@@ -141,17 +140,17 @@ DEF_GPUTEST(GrContextFactory_sharedContexts, reporter, /*factory*/) {
}
}
-DEF_GPUTEST(GrContextFactory_executorAndTaskGroup, reporter, /*factory*/) {
- // Verify that contexts have a task group iff we supply an executor with context options
- GrContextOptions contextOptions;
- contextOptions.fExecutor = nullptr;
- GrContextFactory serialFactory(contextOptions);
+DEF_GPUTEST(GrContextFactory_executorAndTaskGroup, reporter, options) {
+ for (int i = 0; i < GrContextFactory::kContextTypeCnt; ++i) {
+ // Verify that contexts have a task group iff we supply an executor with context options
+ GrContextOptions contextOptions = options;
+ contextOptions.fExecutor = nullptr;
+ GrContextFactory serialFactory(contextOptions);
- std::unique_ptr<SkExecutor> threadPool = SkExecutor::MakeFIFOThreadPool(1);
- contextOptions.fExecutor = threadPool.get();
- GrContextFactory threadedFactory(contextOptions);
+ std::unique_ptr<SkExecutor> threadPool = SkExecutor::MakeFIFOThreadPool(1);
+ contextOptions.fExecutor = threadPool.get();
+ GrContextFactory threadedFactory(contextOptions);
- for (int i = 0; i < GrContextFactory::kContextTypeCnt; ++i) {
GrContextFactory::ContextType ctxType = static_cast<GrContextFactory::ContextType>(i);
ContextInfo serialInfo = serialFactory.getContextInfo(ctxType);
if (GrContext* serialContext = serialInfo.grContext()) {