diff options
author | Raph Levien <raph@google.com> | 2014-06-04 15:25:30 -0700 |
---|---|---|
committer | Raph Levien <raph@google.com> | 2014-06-05 09:26:43 -0700 |
commit | 3164d1a77eecf3185347a44342131f4275de824f (patch) | |
tree | d63c5539ffbe4a8f9e22cdaf8829482c57d48829 /include | |
parent | 893399732b64203133c22ad3c1f3535e46bf35a7 (diff) | |
download | android_frameworks_minikin-3164d1a77eecf3185347a44342131f4275de824f.tar.gz android_frameworks_minikin-3164d1a77eecf3185347a44342131f4275de824f.tar.bz2 android_frameworks_minikin-3164d1a77eecf3185347a44342131f4275de824f.zip |
Make paint flags consistently uint32_t
Change internal plumbing of paint flags (including CssParse) to uint32_t
consistently, to match the type used in the client. This will probably
prevent compiler warnings. Also renames "float" to "double" to avoid
confusion about precision.
Change-Id: I80374712c4067ca9e7711cc2d4ec33c440ab9c7c
Diffstat (limited to 'include')
-rw-r--r-- | include/minikin/CssParse.h | 17 | ||||
-rw-r--r-- | include/minikin/MinikinFont.h | 2 |
2 files changed, 10 insertions, 9 deletions
diff --git a/include/minikin/CssParse.h b/include/minikin/CssParse.h index ae2aac6..ea28b81 100644 --- a/include/minikin/CssParse.h +++ b/include/minikin/CssParse.h @@ -54,7 +54,7 @@ class CssValue { public: enum Type { UNKNOWN, - FLOAT, + DOUBLE, STRING }; enum Units { @@ -65,15 +65,16 @@ public: }; CssValue() : mType(UNKNOWN) { } explicit CssValue(double v) : - mType(FLOAT), floatValue(v), mUnits(SCALAR) { } + mType(DOUBLE), doubleValue(v), mUnits(SCALAR) { } Type getType() const { return mType; } - double getFloatValue() const { return floatValue; } - int32_t getIntValue() const { return floatValue; } + double getDoubleValue() const { return doubleValue; } + int32_t getIntValue() const { return doubleValue; } + uint32_t getUintValue() const { return doubleValue; } std::string getStringValue() const { return stringValue; } std::string toString(CssTag tag) const; - void setFloatValue(double v) { - mType = FLOAT; - floatValue = v; + void setDoubleValue(double v) { + mType = DOUBLE; + doubleValue = v; } void setStringValue(const std::string& v) { mType = STRING; @@ -81,7 +82,7 @@ public: } private: Type mType; - double floatValue; + double doubleValue; std::string stringValue; Units mUnits; }; diff --git a/include/minikin/MinikinFont.h b/include/minikin/MinikinFont.h index 1f6894c..9ff08a9 100644 --- a/include/minikin/MinikinFont.h +++ b/include/minikin/MinikinFont.h @@ -33,7 +33,7 @@ struct MinikinPaint { float size; float scaleX; float skewX; - int32_t paintFlags; + uint32_t paintFlags; }; struct MinikinRect { |