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

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: Address comments 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
« no previous file with comments | « src/gpu/GrProcOptInfo.h ('k') | tests/GpuColorFilterTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGr.cpp
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index e0892d8ab974e88db4034b429cba09727ab8cb93..59bd86570db78633561edae535183287ce35f5a6 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()));
+ if (cfFP) {
+ grPaint->addColorFragmentProcessor(cfFP);
} else {
return false;
}
« no previous file with comments | « src/gpu/GrProcOptInfo.h ('k') | tests/GpuColorFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698