Index: src/effects/SkLerpXfermode.cpp |
diff --git a/src/effects/SkLerpXfermode.cpp b/src/effects/SkLerpXfermode.cpp |
index a9b0d9e3e75f379d7ae3b34d033593e1f7b72e2d..a069e8b367a0d67fd201ca7e1db96065bd7958b1 100644 |
--- a/src/effects/SkLerpXfermode.cpp |
+++ b/src/effects/SkLerpXfermode.cpp |
@@ -10,6 +10,8 @@ |
#include "SkReadBuffer.h" |
#include "SkWriteBuffer.h" |
#include "SkString.h" |
+#include "SkValue.h" |
+#include "SkValueKeys.h" |
SkXfermode* SkLerpXfermode::Create(SkScalar scale) { |
int scale256 = SkScalarRoundToInt(scale * 256); |
@@ -107,3 +109,10 @@ void SkLerpXfermode::toString(SkString* str) const { |
str->printf("SkLerpXfermode: scale: %g", fScale256 / 256.0); |
} |
#endif |
+ |
+SkValue SkLerpXfermode::asValue() const { |
+ auto value = SkValue::Object(SkValue::LerpXfermode); |
+ value.set(SkValueKeys::LerpXfermode::kScale, |
+ SkValue::FromF32(fScale256 / 256.0f)); |
+ return value; |
+} |