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

Unified Diff: src/xml/SkJSDisplayable.cpp

Issue 117053002: remove SK_SCALAR_IS_[FLOAT,FIXED] and assume floats (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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
Index: src/xml/SkJSDisplayable.cpp
diff --git a/src/xml/SkJSDisplayable.cpp b/src/xml/SkJSDisplayable.cpp
index 502779743fc70ce8ab37ed95f234e2aeae796c88..02a05016727caa3ca752604f48c71be16f9bfc81 100644
--- a/src/xml/SkJSDisplayable.cpp
+++ b/src/xml/SkJSDisplayable.cpp
@@ -277,11 +277,7 @@ JSBool SkJSDisplayable::GetProperty(JSContext *cx, JSObject *obj, jsval id,
if (SkScalarFraction(scalar) == 0)
*vp = INT_TO_JSVAL(SkScalarFloor(scalar));
else
-#ifdef SK_SCALAR_IS_FLOAT
*vp = DOUBLE_TO_JSVAL(scalar);
-#else
- *vp = DOUBLE_TO_JSVAL(scalar / 65536.0f );
-#endif
break;
case SkType_String:
str = JS_NewStringCopyN(cx, string->c_str(), string->size());
@@ -323,11 +319,7 @@ JSBool SkJSDisplayable::SetProperty(JSContext *cx, JSObject *obj, jsval id, jsva
scalar = SkIntToScalar(JSVAL_TO_INT(value));
else {
SkASSERT(JSVAL_IS_DOUBLE(value));
-#ifdef SK_SCALAR_IS_FLOAT
scalar = (float) *(double*) JSVAL_TO_DOUBLE(value);
-#else
- scalar = (SkFixed) (*(double*)JSVAL_TO_DOUBLE(value) * 65536.0);
-#endif
}
break;
case SkType_String:
« src/core/SkCanvas.cpp ('K') | « src/utils/SkParsePath.cpp ('k') | src/xml/SkXMLWriter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698