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

Unified Diff: include/effects/SkModeColorFilter.h

Issue 1395403002: change more effects to only expose factories (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 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/SkColorFilterImageFilter.h ('k') | src/effects/SkColorFilterImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/effects/SkModeColorFilter.h
diff --git a/include/effects/SkModeColorFilter.h b/include/effects/SkModeColorFilter.h
index 0c876aef0b325da8f66dd7aad5deabd48f6a0538..06eec43572bd5264dc6bd839ba390bffeb978c52 100644
--- a/include/effects/SkModeColorFilter.h
+++ b/include/effects/SkModeColorFilter.h
@@ -15,11 +15,9 @@
class SkModeColorFilter : public SkColorFilter {
public:
- SkModeColorFilter(SkColor color, SkXfermode::Mode mode) {
- fColor = color;
- fMode = mode;
- this->updateCache();
- };
+ static SkColorFilter* Create(SkColor color, SkXfermode::Mode mode) {
+ return new SkModeColorFilter(color, mode);
+ }
SkColor getColor() const { return fColor; }
SkXfermode::Mode getMode() const { return fMode; }
@@ -44,6 +42,12 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkModeColorFilter)
protected:
+ SkModeColorFilter(SkColor color, SkXfermode::Mode mode) {
+ fColor = color;
+ fMode = mode;
+ this->updateCache();
+ };
+
void flatten(SkWriteBuffer&) const override;
private:
« no previous file with comments | « include/effects/SkColorFilterImageFilter.h ('k') | src/effects/SkColorFilterImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698