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

Unified Diff: src/core/SkXfermode_proccoeff.h

Issue 395603002: Simplify flattening to just write enough to call the factory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 4 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/Sk1DPathEffect.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 b777f62b5c614a25936ad780f4f5366682782035..47472e683c0ceef6990f6fa2844f45cd87dbf984 100644
--- a/src/core/SkXfermode_proccoeff.h
+++ b/src/core/SkXfermode_proccoeff.h
@@ -15,10 +15,14 @@ struct ProcCoeff {
class SK_API SkProcCoeffXfermode : public SkXfermode {
public:
- static SkProcCoeffXfermode* Create(const ProcCoeff& rec, Mode mode) {
- return SkNEW_ARGS(SkProcCoeffXfermode, (rec, mode));
+ SkProcCoeffXfermode(const ProcCoeff& rec, Mode mode) {
+ fMode = mode;
+ fProc = rec.fProc;
+ // these may be valid, or may be CANNOT_USE_COEFF
+ fSrcCoeff = rec.fSC;
+ fDstCoeff = rec.fDC;
}
-
+
virtual void xfer32(SkPMColor dst[], const SkPMColor src[], int count,
const SkAlpha aa[]) const SK_OVERRIDE;
virtual void xfer16(uint16_t dst[], const SkPMColor src[], int count,
@@ -39,15 +43,9 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkProcCoeffXfermode)
protected:
- SkProcCoeffXfermode(const ProcCoeff& rec, Mode mode) {
- fMode = mode;
- fProc = rec.fProc;
- // these may be valid, or may be CANNOT_USE_COEFF
- fSrcCoeff = rec.fSC;
- fDstCoeff = rec.fDC;
- }
-
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
SkProcCoeffXfermode(SkReadBuffer& buffer);
+#endif
virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE;
@@ -60,6 +58,8 @@ private:
Mode fMode;
Coeff fSrcCoeff, fDstCoeff;
+ friend class SkXfermode;
+
typedef SkXfermode INHERITED;
};
« no previous file with comments | « src/core/SkXfermode.cpp ('k') | src/effects/Sk1DPathEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698