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

Unified Diff: src/effects/SkArithmeticMode.cpp

Issue 1585813004: SkValue: SkXfermode (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: space Created 4 years, 11 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_proccoeff.h ('k') | src/effects/SkLerpXfermode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkArithmeticMode.cpp
diff --git a/src/effects/SkArithmeticMode.cpp b/src/effects/SkArithmeticMode.cpp
index 3a8c8f398e999974f7d050c5f577016438a3ca32..2e68cab353b84fd9c5dbed517ddc5ff2738decd5 100644
--- a/src/effects/SkArithmeticMode.cpp
+++ b/src/effects/SkArithmeticMode.cpp
@@ -11,6 +11,8 @@
#include "SkWriteBuffer.h"
#include "SkString.h"
#include "SkUnPreMultiply.h"
+#include "SkValue.h"
+#include "SkValueKeys.h"
#if SK_SUPPORT_GPU
#include "SkArithmeticMode_gpu.h"
#endif
@@ -53,6 +55,18 @@ private:
buffer.writeScalar(fK[3]);
buffer.writeBool(fEnforcePMColor);
}
+
+ SkValue asValue() const override {
+ auto value = SkValue::Object(SkValue::ArithmeticXfermode);
+ using namespace SkValueKeys::ArithmeticXfermode;
+ value.set(kK0, SkValue::FromF32(fK[0]));
+ value.set(kK1, SkValue::FromF32(fK[1]));
+ value.set(kK2, SkValue::FromF32(fK[2]));
+ value.set(kK3, SkValue::FromF32(fK[3]));
+ value.set(kEnforcePMColor, SkValue::FromS32(fEnforcePMColor ? 1 : 0));
+ return value;
+ }
+
SkScalar fK[4];
bool fEnforcePMColor;
« no previous file with comments | « src/core/SkXfermode_proccoeff.h ('k') | src/effects/SkLerpXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698