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:
parent
178ce3eddd
commit
fc978fde48
@ -334,6 +334,8 @@ private:
|
||||
|
||||
GrAuditTrail fAuditTrail;
|
||||
|
||||
GrBackend fBackend;
|
||||
|
||||
// TODO: have the GrClipStackClip use renderTargetContexts and rm this friending
|
||||
friend class GrContextPriv;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user