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

Unified Diff: src/gpu/GrLayerCache.cpp

Issue 1261643004: Some cleanup in GrTextureProvider and GrResourceProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@pathargs
Patch Set: fix Created 5 years, 5 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
Index: src/gpu/GrLayerCache.cpp
diff --git a/src/gpu/GrLayerCache.cpp b/src/gpu/GrLayerCache.cpp
index 3948d7e05acaef5873c9f02c2538ca4959cfb0d6..4d5f2b46f8b967e0105735fcdc589110cba14dd1 100644
--- a/src/gpu/GrLayerCache.cpp
+++ b/src/gpu/GrLayerCache.cpp
@@ -250,12 +250,13 @@ bool GrLayerCache::lock(GrCachedLayer* layer, const GrSurfaceDesc& desc, bool* n
}
// TODO: make the test for exact match depend on the image filters themselves
- GrTextureProvider::ScratchTexMatch usage = GrTextureProvider::kApprox_ScratchTexMatch;
+ SkAutoTUnref<GrTexture> tex;
if (layer->fFilter) {
- usage = GrTextureProvider::kExact_ScratchTexMatch;
+ tex.reset(fContext->textureProvider()->createTexture(desc, true));
+ } else {
+ tex.reset(fContext->textureProvider()->createApproxTexture(desc));
}
- SkAutoTUnref<GrTexture> tex(fContext->textureProvider()->refScratchTexture(desc, usage));
if (!tex) {
return false;
}

Powered by Google App Engine
This is Rietveld 408576698