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

Unified Diff: include/core/SkXfermode.h

Issue 166583002: Factory methods for heap-allocated SkPathEffect and SkXfermode objects. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update sampleapp & animator 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
Index: include/core/SkXfermode.h
diff --git a/include/core/SkXfermode.h b/include/core/SkXfermode.h
index 31b8081f85b0f05a2904f20d9ae22f07900634cd..262407201c810c5198c4944d656f1a79989c599b 100644
--- a/include/core/SkXfermode.h
+++ b/include/core/SkXfermode.h
@@ -32,8 +32,6 @@ class SK_API SkXfermode : public SkFlattenable {
public:
SK_DECLARE_INST_COUNT(SkXfermode)
- SkXfermode() {}
-
virtual void xfer32(SkPMColor dst[], const SkPMColor src[], int count,
const SkAlpha aa[]) const;
virtual void xfer16(uint16_t dst[], const SkPMColor src[], int count,
@@ -218,6 +216,7 @@ public:
SK_DEFINE_FLATTENABLE_TYPE(SkXfermode)
protected:
+ SkXfermode() {}
SkXfermode(SkReadBuffer& rb) : SkFlattenable(rb) {}
/** The default implementation of xfer32/xfer16/xferA8 in turn call this
@@ -252,6 +251,10 @@ class SkProcXfermode : public SkXfermode {
public:
SkProcXfermode(SkXfermodeProc proc) : fProc(proc) {}
reed1 2014/02/18 14:06:22 Should this (all) constructor be protected?
+ static SkProcXfermode* Create(SkXfermodeProc proc) {
+ return SkNEW_ARGS(SkProcXfermode, (proc));
+ }
+
// overrides from SkXfermode
virtual void xfer32(SkPMColor dst[], const SkPMColor src[], int count,
const SkAlpha aa[]) const SK_OVERRIDE;

Powered by Google App Engine
This is Rietveld 408576698