| Index: src/gpu/gl/GrGLTexture.cpp
|
| diff --git a/src/gpu/gl/GrGLTexture.cpp b/src/gpu/gl/GrGLTexture.cpp
|
| index aff91ebe223fb113ca5e986f45cb50e96b952494..44dbd7967e81a12a5bf209b4d49e42ee2b5680db 100644
|
| --- a/src/gpu/gl/GrGLTexture.cpp
|
| +++ b/src/gpu/gl/GrGLTexture.cpp
|
| @@ -26,24 +26,33 @@ inline static GrSLType sampler_type(const GrGLTexture::IDDesc& idDesc, const GrG
|
| }
|
|
|
| // Because this class is virtually derived from GrSurface we must explicitly call its constructor.
|
| -GrGLTexture::GrGLTexture(GrGLGpu* gpu, const GrSurfaceDesc& desc, const IDDesc& idDesc)
|
| - : GrSurface(gpu, idDesc.fLifeCycle, desc)
|
| - , INHERITED(gpu, idDesc.fLifeCycle, desc, sampler_type(idDesc, gpu), false) {
|
| +GrGLTexture::GrGLTexture(GrGLGpu* gpu, SkBudgeted budgeted, const GrSurfaceDesc& desc,
|
| + const IDDesc& idDesc)
|
| + : GrSurface(gpu, desc)
|
| + , INHERITED(gpu, desc, sampler_type(idDesc, gpu), false) {
|
| this->init(desc, idDesc);
|
| - this->registerWithCache();
|
| + this->registerWithCache(budgeted);
|
| }
|
|
|
| -GrGLTexture::GrGLTexture(GrGLGpu* gpu, const GrSurfaceDesc& desc, const IDDesc& idDesc,
|
| +GrGLTexture::GrGLTexture(GrGLGpu* gpu, SkBudgeted budgeted, const GrSurfaceDesc& desc,
|
| + const IDDesc& idDesc,
|
| bool wasMipMapDataProvided)
|
| - : GrSurface(gpu, idDesc.fLifeCycle, desc)
|
| - , INHERITED(gpu, idDesc.fLifeCycle, desc, sampler_type(idDesc, gpu), wasMipMapDataProvided) {
|
| + : GrSurface(gpu, desc)
|
| + , INHERITED(gpu, desc, sampler_type(idDesc, gpu), wasMipMapDataProvided) {
|
| + this->init(desc, idDesc);
|
| + this->registerWithCache(budgeted);
|
| +}
|
| +
|
| +GrGLTexture::GrGLTexture(GrGLGpu* gpu, Wrapped, const GrSurfaceDesc& desc, const IDDesc& idDesc)
|
| + : GrSurface(gpu, desc)
|
| + , INHERITED(gpu, desc, sampler_type(idDesc, gpu), false) {
|
| this->init(desc, idDesc);
|
| - this->registerWithCache();
|
| + this->registerWithCacheWrapped();
|
| }
|
|
|
| -GrGLTexture::GrGLTexture(GrGLGpu* gpu, const GrSurfaceDesc& desc, const IDDesc& idDesc, Derived)
|
| - : GrSurface(gpu, idDesc.fLifeCycle, desc)
|
| - , INHERITED(gpu, idDesc.fLifeCycle, desc, sampler_type(idDesc, gpu), false) {
|
| +GrGLTexture::GrGLTexture(GrGLGpu* gpu, const GrSurfaceDesc& desc, const IDDesc& idDesc)
|
| + : GrSurface(gpu, desc)
|
| + , INHERITED(gpu, desc, sampler_type(idDesc, gpu), false) {
|
| this->init(desc, idDesc);
|
| }
|
|
|
| @@ -57,7 +66,7 @@ void GrGLTexture::init(const GrSurfaceDesc& desc, const IDDesc& idDesc) {
|
|
|
| void GrGLTexture::onRelease() {
|
| if (fInfo.fID) {
|
| - if (GrGpuResource::kBorrowed_LifeCycle != fTextureIDLifecycle) {
|
| + if (GrBackendObjectLifeCycle::kBorrowed != fTextureIDLifecycle) {
|
| if (this->desc().fTextureStorageAllocator.fDeallocateTextureStorage) {
|
| this->desc().fTextureStorageAllocator.fDeallocateTextureStorage(
|
| this->desc().fTextureStorageAllocator.fCtx,
|
| @@ -92,3 +101,9 @@ void GrGLTexture::setMemoryBacking(SkTraceMemoryDump* traceMemoryDump,
|
| traceMemoryDump->setMemoryBacking(dumpName.c_str(), "gl_texture",
|
| texture_id.c_str());
|
| }
|
| +
|
| +GrGLTexture* GrGLTexture::CreateWrapped(GrGLGpu* gpu, const GrSurfaceDesc& desc,
|
| + const IDDesc& idDesc) {
|
| + return new GrGLTexture(gpu, kWrapped, desc, idDesc);
|
| +}
|
| +
|
|
|