8 #ifndef GrTextureProvider_DEFINED
9 #define GrTextureProvider_DEFINED
11 #include "GrTexture.h"
47 return this->createTexture(desc, budgeted,
nullptr, 0);
53 this->assignUniqueKeyToResource(key, texture);
65 return this->existsResourceWithUniqueKey(key);
79 kExact_ScratchTexMatch,
80 kApprox_ScratchTexMatch
83 if (kApprox_ScratchTexMatch == match) {
84 return this->createApproxTexture(desc);
86 return this->createTexture(desc, SkBudgeted::kYes);
102 GrWrapOwnership = kBorrow_GrWrapOwnership);
116 GrTextureProvider(GrGpu* gpu, GrResourceCache* cache, GrSingleOwner* singleOwner);
136 bool existsResourceWithUniqueKey(
const GrUniqueKey& key)
const;
138 enum ScratchTextureFlags {
139 kExact_ScratchTextureFlag = 0x1,
140 kNoPendingIO_ScratchTextureFlag = 0x2,
141 kNoCreate_ScratchTextureFlag = 0x4,
154 GrResourceCache* cache() {
return fCache; }
155 const GrResourceCache* cache()
const {
return fCache; }
157 GrGpu* gpu() {
return fGpu; }
158 const GrGpu* gpu()
const {
return fGpu; }
160 bool isAbandoned()
const {
166 GrResourceCache* fCache;
170 SkDEBUGCODE(
mutable GrSingleOwner* fSingleOwner;)
ScratchTexMatch
Legacy function that no longer should be used.
Definition: GrTextureProvider.h:78
Base class for objects that can be kept in the GrResourceCache.
Definition: GrGpuResource.h:140
Definition: GrTypes.h:557
Describes a surface to be created.
Definition: GrTypes.h:467
Definition: GrTextureProvider.h:16
bool existsTextureWithUniqueKey(const GrUniqueKey &key) const
Determines whether a texture is associated with the unique key.
Definition: GrTextureProvider.h:64
A key that allows for exclusive use of a resource for a use case (AKA "domain").
Definition: GrResourceKey.h:220
Gr can wrap an existing render target created by the client in the 3D API with a GrRenderTarget objec...
Definition: GrTypes.h:588
GrTexture * createTexture(const GrSurfaceDesc &desc, SkBudgeted budgeted)
Shortcut for creating a texture with no initial data to upload.
Definition: GrTextureProvider.h:46
#define SkToBool(cond)
Returns 0 or 1 based on the condition.
Definition: SkTypes.h:287
void assignUniqueKeyToTexture(const GrUniqueKey &key, GrTexture *texture)
Assigns a unique key to the texture.
Definition: GrTextureProvider.h:52
Definition: GrTypes.h:459
GrRenderTarget represents a 2D buffer of pixels that can be rendered to.
Definition: GrRenderTarget.h:26
Definition: GrTexture.h:19