diff options
author | Brian Osman <brianosman@google.com> | 2017-03-04 08:12:46 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-04 13:49:47 +0000 |
commit | 32342f032e1dfd133040324f851f0365f9d4cb51 (patch) | |
tree | 56cc2ae886ef068ff0ebb13a22c9357b40cdc6dd /src/core/SkImageCacherator.cpp | |
parent | ae9718f1d40556ed5a49e616dbe54087f4d0d546 (diff) |
Rebase and fix chromium
Combine texture provider and resource provider
Largely mechanical. Only three places that were calling createApprox
via texture provider (ie without flags), so that was simple.
BUG=skia:
Change-Id: I876367bcdc6a8db736deedab1028de1972015509
Reviewed-on: https://skia-review.googlesource.com/9176
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/core/SkImageCacherator.cpp')
-rw-r--r-- | src/core/SkImageCacherator.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/core/SkImageCacherator.cpp b/src/core/SkImageCacherator.cpp index c33a008baa..b4f9e8b949 100644 --- a/src/core/SkImageCacherator.cpp +++ b/src/core/SkImageCacherator.cpp @@ -21,8 +21,8 @@ #include "GrGpuResourcePriv.h" #include "GrImageTextureMaker.h" #include "GrResourceKey.h" +#include "GrResourceProvider.h" #include "GrSamplerParams.h" -#include "GrTextureProvider.h" #include "GrYUVProvider.h" #include "SkGr.h" #include "SkGrPriv.h" @@ -467,7 +467,7 @@ static GrTexture* load_compressed_into_texture(GrContext* ctx, SkData* data, GrS } desc.fConfig = config; - return ctx->textureProvider()->createTexture(desc, SkBudgeted::kYes, rawStart, 0); + return ctx->resourceProvider()->createTexture(desc, SkBudgeted::kYes, rawStart, 0); } #endif @@ -486,10 +486,10 @@ public: } }; -static GrTexture* set_key_and_return(GrTextureProvider* texProvider, +static GrTexture* set_key_and_return(GrResourceProvider* resourceProvider, GrTexture* tex, const GrUniqueKey& key) { if (key.isValid()) { - texProvider->assignUniqueKeyToTexture(key, tex); + resourceProvider->assignUniqueKeyToTexture(key, tex); } return tex; } @@ -538,7 +538,7 @@ GrTexture* SkImageCacherator::lockTexture(GrContext* ctx, const GrUniqueKey& ori // 1. Check the cache for a pre-existing one if (key.isValid()) { - if (GrTexture* tex = ctx->textureProvider()->findAndRefTextureByUniqueKey(key)) { + if (GrTexture* tex = ctx->resourceProvider()->findAndRefTextureByUniqueKey(key)) { SK_HISTOGRAM_ENUMERATION("LockTexturePath", kPreExisting_LockTexturePath, kLockTexturePathCount); return tex; @@ -556,9 +556,9 @@ GrTexture* SkImageCacherator::lockTexture(GrContext* ctx, const GrUniqueKey& ori if (sk_sp<GrTextureProxy> proxy = generator->generateTexture(ctx, cacheInfo, fOrigin)) { SK_HISTOGRAM_ENUMERATION("LockTexturePath", kNative_LockTexturePath, kLockTexturePathCount); - GrTexture* tex2 = proxy->instantiate(ctx->textureProvider()); + GrTexture* tex2 = proxy->instantiate(ctx->resourceProvider()); if (tex2) { - return set_key_and_return(ctx->textureProvider(), SkSafeRef(tex2), key); + return set_key_and_return(ctx->resourceProvider(), SkSafeRef(tex2), key); } } } @@ -586,7 +586,7 @@ GrTexture* SkImageCacherator::lockTexture(GrContext* ctx, const GrUniqueKey& ori if (tex) { SK_HISTOGRAM_ENUMERATION("LockTexturePath", kYUV_LockTexturePath, kLockTexturePathCount); - return set_key_and_return(ctx->textureProvider(), tex.release(), key); + return set_key_and_return(ctx->resourceProvider(), tex.release(), key); } } @@ -603,7 +603,7 @@ GrTexture* SkImageCacherator::lockTexture(GrContext* ctx, const GrUniqueKey& ori if (tex) { SK_HISTOGRAM_ENUMERATION("LockTexturePath", kRGBA_LockTexturePath, kLockTexturePathCount); - return set_key_and_return(ctx->textureProvider(), tex, key); + return set_key_and_return(ctx->resourceProvider(), tex, key); } } SK_HISTOGRAM_ENUMERATION("LockTexturePath", kFailure_LockTexturePath, |