Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(786)

Unified Diff: src/core/SkImageCacherator.cpp

Issue 1403313003: Remove params from Cacherator_GrTextureMaker (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: correct_key Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkImageCacherator.h ('k') | src/core/SkImageGenerator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkImageCacherator.cpp
diff --git a/src/core/SkImageCacherator.cpp b/src/core/SkImageCacherator.cpp
index 5c0d05451dc7824468e9e8d54cf8b7cdad668abc..cd5ae57699b2ea52e186b88f4063e37496113bb4 100644
--- a/src/core/SkImageCacherator.cpp
+++ b/src/core/SkImageCacherator.cpp
@@ -140,7 +140,7 @@ bool SkImageCacherator::lockAsBitmap(SkBitmap* bitmap, const SkImage* client) {
{
ScopedGenerator generator(this);
SkIRect subset = SkIRect::MakeXYWH(fOrigin.x(), fOrigin.y(), fInfo.width(), fInfo.height());
- tex.reset(generator->generateTexture(nullptr, GrTextureParams::ClampNoFilter(), &subset));
+ tex.reset(generator->generateTexture(nullptr, &subset));
}
if (!tex) {
bitmap->reset();
@@ -217,8 +217,7 @@ static GrTexture* set_key_and_return(GrTexture* tex, const GrUniqueKey& key) {
* 4. Ask the generator to return YUV planes, which the GPU can convert
* 5. Ask the generator to return RGB(A) data, which the GPU can convert
*/
-GrTexture* SkImageCacherator::lockUnstretchedTexture(GrContext* ctx, const GrTextureParams& params,
- const SkImage* client) {
+GrTexture* SkImageCacherator::lockUnstretchedTexture(GrContext* ctx, const SkImage* client) {
// textures (at least the texture-key) only support 16bit dimensions, so abort early
// if we're too big.
if (fInfo.width() > 0xFFFF || fInfo.height() > 0xFFFF) {
@@ -226,8 +225,9 @@ GrTexture* SkImageCacherator::lockUnstretchedTexture(GrContext* ctx, const GrTex
}
GrUniqueKey key;
+ const GrTextureParams& noStretchParams = GrTextureParams::ClampNoFilter();
GrMakeKeyFromImageID(&key, fUniqueID, SkIRect::MakeWH(fInfo.width(), fInfo.height()),
- *ctx->caps(), params);
+ *ctx->caps(), noStretchParams);
// 1. Check the cache for a pre-existing one
if (GrTexture* tex = ctx->textureProvider()->findAndRefTextureByUniqueKey(key)) {
@@ -238,7 +238,7 @@ GrTexture* SkImageCacherator::lockUnstretchedTexture(GrContext* ctx, const GrTex
{
ScopedGenerator generator(this);
SkIRect subset = SkIRect::MakeXYWH(fOrigin.x(), fOrigin.y(), fInfo.width(), fInfo.height());
- if (GrTexture* tex = generator->generateTexture(ctx, params, &subset)) {
+ if (GrTexture* tex = generator->generateTexture(ctx, &subset)) {
return set_key_and_return(tex, key);
}
}
@@ -267,7 +267,7 @@ GrTexture* SkImageCacherator::lockUnstretchedTexture(GrContext* ctx, const GrTex
// 5. Ask the generator to return RGB(A) data, which the GPU can convert
SkBitmap bitmap;
if (this->tryLockAsBitmap(&bitmap, client)) {
- return GrRefCachedBitmapTexture(ctx, bitmap, params);
+ return GrRefCachedBitmapTexture(ctx, bitmap, noStretchParams);
}
return nullptr;
}
@@ -278,11 +278,10 @@ GrTexture* SkImageCacherator::lockUnstretchedTexture(GrContext* ctx, const GrTex
class Cacherator_GrTextureMaker : public GrTextureMaker {
public:
- Cacherator_GrTextureMaker(SkImageCacherator* cacher, const GrTextureParams& params,
- const SkImage* client, const GrUniqueKey& unstretchedKey)
+ Cacherator_GrTextureMaker(SkImageCacherator* cacher, const SkImage* client,
+ const GrUniqueKey& unstretchedKey)
: INHERITED(cacher->info().width(), cacher->info().height())
, fCacher(cacher)
- , fParams(params)
, fClient(client)
, fUnstretchedKey(unstretchedKey)
{}
@@ -293,7 +292,7 @@ protected:
// GrTexture* onGenerateStretchedTexture(GrContext*, const SkGrStretch&) override;
GrTexture* onRefUnstretchedTexture(GrContext* ctx) override {
- return fCacher->lockUnstretchedTexture(ctx, fParams, fClient);
+ return fCacher->lockUnstretchedTexture(ctx, fClient);
}
bool onMakeStretchedKey(const SkGrStretch& stretch, GrUniqueKey* stretchedKey) override {
@@ -312,7 +311,6 @@ protected:
private:
SkImageCacherator* fCacher;
- const GrTextureParams& fParams;
const SkImage* fClient;
const GrUniqueKey fUnstretchedKey;
@@ -328,9 +326,9 @@ GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParam
GrUniqueKey key;
GrMakeKeyFromImageID(&key, this->uniqueID(),
SkIRect::MakeWH(this->info().width(), this->info().height()),
- *ctx->caps(), params);
+ *ctx->caps(), GrTextureParams::ClampNoFilter());
- return Cacherator_GrTextureMaker(this, params, client, key).refCachedTexture(ctx, params);
+ return Cacherator_GrTextureMaker(this, client, key).refCachedTexture(ctx, params);
}
#else
« no previous file with comments | « src/core/SkImageCacherator.h ('k') | src/core/SkImageGenerator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698