aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrBitmapTextureMaker.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/GrBitmapTextureMaker.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/GrBitmapTextureMaker.cpp')
-rw-r--r--src/gpu/GrBitmapTextureMaker.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/gpu/GrBitmapTextureMaker.cpp b/src/gpu/GrBitmapTextureMaker.cpp
index 9b3ba36ae7..064b1aaaa4 100644
--- a/src/gpu/GrBitmapTextureMaker.cpp
+++ b/src/gpu/GrBitmapTextureMaker.cpp
@@ -10,7 +10,7 @@
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrGpuResourcePriv.h"
-#include "GrResourceProvider.h"
+#include "GrProxyProvider.h"
#include "GrSurfaceContext.h"
#include "SkBitmap.h"
#include "SkGr.h"
@@ -37,11 +37,11 @@ sk_sp<GrTextureProxy> GrBitmapTextureMaker::refOriginalTextureProxy(bool willBeM
return nullptr;
}
+ GrProxyProvider* proxyProvider = this->context()->contextPriv().proxyProvider();
sk_sp<GrTextureProxy> proxy;
if (fOriginalKey.isValid()) {
- proxy = this->context()->resourceProvider()->findOrCreateProxyByUniqueKey(
- fOriginalKey, kTopLeft_GrSurfaceOrigin);
+ proxy = proxyProvider->findOrCreateProxyByUniqueKey(fOriginalKey, kTopLeft_GrSurfaceOrigin);
if (proxy && (!willBeMipped || GrMipMapped::kYes == proxy->mipMapped())) {
return proxy;
}
@@ -53,13 +53,11 @@ sk_sp<GrTextureProxy> GrBitmapTextureMaker::refOriginalTextureProxy(bool willBeM
dstColorSpace);
}
if (!proxy) {
- proxy = GrUploadBitmapToTextureProxy(this->context()->resourceProvider(), fBitmap,
- dstColorSpace);
+ proxy = GrUploadBitmapToTextureProxy(proxyProvider, fBitmap, dstColorSpace);
}
if (proxy) {
if (fOriginalKey.isValid()) {
- this->context()->resourceProvider()->assignUniqueKeyToProxy(fOriginalKey,
- proxy.get());
+ proxyProvider->assignUniqueKeyToProxy(fOriginalKey, proxy.get());
}
if (!willBeMipped || GrMipMapped::kYes == proxy->mipMapped()) {
SkASSERT(proxy->origin() == kTopLeft_GrSurfaceOrigin);
@@ -86,10 +84,8 @@ sk_sp<GrTextureProxy> GrBitmapTextureMaker::refOriginalTextureProxy(bool willBeM
// mipmapped version. The texture backing the unmipped version will remain in the
// resource cache until the last texture proxy referencing it is deleted at which
// time it too will be deleted or recycled.
- this->context()->resourceProvider()->removeUniqueKeyFromProxy(fOriginalKey,
- proxy.get());
- this->context()->resourceProvider()->assignUniqueKeyToProxy(fOriginalKey,
- mippedProxy.get());
+ proxyProvider->removeUniqueKeyFromProxy(fOriginalKey, proxy.get());
+ proxyProvider->assignUniqueKeyToProxy(fOriginalKey, mippedProxy.get());
GrInstallBitmapUniqueKeyInvalidator(fOriginalKey, fBitmap.pixelRef());
}
return mippedProxy;