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>
This commit is contained in:
Greg Daniel 2017-04-13 09:54:12 -04:00 committed by Skia Commit-Bot
parent 178ce3eddd
commit fc978fde48
3 changed files with 6 additions and 0 deletions

View File

@ -334,6 +334,8 @@ private:
GrAuditTrail fAuditTrail;
GrBackend fBackend;
// TODO: have the GrClipStackClip use renderTargetContexts and rm this friending
friend class GrContextPriv;

View File

@ -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;

View File

@ -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