diff options
author | Robert Phillips <robertphillips@google.com> | 2017-09-20 20:50:37 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-20 20:50:50 +0000 |
commit | 76d640d14ea78e1f827a2f545e7f0729cdc2896f (patch) | |
tree | 807a1db51245b15ca045f822f3e36c1f4c9e2eb0 /src/gpu/GrTextureProxy.cpp | |
parent | 0ca21466da7441baf471966be8c628d408752a72 (diff) |
Revert "Add native caching of uniquely keyed GrTextureProxies"
This reverts commit d4f100dad90ed5beb1b614464d8c4fcb22c0a993.
Reason for revert: ASAN
Original change's description:
> Add native caching of uniquely keyed GrTextureProxies
>
> Change-Id: I303fe025b7856b8d681a2d35b416c015bd468e1d
> Reviewed-on: https://skia-review.googlesource.com/48300
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com
Change-Id: I7bbf549d4855ce6d985867c3880eef80080bd3d1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/49442
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrTextureProxy.cpp')
-rw-r--r-- | src/gpu/GrTextureProxy.cpp | 44 |
1 files changed, 3 insertions, 41 deletions
diff --git a/src/gpu/GrTextureProxy.cpp b/src/gpu/GrTextureProxy.cpp index 8a68e03bac..3cb87b3faf 100644 --- a/src/gpu/GrTextureProxy.cpp +++ b/src/gpu/GrTextureProxy.cpp @@ -7,43 +7,25 @@ #include "GrTextureProxy.h" -#include "GrContext.h" -#include "GrResourceCache.h" - #include "GrTexturePriv.h" GrTextureProxy::GrTextureProxy(const GrSurfaceDesc& srcDesc, SkBackingFit fit, SkBudgeted budgeted, const void* srcData, size_t /*rowBytes*/, uint32_t flags) : INHERITED(srcDesc, fit, budgeted, flags) , fIsMipMapped(srcDesc.fIsMipMapped) - , fMipColorMode(SkDestinationSurfaceColorMode::kLegacy) - , fCache(nullptr) { + , fMipColorMode(SkDestinationSurfaceColorMode::kLegacy) { SkASSERT(!srcData); // currently handled in Make() } GrTextureProxy::GrTextureProxy(sk_sp<GrSurface> surf, GrSurfaceOrigin origin) : INHERITED(std::move(surf), origin, SkBackingFit::kExact) , fIsMipMapped(fTarget->asTexture()->texturePriv().hasMipMaps()) - , fMipColorMode(fTarget->asTexture()->texturePriv().mipColorMode()) - , fCache(nullptr) { - if (fTarget->getUniqueKey().isValid()) { - fUniqueKey = fTarget->getUniqueKey(); - fCache = fTarget->asTexture()->getContext()->getResourceCache(); - } -} - -GrTextureProxy::~GrTextureProxy() { - if (fUniqueKey.isValid()) { - fCache->processInvalidProxyUniqueKey(fUniqueKey); - } else { - SkASSERT(!fCache); - } + , fMipColorMode(fTarget->asTexture()->texturePriv().mipColorMode()) { } bool GrTextureProxy::instantiate(GrResourceProvider* resourceProvider) { if (!this->instantiateImpl(resourceProvider, 0, /* needsStencil = */ false, - kNone_GrSurfaceFlags, fIsMipMapped, fMipColorMode, - fUniqueKey.isValid() ? &fUniqueKey : nullptr)) { + kNone_GrSurfaceFlags, fIsMipMapped, fMipColorMode)) { return false; } @@ -98,23 +80,3 @@ size_t GrTextureProxy::onUninstantiatedGpuMemorySize() const { return GrSurface::ComputeSize(fConfig, fWidth, fHeight, 1, kHasMipMaps, SkBackingFit::kApprox == fFit); } - -void GrTextureProxy::setUniqueKey(GrResourceCache* cache, const GrUniqueKey& key) { - SkASSERT(key.isValid()); - SkASSERT(!fUniqueKey.isValid()); // proxies can only ever get one uniqueKey - - if (fTarget) { - SkASSERT(!fTarget->getUniqueKey().isValid()); - fTarget->resourcePriv().setUniqueKey(key); - SkASSERT(fTarget->getUniqueKey() == key); - } - - fUniqueKey = key; - fCache = cache; -} - -void GrTextureProxy::clearUniqueKey() { - fUniqueKey.reset(); - fCache = nullptr; -} - |