blob: c5489b11c9cb19a50a158dea3bbc48678776d469 [file] [log] [blame]
Robert Phillipsad248452020-06-30 09:27:52 -04001/*
2 * Copyright 2020 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 GrDirectContext_DEFINED
9#define GrDirectContext_DEFINED
10
11#include "include/gpu/GrContext.h"
12
13class GrAtlasManager;
14
15class GrDirectContext : public GrContext {
16public:
17 GrDirectContext(GrBackendApi backend, const GrContextOptions& options);
18
19 ~GrDirectContext() override;
20
21 void abandonContext() override;
22
23 void releaseResourcesAndAbandonContext() override;
24
25 void freeGpuResources() override;
26
27protected:
28 bool init() override;
29
30 GrAtlasManager* onGetAtlasManager() override { return fAtlasManager; }
31
Robert Phillips44333c52020-06-30 13:28:00 -040032 GrDirectContext* asDirectContext() override { return this; }
33
Robert Phillipsad248452020-06-30 09:27:52 -040034private:
35 GrAtlasManager* fAtlasManager;
36
37 typedef GrContext INHERITED;
38};
39
40
41#endif