Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Unified Diff: src/gpu/GrTexture.cpp

Issue 1862043002: Refactor to separate backend object lifecycle and GpuResource budget decision (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrTexture.cpp
diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp
index 9051c851bd4db591afb38074cfb9c512d8859479..073c0591758729e09659d950d1ac415f6b9e67ad 100644
--- a/src/gpu/GrTexture.cpp
+++ b/src/gpu/GrTexture.cpp
@@ -86,17 +86,10 @@ GrSurfaceOrigin resolve_origin(const GrSurfaceDesc& desc) {
}
//////////////////////////////////////////////////////////////////////////////
-GrTexture::GrTexture(GrGpu* gpu, LifeCycle lifeCycle, const GrSurfaceDesc& desc,
- GrSLType samplerType, bool wasMipMapDataProvided)
- : INHERITED(gpu, lifeCycle, desc)
+GrTexture::GrTexture(GrGpu* gpu, const GrSurfaceDesc& desc, GrSLType samplerType,
+ bool wasMipMapDataProvided)
+ : INHERITED(gpu, desc)
, fSamplerType(samplerType) {
- if (!this->isExternal() && !GrPixelConfigIsCompressed(desc.fConfig) &&
- !desc.fTextureStorageAllocator.fAllocateTextureStorage) {
- GrScratchKey key;
- GrTexturePriv::ComputeScratchKey(desc, &key);
- this->setScratchKey(key);
- }
-
if (wasMipMapDataProvided) {
fMipMapsStatus = kValid_MipMapsStatus;
fMaxMipMapLevel = SkMipMap::ComputeLevelCount(fDesc.fWidth, fDesc.fHeight);
@@ -106,6 +99,13 @@ GrTexture::GrTexture(GrGpu* gpu, LifeCycle lifeCycle, const GrSurfaceDesc& desc,
}
}
+void GrTexture::computeScratchKey(GrScratchKey* key) const {
+ if (!GrPixelConfigIsCompressed(fDesc.fConfig) &&
+ !fDesc.fTextureStorageAllocator.fAllocateTextureStorage) {
+ GrTexturePriv::ComputeScratchKey(fDesc, key);
+ }
+}
+
void GrTexturePriv::ComputeScratchKey(const GrSurfaceDesc& desc, GrScratchKey* key) {
static const GrScratchKey::ResourceType kType = GrScratchKey::GenerateResourceType();

Powered by Google App Engine
This is Rietveld 408576698