aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkTableColorFilter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/effects/SkTableColorFilter.cpp')
-rw-r--r--src/effects/SkTableColorFilter.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp
index 4853f73e5c..bed99fc9de 100644
--- a/src/effects/SkTableColorFilter.cpp
+++ b/src/effects/SkTableColorFilter.cpp
@@ -418,7 +418,6 @@ void ColorTableEffect::getConstantColorComponents(GrColor* color, uint32_t* vali
}
}
-
///////////////////////////////////////////////////////////////////////////////
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(ColorTableEffect);
@@ -434,19 +433,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