2019-01-30 18:08:28 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2019 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GrRecordingContext_DEFINED
|
|
|
|
#define GrRecordingContext_DEFINED
|
|
|
|
|
2019-02-08 15:29:20 +00:00
|
|
|
#include "GrAuditTrail.h"
|
2019-01-30 18:08:28 +00:00
|
|
|
#include "GrImageContext.h"
|
|
|
|
|
2019-02-08 15:29:20 +00:00
|
|
|
class GrOpMemoryPool;
|
2019-01-30 18:08:28 +00:00
|
|
|
class GrRecordingContextPriv;
|
|
|
|
|
|
|
|
class SK_API GrRecordingContext : public GrImageContext {
|
|
|
|
public:
|
|
|
|
~GrRecordingContext() override;
|
|
|
|
|
|
|
|
// Provides access to functions that aren't part of the public API.
|
|
|
|
GrRecordingContextPriv priv();
|
|
|
|
const GrRecordingContextPriv priv() const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
friend class GrRecordingContextPriv; // for hidden functions
|
|
|
|
|
2019-02-07 15:44:10 +00:00
|
|
|
GrRecordingContext(GrBackendApi, const GrContextOptions&, uint32_t contextID);
|
2019-01-30 18:08:28 +00:00
|
|
|
|
2019-02-11 19:12:03 +00:00
|
|
|
void abandonContext() override;
|
|
|
|
|
2019-02-08 15:29:20 +00:00
|
|
|
sk_sp<GrOpMemoryPool> refOpMemoryPool();
|
|
|
|
GrOpMemoryPool* opMemoryPool();
|
|
|
|
|
|
|
|
GrAuditTrail* auditTrail() { return &fAuditTrail; }
|
|
|
|
|
2019-01-30 18:08:28 +00:00
|
|
|
GrRecordingContext* asRecordingContext() override { return this; }
|
|
|
|
|
|
|
|
private:
|
2019-02-08 15:29:20 +00:00
|
|
|
// All the GrOp-derived classes use this pool.
|
|
|
|
sk_sp<GrOpMemoryPool> fOpMemoryPool;
|
|
|
|
GrAuditTrail fAuditTrail;
|
|
|
|
|
2019-01-30 18:08:28 +00:00
|
|
|
typedef GrImageContext INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|