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

Unified Diff: src/gpu/SkGr.cpp

Issue 1368423003: Use child processors to implement compose color filter. (Closed) Base URL: https://skia.googlesource.com/skia.git@upm
Patch Set: update comment Created 5 years, 3 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/SkGr.cpp
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index e0892d8ab974e88db4034b429cba09727ab8cb93..cabac8601d1df50b5b28d20a1a9e6bbb3499cb5d 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -812,12 +812,10 @@ static inline bool skpaint_to_grpaint_impl(GrContext* context,
if (applyColorFilterToPaintColor) {
grPaint->setColor(SkColorToPremulGrColor(colorFilter->filterColor(skPaint.getColor())));
} else {
- SkTDArray<const GrFragmentProcessor*> array;
- if (colorFilter->asFragmentProcessors(context, grPaint->getProcessorDataManager(),
- &array)) {
- for (int i = 0; i < array.count(); ++i) {
- grPaint->addColorFragmentProcessor(array[i])->unref();
- }
+ SkAutoTUnref<const GrFragmentProcessor> cfFP(colorFilter->asFragmentProcessor(context,
+ grPaint->getProcessorDataManager()));
egdaniel 2015/09/29 13:23:52 Is there any cleaner way to alight this so that it
bsalomon 2015/09/29 13:31:43 Done.
+ if (cfFP) {
+ grPaint->addColorFragmentProcessor(cfFP);
} else {
return false;
}

Powered by Google App Engine
This is Rietveld 408576698