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

Unified Diff: include/core/SkColorFilter.h

Issue 972153010: add impl limit for number of leaf-nodes in composecolorfilter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: simplify using base-1 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
« no previous file with comments | « no previous file | src/core/SkColorFilter.cpp » ('j') | tests/ColorFilterTest.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkColorFilter.h
diff --git a/include/core/SkColorFilter.h b/include/core/SkColorFilter.h
index 14d33069f01ae9a74c2ae04d15db5758a20ef58d..1ab4ff37203bad7606b0a9287f79dacd29766691 100644
--- a/include/core/SkColorFilter.h
+++ b/include/core/SkColorFilter.h
@@ -134,6 +134,9 @@ public:
/** Construct a colorfilter whose effect is to first apply the inner filter and then apply
* the outer filter to the result of the inner's.
* The reference counts for outer and inner are incremented.
+ *
+ * Due to internal limits, it is possible that this will return NULL, so the caller must
+ * always check.
*/
static SkColorFilter* CreateComposeFilter(SkColorFilter* outer, SkColorFilter* inner);
@@ -159,6 +162,16 @@ protected:
SkColorFilter() {}
private:
+ /*
+ * Returns 1 if this is a single filter (not a composition of other filters), otherwise it
robertphillips 2015/03/05 15:20:43 reutrns
+ * reutrns the number of leaf-node filters in a composition. This should be the same value
+ * as the number of GrFragmentProcessors returned by asFragmentProcessors's array parameter.
+ *
+ * e.g. compose(filter, compose(compose(filter, filter), filter)) --> 4
+ */
+ virtual int privateComposedFilterCount() const { return 1; }
Stephen White 2015/03/05 15:19:11 Nit: maybe this could just be privateFilterCount()
+ friend class SkComposeColorFilter;
+
typedef SkFlattenable INHERITED;
};
« no previous file with comments | « no previous file | src/core/SkColorFilter.cpp » ('j') | tests/ColorFilterTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698