aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrTextureMaker.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-01-08 13:40:32 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-08 19:05:31 +0000
commit1afd4cdb0800e2e395b465da24eb71e0e834dafa (patch)
treed3353e7e4487a86d00002ab882f34ec24347000b /src/gpu/GrTextureMaker.cpp
parent5ec5d677b02c41a3c58609461cd8b62c2feaeddc (diff)
Add GrProxyProvider
This pulls all the proxy tracking & creation functionality out of the GrResourceCache and GrResourceProvider and consolidates it in the GrProxyProvider. Change-Id: I7256f7c544319a70c1bd93dd5a9ccbe5fa0a544f Reviewed-on: https://skia-review.googlesource.com/91501 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/GrTextureMaker.cpp')
-rw-r--r--src/gpu/GrTextureMaker.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/gpu/GrTextureMaker.cpp b/src/gpu/GrTextureMaker.cpp
index 6cb9832b59..1fc5f7a0ee 100644
--- a/src/gpu/GrTextureMaker.cpp
+++ b/src/gpu/GrTextureMaker.cpp
@@ -9,8 +9,9 @@
#include "GrColorSpaceXform.h"
#include "GrContext.h"
+#include "GrContextPriv.h"
#include "GrGpu.h"
-#include "GrResourceProvider.h"
+#include "GrProxyProvider.h"
sk_sp<GrTextureProxy> GrTextureMaker::refTextureProxyForParams(const GrSamplerState& params,
SkColorSpace* dstColorSpace,
@@ -42,14 +43,14 @@ sk_sp<GrTextureProxy> GrTextureMaker::refTextureProxyForParams(const GrSamplerSt
}
}
- GrSurfaceOrigin origOrigin = original ? original->origin()
- : kTopLeft_GrSurfaceOrigin;
+ GrProxyProvider* proxyProvider = fContext->contextPriv().proxyProvider();
+
+ GrSurfaceOrigin origOrigin = original ? original->origin() : kTopLeft_GrSurfaceOrigin;
GrUniqueKey copyKey;
this->makeCopyKey(copyParams, &copyKey, dstColorSpace);
sk_sp<GrTextureProxy> cachedProxy;
if (copyKey.isValid()) {
- cachedProxy = fContext->resourceProvider()->findOrCreateProxyByUniqueKey(copyKey,
- origOrigin);
+ cachedProxy = proxyProvider->findOrCreateProxyByUniqueKey(copyKey, origOrigin);
if (cachedProxy && (!willBeMipped || GrMipMapped::kYes == cachedProxy->mipMapped())) {
return cachedProxy;
}
@@ -83,9 +84,9 @@ sk_sp<GrTextureProxy> GrTextureMaker::refTextureProxyForParams(const GrSamplerSt
// If we had a cachedProxy, that means there already is a proxy in the cache which
// matches the key, but it does not have mip levels and we require them. Thus we must
// remove the unique key from that proxy.
- fContext->resourceProvider()->removeUniqueKeyFromProxy(copyKey, cachedProxy.get());
+ proxyProvider->removeUniqueKeyFromProxy(copyKey, cachedProxy.get());
}
- fContext->resourceProvider()->assignUniqueKeyToProxy(copyKey, result.get());
+ proxyProvider->assignUniqueKeyToProxy(copyKey, result.get());
this->didCacheCopy(copyKey);
}
return result;