blob: 42ef747c50801107f0789832b44fec675df01e78 [file] [log] [blame]
Robert Phillips4217ea72019-01-30 13:08:28 -05001/*
2 * Copyright 2019 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef GrRecordingContext_DEFINED
9#define GrRecordingContext_DEFINED
10
Robert Phillipsd6841482019-02-08 10:29:20 -050011#include "GrAuditTrail.h"
Robert Phillips4217ea72019-01-30 13:08:28 -050012#include "GrImageContext.h"
13
Robert Phillipsd6841482019-02-08 10:29:20 -050014class GrOpMemoryPool;
Robert Phillips4217ea72019-01-30 13:08:28 -050015class GrRecordingContextPriv;
16
17class SK_API GrRecordingContext : public GrImageContext {
18public:
19 ~GrRecordingContext() override;
20
21 // Provides access to functions that aren't part of the public API.
22 GrRecordingContextPriv priv();
23 const GrRecordingContextPriv priv() const;
24
25protected:
26 friend class GrRecordingContextPriv; // for hidden functions
27
Robert Phillipsa41c6852019-02-07 10:44:10 -050028 GrRecordingContext(GrBackendApi, const GrContextOptions&, uint32_t contextID);
Robert Phillips4217ea72019-01-30 13:08:28 -050029
Robert Phillipsd6841482019-02-08 10:29:20 -050030 sk_sp<GrOpMemoryPool> refOpMemoryPool();
31 GrOpMemoryPool* opMemoryPool();
32
33 GrAuditTrail* auditTrail() { return &fAuditTrail; }
34
Robert Phillips4217ea72019-01-30 13:08:28 -050035 GrRecordingContext* asRecordingContext() override { return this; }
36
37private:
Robert Phillipsd6841482019-02-08 10:29:20 -050038 // All the GrOp-derived classes use this pool.
39 sk_sp<GrOpMemoryPool> fOpMemoryPool;
40 GrAuditTrail fAuditTrail;
41
Robert Phillips4217ea72019-01-30 13:08:28 -050042 typedef GrImageContext INHERITED;
43};
44
45#endif