diff options
author | 2015-04-30 14:18:54 -0700 | |
---|---|---|
committer | 2015-04-30 14:18:54 -0700 | |
commit | d309e7aa0efa2d5dd7e7b1af97026fcd3a047e98 (patch) | |
tree | 28290abc67fd60111bba896722a14dcb0611df84 /src/gpu/GrResourceProvider.h | |
parent | 3ffa126066542590dc7430514a1174e49191b875 (diff) |
This replaces the texture creation/caching functions on GrContext with a GrTextureProvider interface. The goal is to pass this narrowly focused object in places that currently take a GrContext but don't need and shouldn't use its other methods. It also has an extended private interface for interacting with non-texture resource types.
Review URL: https://codereview.chromium.org/1107973004
Diffstat (limited to 'src/gpu/GrResourceProvider.h')
-rw-r--r-- | src/gpu/GrResourceProvider.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/gpu/GrResourceProvider.h b/src/gpu/GrResourceProvider.h new file mode 100644 index 0000000000..f560afa0fd --- /dev/null +++ b/src/gpu/GrResourceProvider.h @@ -0,0 +1,30 @@ +/* + * Copyright 2015 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef GrResourceProvider_DEFINED +#define GrResourceProvider_DEFINED + +#include "GrTextureProvider.h" + +/** + * An extension of the texture provider for arbitrary resource types. This class is intended for + * use within the Gr code base, not by clients or extensions (e.g. third party GrProcessor + * derivatives). + */ +class GrResourceProvider : public GrTextureProvider { +public: + + GrResourceProvider(GrGpu* gpu, GrResourceCache* cache) : INHERITED(gpu, cache) {} + + using GrTextureProvider::assignUniqueKeyToResource; + using GrTextureProvider::findAndRefResourceByUniqueKey; + using GrTextureProvider::abandon; + + typedef GrTextureProvider INHERITED; +}; + +#endif |