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

Unified Diff: src/effects/SkPixelXorXfermode.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/SkLerpXfermode.cpp ('k') | src/effects/SkToFromValue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkPixelXorXfermode.cpp
diff --git a/src/effects/SkPixelXorXfermode.cpp b/src/effects/SkPixelXorXfermode.cpp
index 2a6ac47aac4fb8e34a948ed2c8debeefd9cf9947..8e13b2250cab2d5bff2e4cd27b68715a9d8b37ed 100644
--- a/src/effects/SkPixelXorXfermode.cpp
+++ b/src/effects/SkPixelXorXfermode.cpp
@@ -12,6 +12,8 @@
#include "SkReadBuffer.h"
#include "SkWriteBuffer.h"
#include "SkString.h"
+#include "SkValue.h"
+#include "SkValueKeys.h"
// we always return an opaque color, 'cause I don't know what to do with
// the alpha-component and still return a valid premultiplied color.
@@ -35,3 +37,10 @@ void SkPixelXorXfermode::toString(SkString* str) const {
str->appendHex(fOpColor);
}
#endif
+
+SkValue SkPixelXorXfermode::asValue() const {
+ auto value = SkValue::Object(SkValue::PixelXorXfermode);
+ value.set(SkValueKeys::PixelXorXfermode::kOpColor,
+ SkValue::FromU32(SkToU32(fOpColor)));
+ return value;
+}
« no previous file with comments | « src/effects/SkLerpXfermode.cpp ('k') | src/effects/SkToFromValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698