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

Unified Diff: src/core/SkXfermode_proccoeff.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 | « src/core/SkXfermode.cpp ('k') | src/effects/SkArithmeticMode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkXfermode_proccoeff.h
diff --git a/src/core/SkXfermode_proccoeff.h b/src/core/SkXfermode_proccoeff.h
index 1a2f7fcc7f35b3c685aca1db0de378b31afaa717..11121115f178393a6a1463246bf8c33f7033915e 100644
--- a/src/core/SkXfermode_proccoeff.h
+++ b/src/core/SkXfermode_proccoeff.h
@@ -15,12 +15,8 @@ struct ProcCoeff {
class SkProcCoeffXfermode : public SkProcXfermode {
public:
- SkProcCoeffXfermode(const ProcCoeff& rec, Mode mode)
- : INHERITED(rec.fProc) {
- fMode = mode;
- // these may be valid, or may be CANNOT_USE_COEFF
- fSrcCoeff = rec.fSC;
- fDstCoeff = rec.fDC;
+ static SkProcCoeffXfermode* Create(const ProcCoeff& rec, Mode mode) {
+ return SkNEW_ARGS(SkProcCoeffXfermode, (rec, mode));
}
virtual bool asMode(Mode* mode) const SK_OVERRIDE;
@@ -36,6 +32,14 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkProcCoeffXfermode)
protected:
+ SkProcCoeffXfermode(const ProcCoeff& rec, Mode mode)
+ : INHERITED(rec.fProc) {
+ fMode = mode;
+ // these may be valid, or may be CANNOT_USE_COEFF
+ fSrcCoeff = rec.fSC;
+ fDstCoeff = rec.fDC;
+ }
+
SkProcCoeffXfermode(SkReadBuffer& buffer);
virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE;
« no previous file with comments | « src/core/SkXfermode.cpp ('k') | src/effects/SkArithmeticMode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698