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

Unified Diff: src/effects/SkTableColorFilter.cpp

Issue 608883003: GrResourceCache2 manages scratch texture. (Closed) Base URL: https://skia.googlesource.com/skia.git@surfimpl
Patch Set: remove todo Created 6 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/effects/SkPerlinNoiseShader.cpp ('k') | src/effects/gradients/SkGradientShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkTableColorFilter.cpp
diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp
index f6726ca0782f79cb5ecf2a38979d503a3f391fdf..8f385ce1b30f61d6e1570a82f7eb380805811715 100644
--- a/src/effects/SkTableColorFilter.cpp
+++ b/src/effects/SkTableColorFilter.cpp
@@ -419,7 +419,6 @@ void ColorTableEffect::onComputeInvariantOutput(InvariantOutput* inout) const {
inout->fIsSingleComponent = false;
}
-
///////////////////////////////////////////////////////////////////////////////
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(ColorTableEffect);
@@ -435,19 +434,10 @@ GrFragmentProcessor* ColorTableEffect::TestCreate(SkRandom* random,
GrFragmentProcessor* SkTable_ColorFilter::asFragmentProcessor(GrContext* context) const {
SkBitmap bitmap;
- GrFragmentProcessor* fp = NULL;
this->asComponentTable(&bitmap);
// passing NULL because this effect does no tiling or filtering.
- GrTexture* texture = GrLockAndRefCachedBitmapTexture(context, bitmap, NULL);
- if (texture) {
- fp = ColorTableEffect::Create(texture, fFlags);
-
- // Unlock immediately, this is not great, but we don't have a way of
- // knowing when else to unlock it currently. TODO: Remove this when
- // unref becomes the unlock replacement for all types of textures.
- GrUnlockAndUnrefCachedBitmapTexture(texture);
- }
- return fp;
+ SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(context, bitmap, NULL));
+ return texture ? ColorTableEffect::Create(texture, fFlags) : NULL;
}
#endif // SK_SUPPORT_GPU
« no previous file with comments | « src/effects/SkPerlinNoiseShader.cpp ('k') | src/effects/gradients/SkGradientShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698