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

Unified Diff: src/effects/SkLerpXfermode.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/effects/SkArithmeticMode.cpp ('k') | src/effects/SkPixelXorXfermode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+}
« no previous file with comments | « src/effects/SkArithmeticMode.cpp ('k') | src/effects/SkPixelXorXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698