aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/GrContextFactoryTest.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-02-24 14:51:44 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-27 02:29:24 +0000
commit9eac2ea77340d13bac58c7171e2e3971028ef8f8 (patch)
treeaaa5e140959c52429d23f73a315cbc6bbfef0614 /tests/GrContextFactoryTest.cpp
parenta07741a75aa694c0e7c00c2301c9de2daf9b5f9e (diff)
Fixes to shared context test API
Fixes a bug in Windows shared context creation, and makes the API less fiddly. BUG=skia: Change-Id: Ia32b2e3b4816e0b8d7e9be92c22a182ca1393177 Reviewed-on: https://skia-review.googlesource.com/8965 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'tests/GrContextFactoryTest.cpp')
-rw-r--r--tests/GrContextFactoryTest.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/tests/GrContextFactoryTest.cpp b/tests/GrContextFactoryTest.cpp
index 8e6a96410d..b0869d91ed 100644
--- a/tests/GrContextFactoryTest.cpp
+++ b/tests/GrContextFactoryTest.cpp
@@ -98,7 +98,6 @@ DEF_GPUTEST(GrContextFactory_abandon, reporter, /*factory*/) {
DEF_GPUTEST(GrContextFactory_sharedContexts, reporter, /*factory*/) {
GrContextFactory testFactory;
- GrContextFactory::ContextOverrides noOverrides = GrContextFactory::ContextOverrides::kNone;
for (int i = 0; i < GrContextFactory::kContextTypeCnt; ++i) {
GrContextFactory::ContextType ctxType = static_cast<GrContextFactory::ContextType>(i);
@@ -112,7 +111,7 @@ DEF_GPUTEST(GrContextFactory_sharedContexts, reporter, /*factory*/) {
testFactory.abandonContexts();
// Test that creating a context in a share group with an abandoned context fails.
- ContextInfo info2 = testFactory.getContextInfo(ctxType, noOverrides, info1.grContext());
+ ContextInfo info2 = testFactory.getSharedContextInfo(info1.grContext());
REPORTER_ASSERT(reporter, !info2.grContext());
info1.grContext()->unref();
@@ -120,7 +119,7 @@ DEF_GPUTEST(GrContextFactory_sharedContexts, reporter, /*factory*/) {
ContextInfo info3 = testFactory.getContextInfo(ctxType);
// Creating a context in a share group may fail, but should never crash.
- ContextInfo info4 = testFactory.getContextInfo(ctxType, noOverrides, info3.grContext());
+ ContextInfo info4 = testFactory.getSharedContextInfo(info3.grContext());
if (!info4.grContext()) {
continue;
}
@@ -128,23 +127,11 @@ DEF_GPUTEST(GrContextFactory_sharedContexts, reporter, /*factory*/) {
REPORTER_ASSERT(reporter, info3.testContext() != info4.testContext());
// Passing a different index should create a new (unique) context.
- ContextInfo info5 = testFactory.getContextInfo(ctxType, noOverrides, info3.grContext(), 1);
+ ContextInfo info5 = testFactory.getSharedContextInfo(info3.grContext(), 1);
REPORTER_ASSERT(reporter, info5.grContext());
REPORTER_ASSERT(reporter, info5.testContext());
REPORTER_ASSERT(reporter, info5.grContext() != info4.grContext());
REPORTER_ASSERT(reporter, info5.testContext() != info4.testContext());
-
- // Creating a shared context with a different type should always fail.
- for (int j = 0; j < GrContextFactory::kContextTypeCnt; ++j) {
- if (i == j) {
- continue;
- }
- GrContextFactory::ContextType differentCtxType =
- static_cast<GrContextFactory::ContextType>(j);
- ContextInfo info6 = testFactory.getContextInfo(differentCtxType, noOverrides,
- info3.grContext());
- REPORTER_ASSERT(reporter, !info6.grContext());
- }
}
}