Revert of Delete unused method aliases and texture flag. (patchset #1 id:1 of https://codereview.chromium.org/672753002/)
Reason for revert: Need to remove one more reference to this in blink before relanding. Original issue's description: > Delete unused method aliases and texture flag. > > Committed: https://skia.googlesource.com/skia/+/7fdffe41494cbd78a8ee2a6ef0509e46ec77039f TBR=robertphillips@google.com NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/671203002
This commit is contained in:
parent
c20386e393
commit
26979c8260
@ -122,6 +122,10 @@ public:
|
|||||||
* video memory that can be held in the cache.
|
* video memory that can be held in the cache.
|
||||||
*/
|
*/
|
||||||
void getResourceCacheLimits(int* maxResources, size_t* maxResourceBytes) const;
|
void getResourceCacheLimits(int* maxResources, size_t* maxResourceBytes) const;
|
||||||
|
SK_ATTR_DEPRECATED("This function has been renamed to getResourceCacheLimits().")
|
||||||
|
void getTextureCacheLimits(int* maxTextures, size_t* maxTextureBytes) const {
|
||||||
|
this->getResourceCacheLimits(maxTextures, maxTextureBytes);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the current GPU resource cache usage.
|
* Gets the current GPU resource cache usage.
|
||||||
@ -133,6 +137,20 @@ public:
|
|||||||
*/
|
*/
|
||||||
void getResourceCacheUsage(int* resourceCount, size_t* resourceBytes) const;
|
void getResourceCacheUsage(int* resourceCount, size_t* resourceBytes) const;
|
||||||
|
|
||||||
|
SK_ATTR_DEPRECATED("Use getResourceCacheUsage().")
|
||||||
|
size_t getGpuTextureCacheBytes() const {
|
||||||
|
size_t bytes;
|
||||||
|
this->getResourceCacheUsage(NULL, &bytes);
|
||||||
|
return bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
SK_ATTR_DEPRECATED("Use getResourceCacheUsage().")
|
||||||
|
int getGpuTextureCacheResourceCount() const {
|
||||||
|
int count;
|
||||||
|
this->getResourceCacheUsage(&count, NULL);
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify the GPU resource cache limits. If the current cache exceeds either
|
* Specify the GPU resource cache limits. If the current cache exceeds either
|
||||||
* of these, it will be purged (LRU) to keep the cache within these limits.
|
* of these, it will be purged (LRU) to keep the cache within these limits.
|
||||||
@ -143,6 +161,10 @@ public:
|
|||||||
* that can be held in the cache.
|
* that can be held in the cache.
|
||||||
*/
|
*/
|
||||||
void setResourceCacheLimits(int maxResources, size_t maxResourceBytes);
|
void setResourceCacheLimits(int maxResources, size_t maxResourceBytes);
|
||||||
|
SK_ATTR_DEPRECATED("This function has been renamed to setResourceCacheLimits().")
|
||||||
|
void setTextureCacheLimits(int maxTextures, size_t maxTextureBytes) {
|
||||||
|
this->setResourceCacheLimits(maxTextures, maxTextureBytes);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Frees GPU created by the context. Can be called to reduce GPU memory
|
* Frees GPU created by the context. Can be called to reduce GPU memory
|
||||||
|
@ -42,6 +42,23 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void textureParamsModified() = 0;
|
virtual void textureParamsModified() = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Informational texture flags. This will be removed soon.
|
||||||
|
*/
|
||||||
|
enum FlagBits {
|
||||||
|
kFirstBit = (kLastPublic_GrTextureFlagBit << 1),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This texture should be returned to the texture cache when
|
||||||
|
* it is no longer reffed
|
||||||
|
*/
|
||||||
|
kReturnToCache_FlagBit = kFirstBit,
|
||||||
|
};
|
||||||
|
|
||||||
|
void resetFlag(GrTextureFlags flags) {
|
||||||
|
fDesc.fFlags = fDesc.fFlags & ~flags;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef SK_DEBUG
|
#ifdef SK_DEBUG
|
||||||
void validate() const {
|
void validate() const {
|
||||||
this->INHERITED::validate();
|
this->INHERITED::validate();
|
||||||
|
@ -444,6 +444,9 @@ enum GrTextureFlags {
|
|||||||
* should be verified.
|
* should be verified.
|
||||||
*/
|
*/
|
||||||
kCheckAllocation_GrTextureFlagBit = 0x8,
|
kCheckAllocation_GrTextureFlagBit = 0x8,
|
||||||
|
|
||||||
|
kDummy_GrTextureFlagBit,
|
||||||
|
kLastPublic_GrTextureFlagBit = kDummy_GrTextureFlagBit-1,
|
||||||
};
|
};
|
||||||
|
|
||||||
GR_MAKE_BITFIELD_OPS(GrTextureFlags)
|
GR_MAKE_BITFIELD_OPS(GrTextureFlags)
|
||||||
|
@ -54,7 +54,7 @@ size_t GrTexture::gpuMemorySize() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GrTexture::onRelease() {
|
void GrTexture::onRelease() {
|
||||||
|
SkASSERT(!this->texturePriv().isSetFlag((GrTextureFlags) kReturnToCache_FlagBit));
|
||||||
INHERITED::onRelease();
|
INHERITED::onRelease();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user