Robert Phillips | 4217ea7 | 2019-01-30 13:08:28 -0500 | [diff] [blame] | 1 | /* |
| 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 Phillips | d684148 | 2019-02-08 10:29:20 -0500 | [diff] [blame^] | 11 | #include "GrAuditTrail.h" |
Robert Phillips | 4217ea7 | 2019-01-30 13:08:28 -0500 | [diff] [blame] | 12 | #include "GrImageContext.h" |
| 13 | |
Robert Phillips | d684148 | 2019-02-08 10:29:20 -0500 | [diff] [blame^] | 14 | class GrOpMemoryPool; |
Robert Phillips | 4217ea7 | 2019-01-30 13:08:28 -0500 | [diff] [blame] | 15 | class GrRecordingContextPriv; |
| 16 | |
| 17 | class SK_API GrRecordingContext : public GrImageContext { |
| 18 | public: |
| 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 | |
| 25 | protected: |
| 26 | friend class GrRecordingContextPriv; // for hidden functions |
| 27 | |
Robert Phillips | a41c685 | 2019-02-07 10:44:10 -0500 | [diff] [blame] | 28 | GrRecordingContext(GrBackendApi, const GrContextOptions&, uint32_t contextID); |
Robert Phillips | 4217ea7 | 2019-01-30 13:08:28 -0500 | [diff] [blame] | 29 | |
Robert Phillips | d684148 | 2019-02-08 10:29:20 -0500 | [diff] [blame^] | 30 | sk_sp<GrOpMemoryPool> refOpMemoryPool(); |
| 31 | GrOpMemoryPool* opMemoryPool(); |
| 32 | |
| 33 | GrAuditTrail* auditTrail() { return &fAuditTrail; } |
| 34 | |
Robert Phillips | 4217ea7 | 2019-01-30 13:08:28 -0500 | [diff] [blame] | 35 | GrRecordingContext* asRecordingContext() override { return this; } |
| 36 | |
| 37 | private: |
Robert Phillips | d684148 | 2019-02-08 10:29:20 -0500 | [diff] [blame^] | 38 | // All the GrOp-derived classes use this pool. |
| 39 | sk_sp<GrOpMemoryPool> fOpMemoryPool; |
| 40 | GrAuditTrail fAuditTrail; |
| 41 | |
Robert Phillips | 4217ea7 | 2019-01-30 13:08:28 -0500 | [diff] [blame] | 42 | typedef GrImageContext INHERITED; |
| 43 | }; |
| 44 | |
| 45 | #endif |