diff options
author | 2017-04-13 09:54:12 -0400 | |
---|---|---|
committer | 2017-04-13 15:19:57 +0000 | |
commit | fc978fde4868079d22c2e708b7e4378cbfb22767 (patch) | |
tree | e5b64cc88f6e4bab68bfafcffd87955cefb4ff60 /src | |
parent | 178ce3eddd326feee608af65cdeedb08e1af91c3 (diff) |
Store the GrBackend we are using on GrContext
As we start adding more functionality to external clients and passing
data around, we will need to know what backend we are working with at
a layer higher that GrGpu.
TBR=bsalomon@google.com
Bug: skia:
Change-Id: Ifee527ea0c1046469401a39e0500f84a46bb3081
Reviewed-on: https://skia-review.googlesource.com/13275
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrContext.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrContextPriv.h | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index 7ea4abd0c0..c511310590 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -83,6 +83,8 @@ bool GrContext::init(GrBackend backend, GrBackendContext backendContext, ASSERT_SINGLE_OWNER SkASSERT(!fGpu); + fBackend = backend; + fGpu = GrGpu::Create(backend, backendContext, options, this); if (!fGpu) { return false; diff --git a/src/gpu/GrContextPriv.h b/src/gpu/GrContextPriv.h index 95df8eacc9..0f4f7da4d8 100644 --- a/src/gpu/GrContextPriv.h +++ b/src/gpu/GrContextPriv.h @@ -157,6 +157,8 @@ public: size_t rowBytes, uint32_t pixelOpsFlags = 0); + GrBackend getBackend() const { return fContext->fBackend; } + private: explicit GrContextPriv(GrContext* context) : fContext(context) {} GrContextPriv(const GrContextPriv&); // unimpl |