Robert Phillips | ad24845 | 2020-06-30 09:27:52 -0400 | [diff] [blame] | 1 | /* |
| 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 | |
| 13 | class GrAtlasManager; |
| 14 | |
| 15 | class GrDirectContext : public GrContext { |
| 16 | public: |
| 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 | |
| 27 | protected: |
| 28 | bool init() override; |
| 29 | |
| 30 | GrAtlasManager* onGetAtlasManager() override { return fAtlasManager; } |
| 31 | |
Robert Phillips | 44333c5 | 2020-06-30 13:28:00 -0400 | [diff] [blame] | 32 | GrDirectContext* asDirectContext() override { return this; } |
| 33 | |
Robert Phillips | ad24845 | 2020-06-30 09:27:52 -0400 | [diff] [blame] | 34 | private: |
| 35 | GrAtlasManager* fAtlasManager; |
| 36 | |
| 37 | typedef GrContext INHERITED; |
| 38 | }; |
| 39 | |
| 40 | |
| 41 | #endif |