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

Unified Diff: src/effects/SkPerlinNoiseShader.cpp

Issue 973593002: change colorfilter to return an array of frag processors (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update gm Created 5 years, 10 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/effects/SkPerlinNoiseShader.cpp
diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp
index b721296afe2d6c38cc75ea7cc5fdc99eded5a184..6e53253f292a5d55fb5911e3142ffd411c23a2be 100644
--- a/src/effects/SkPerlinNoiseShader.cpp
+++ b/src/effects/SkPerlinNoiseShader.cpp
@@ -967,7 +967,11 @@ bool SkPerlinNoiseShader::asFragmentProcessor(GrContext* context, const SkPaint&
}
SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter(
clearColor, SkXfermode::kSrc_Mode));
- *fp = cf->asFragmentProcessor(context);
+ SkTDArray<GrFragmentProcessor*> array;
+ if (cf->asFragmentProcessors(context, &array)) {
+ SkASSERT(1 == array.count()); // modecolorfilter only returns one
+ *fp = array[0]; // transfer ownership to fp
+ }
return true;
}

Powered by Google App Engine
This is Rietveld 408576698