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

Unified Diff: src/core/SkValue.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/SkValue.h ('k') | src/core/SkValueKeys.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkValue.cpp
diff --git a/src/core/SkValue.cpp b/src/core/SkValue.cpp
index 787cdf58df8f01c89b06bd47105a7aec01e80fa2..2db2796b0ca9d22ba7ac1744b8331477313b45f8 100644
--- a/src/core/SkValue.cpp
+++ b/src/core/SkValue.cpp
@@ -9,7 +9,6 @@
#include <vector>
#include "SkData.h"
-#include "SkMatrix.h"
#include "SkValue.h"
class SkValue::Obj {
@@ -184,37 +183,3 @@ SkValue SkValue::FromTs(SkValue::Type type, SkData* data) {
SkValue SkValue::FromU16s(SkData* d) { return FromTs<uint16_t>(U16s, d); }
SkValue SkValue::FromU32s(SkData* d) { return FromTs<uint32_t>(U32s, d); }
SkValue SkValue::FromF32s(SkData* d) { return FromTs< float>(F32s, d); }
-
-////////////////////////////////////////////////////////////////////////////////
-
-#define REQUIRE(cond) do { if (!(cond)) { SkASSERT(false); return false; } } while (false)
-
-template<> SkValue SkToValue<SkMatrix>(const SkMatrix& mat) {
- auto val = SkValue::Object(SkValue::Matrix);
- for (int i = 0; i < 9; ++i) {
- if (mat[i] != SkMatrix::I()[i]) {
- val.set(i, SkValue::FromF32(mat[i]));
- }
- }
- return val;
-}
-
-template<> bool SkFromValue<float>(const SkValue& val, float* f) {
- REQUIRE(val.type() == SkValue::F32);
- *f = val.f32();
- return true;
-}
-
-template<> bool SkFromValue<SkMatrix>(const SkValue& val, SkMatrix* m){
- REQUIRE(val.type() == SkValue::Matrix);
-
- *m = SkMatrix::I();
- for (int i = 0; i < 9; i++) {
- if (auto v = val.get(i)) {
- REQUIRE(SkFromValue(*v, &(*m)[i]));
- }
- }
- return true;
-}
-
-#undef REQUIRE
« no previous file with comments | « src/core/SkValue.h ('k') | src/core/SkValueKeys.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698