| Index: src/gpu/GrTextureProvider.cpp
|
| diff --git a/src/gpu/GrTextureProvider.cpp b/src/gpu/GrTextureProvider.cpp
|
| index 1c2f36535a0166ce143d66ca34936f9874ec1cb8..cb652f7a7fd8c2e27b46fb7a4c802a4031b900e1 100644
|
| --- a/src/gpu/GrTextureProvider.cpp
|
| +++ b/src/gpu/GrTextureProvider.cpp
|
| @@ -10,10 +10,6 @@
|
| #include "GrTexturePriv.h"
|
| #include "GrResourceCache.h"
|
| #include "GrGpu.h"
|
| -#include "../private/GrSingleOwner.h"
|
| -
|
| -#define ASSERT_SINGLE_OWNER \
|
| - SkDEBUGCODE(GrSingleOwner::AutoEnforce debug_SingleOwner(fSingleOwner);)
|
|
|
| enum ScratchTextureFlags {
|
| kExact_ScratchTextureFlag = 0x1,
|
| @@ -21,18 +17,8 @@
|
| kNoCreate_ScratchTextureFlag = 0x4,
|
| };
|
|
|
| -GrTextureProvider::GrTextureProvider(GrGpu* gpu, GrResourceCache* cache, GrSingleOwner* singleOwner)
|
| - : fCache(cache)
|
| - , fGpu(gpu)
|
| -#ifdef SK_DEBUG
|
| - , fSingleOwner(singleOwner)
|
| -#endif
|
| - {
|
| -}
|
| -
|
| GrTexture* GrTextureProvider::createTexture(const GrSurfaceDesc& desc, bool budgeted,
|
| const void* srcData, size_t rowBytes) {
|
| - ASSERT_SINGLE_OWNER
|
| if (this->isAbandoned()) {
|
| return nullptr;
|
| }
|
| @@ -58,13 +44,11 @@
|
| }
|
|
|
| GrTexture* GrTextureProvider::createApproxTexture(const GrSurfaceDesc& desc) {
|
| - ASSERT_SINGLE_OWNER
|
| return this->internalCreateApproxTexture(desc, 0);
|
| }
|
|
|
| GrTexture* GrTextureProvider::internalCreateApproxTexture(const GrSurfaceDesc& desc,
|
| uint32_t scratchFlags) {
|
| - ASSERT_SINGLE_OWNER
|
| if (this->isAbandoned()) {
|
| return nullptr;
|
| }
|
| @@ -78,7 +62,6 @@
|
|
|
| GrTexture* GrTextureProvider::refScratchTexture(const GrSurfaceDesc& inDesc,
|
| uint32_t flags) {
|
| - ASSERT_SINGLE_OWNER
|
| SkASSERT(!this->isAbandoned());
|
| SkASSERT(!GrPixelConfigIsCompressed(inDesc.fConfig));
|
|
|
| @@ -125,7 +108,6 @@
|
|
|
| GrTexture* GrTextureProvider::wrapBackendTexture(const GrBackendTextureDesc& desc,
|
| GrWrapOwnership ownership) {
|
| - ASSERT_SINGLE_OWNER
|
| if (this->isAbandoned()) {
|
| return nullptr;
|
| }
|
| @@ -133,13 +115,11 @@
|
| }
|
|
|
| GrRenderTarget* GrTextureProvider::wrapBackendRenderTarget(const GrBackendRenderTargetDesc& desc) {
|
| - ASSERT_SINGLE_OWNER
|
| return this->isAbandoned() ? nullptr : fGpu->wrapBackendRenderTarget(desc,
|
| - kBorrow_GrWrapOwnership);
|
| + kBorrow_GrWrapOwnership);
|
| }
|
|
|
| void GrTextureProvider::assignUniqueKeyToResource(const GrUniqueKey& key, GrGpuResource* resource) {
|
| - ASSERT_SINGLE_OWNER
|
| if (this->isAbandoned() || !resource) {
|
| return;
|
| }
|
| @@ -147,22 +127,9 @@
|
| }
|
|
|
| bool GrTextureProvider::existsResourceWithUniqueKey(const GrUniqueKey& key) const {
|
| - ASSERT_SINGLE_OWNER
|
| return this->isAbandoned() ? false : fCache->hasUniqueKey(key);
|
| }
|
|
|
| GrGpuResource* GrTextureProvider::findAndRefResourceByUniqueKey(const GrUniqueKey& key) {
|
| - ASSERT_SINGLE_OWNER
|
| return this->isAbandoned() ? nullptr : fCache->findAndRefUniqueResource(key);
|
| }
|
| -
|
| -GrTexture* GrTextureProvider::findAndRefTextureByUniqueKey(const GrUniqueKey& key) {
|
| - ASSERT_SINGLE_OWNER
|
| - GrGpuResource* resource = this->findAndRefResourceByUniqueKey(key);
|
| - if (resource) {
|
| - GrTexture* texture = static_cast<GrSurface*>(resource)->asTexture();
|
| - SkASSERT(texture);
|
| - return texture;
|
| - }
|
| - return NULL;
|
| -}
|
|
|