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

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 experimental/PdfViewer 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 | « include/core/SkPathEffect.h ('k') | include/effects/Sk1DPathEffect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkXfermode.h
diff --git a/include/core/SkXfermode.h b/include/core/SkXfermode.h
index 31b8081f85b0f05a2904f20d9ae22f07900634cd..86c08dd6b7bb43d86731b85def691248a7d515b8 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,
@@ -230,6 +228,11 @@ protected:
*/
virtual SkPMColor xferColor(SkPMColor src, SkPMColor dst) const;
+#ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS
+public:
+#endif
+ SkXfermode() {}
+
private:
enum {
kModeCount = kLastMode + 1
@@ -250,7 +253,9 @@ private:
*/
class SkProcXfermode : public SkXfermode {
public:
- SkProcXfermode(SkXfermodeProc proc) : fProc(proc) {}
+ static SkProcXfermode* Create(SkXfermodeProc proc) {
+ return SkNEW_ARGS(SkProcXfermode, (proc));
+ }
// overrides from SkXfermode
virtual void xfer32(SkPMColor dst[], const SkPMColor src[], int count,
@@ -276,6 +281,11 @@ protected:
return fProc;
}
+#ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS
+public:
+#endif
+ SkProcXfermode(SkXfermodeProc proc) : fProc(proc) {}
+
private:
SkXfermodeProc fProc;
« no previous file with comments | « include/core/SkPathEffect.h ('k') | include/effects/Sk1DPathEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698