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

Unified Diff: include/effects/SkColorMatrixFilter.h

Issue 175293002: Factory methods for heap-allocated SkColorFilter objects. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 | « gm/imagefiltersgraph.cpp ('k') | src/effects/SkColorFilterImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/effects/SkColorMatrixFilter.h
diff --git a/include/effects/SkColorMatrixFilter.h b/include/effects/SkColorMatrixFilter.h
index a4144e17175dcd765aaaf022de52df7dd186aeca..785d682c991550141dc8bdcbe628850033035e1d 100644
--- a/include/effects/SkColorMatrixFilter.h
+++ b/include/effects/SkColorMatrixFilter.h
@@ -13,8 +13,12 @@
class SK_API SkColorMatrixFilter : public SkColorFilter {
public:
- explicit SkColorMatrixFilter(const SkColorMatrix&);
- SkColorMatrixFilter(const SkScalar array[20]);
+ static SkColorMatrixFilter* Create(const SkColorMatrix& cm) {
+ return SkNEW_ARGS(SkColorMatrixFilter, (cm));
+ }
+ static SkColorMatrixFilter* Create(const SkScalar array[20]) {
+ return SkNEW_ARGS(SkColorMatrixFilter, (array));
+ }
// overrides from SkColorFilter
virtual void filterSpan(const SkPMColor src[], int count, SkPMColor[]) const SK_OVERRIDE;
@@ -38,6 +42,12 @@ protected:
SkColorMatrixFilter(SkReadBuffer& buffer);
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
+#ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS
+public:
+#endif
+ explicit SkColorMatrixFilter(const SkColorMatrix&);
+ SkColorMatrixFilter(const SkScalar array[20]);
+
private:
SkColorMatrix fMatrix;
« no previous file with comments | « gm/imagefiltersgraph.cpp ('k') | src/effects/SkColorFilterImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698