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

Unified Diff: include/effects/SkAvoidXfermode.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/effects/Sk2DPathEffect.h ('k') | include/effects/SkCornerPathEffect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/effects/SkAvoidXfermode.h
diff --git a/include/effects/SkAvoidXfermode.h b/include/effects/SkAvoidXfermode.h
index afc3fc9d7009e572537d3aa5410bd29a2edb4c84..2fa20b98346781c370af9faaaa256d76053435f4 100644
--- a/include/effects/SkAvoidXfermode.h
+++ b/include/effects/SkAvoidXfermode.h
@@ -37,7 +37,9 @@ public:
Tolerance near 0: draw only on colors that are nearly identical to the op-color
Tolerance near 255: draw on any colors even remotely similar to the op-color
*/
- SkAvoidXfermode(SkColor opColor, U8CPU tolerance, Mode mode);
+ static SkAvoidXfermode* Create(SkColor opColor, U8CPU tolerance, Mode mode) {
+ return SkNEW_ARGS(SkAvoidXfermode, (opColor, tolerance, mode));
+ }
// overrides from SkXfermode
virtual void xfer32(SkPMColor dst[], const SkPMColor src[], int count,
@@ -54,6 +56,11 @@ protected:
SkAvoidXfermode(SkReadBuffer&);
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
+#ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS
+public:
+#endif
+ SkAvoidXfermode(SkColor opColor, U8CPU tolerance, Mode mode);
+
private:
SkColor fOpColor;
uint32_t fDistMul; // x.14
« no previous file with comments | « include/effects/Sk2DPathEffect.h ('k') | include/effects/SkCornerPathEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698