diff options
author | Brian Osman <brianosman@google.com> | 2017-02-21 16:58:08 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-02-22 13:32:56 +0000 |
commit | 60c774db3ec46f3eb85f6390ba31e38c8d29e2d4 (patch) | |
tree | 0fd26132415dc9843b98b4db2e90ba1f44b3c32c /tools/gpu/GrContextFactory.h | |
parent | 22eb2f1aa09b0fb27c199c2cc96cd74b2098d502 (diff) |
Support shared GL contexts in GrContextFactory
Mostly plumbing, plus some minimal testing to make sure that
the platform APIs don't explode. I plan to add testing of
SkCrossContextImageData using this, which should verify that
textures are actually shared.
Also found a factory and some related code in the
CommandBuffer test context that was totally unused.
BUG=skia:
Change-Id: I05bbc22c4d1ef946b702a5cc7f67788785219c62
Reviewed-on: https://skia-review.googlesource.com/8808
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'tools/gpu/GrContextFactory.h')
-rw-r--r-- | tools/gpu/GrContextFactory.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/gpu/GrContextFactory.h b/tools/gpu/GrContextFactory.h index 48b250d0ea..e42f34c944 100644 --- a/tools/gpu/GrContextFactory.h +++ b/tools/gpu/GrContextFactory.h @@ -144,9 +144,13 @@ public: /** * Get a context initialized with a type of GL context. It also makes the GL context current. + * If shareContextInfo is supplied, then a context is created or returned in the same share + * group (able to share resources). To get multiple contexts in a single share group, pass the + * same shareContextInfo, with different values for shareIndex. */ ContextInfo getContextInfo(ContextType type, - ContextOverrides overrides = ContextOverrides::kNone); + ContextOverrides overrides = ContextOverrides::kNone, + GrContext* shareContext = nullptr, uint32_t shareIndex = 0); /** * Get a GrContext initialized with a type of GL context. It also makes the GL context current. */ @@ -162,7 +166,10 @@ private: GrBackend fBackend; TestContext* fTestContext; GrContext* fGrContext; - bool fAbandoned; + GrContext* fShareContext; + uint32_t fShareIndex; + + bool fAbandoned; }; SkTArray<Context, true> fContexts; std::unique_ptr<GLTestContext> fSentinelGLContext; |