Chromium Code Reviews| Index: chrome/browser/android/vr_shell/ui_scene.cc |
| diff --git a/chrome/browser/android/vr_shell/ui_scene.cc b/chrome/browser/android/vr_shell/ui_scene.cc |
| index 020e307e94c255163fd4d3d8fac6f71025c993ce..f61d4cf5ab416a280ca9531b4fdc1e3a006165e0 100644 |
| --- a/chrome/browser/android/vr_shell/ui_scene.cc |
| +++ b/chrome/browser/android/vr_shell/ui_scene.cc |
| @@ -16,6 +16,17 @@ namespace vr_shell { |
| namespace { |
| +bool ParseNumber(const base::DictionaryValue& dict, |
| + const std::string& key, |
| + float* output) { |
| + double number; |
| + if (!dict.GetDouble(key, &number)) { |
| + return false; |
| + } |
| + *output = number; |
| + return true; |
| +} |
| + |
| bool ParseRecti(const base::DictionaryValue& dict, |
| const std::string& key, |
| Recti* output) { |
| @@ -31,6 +42,7 @@ bool ParseRecti(const base::DictionaryValue& dict, |
| } |
| } |
| +#if 0 |
| bool Parse2DVec3f(const base::DictionaryValue& dict, |
| const std::string& key, |
| gvr::Vec3f* output) { |
| @@ -65,6 +77,7 @@ bool ParseVec3f(const base::DictionaryValue& dict, |
| return false; |
| } |
| } |
| +#endif |
| bool ParseColorf(const base::DictionaryValue& dict, |
| const std::string& key, |
| @@ -86,6 +99,7 @@ bool ParseColorf(const base::DictionaryValue& dict, |
| } |
| } |
| +#if 0 |
| bool ParseRotationAxisAngle(const base::DictionaryValue& dict, |
| const std::string& key, |
| RotationAxisAngle* output) { |
| @@ -105,6 +119,7 @@ bool ParseRotationAxisAngle(const base::DictionaryValue& dict, |
| return false; |
| } |
| } |
| +#endif |
| void ParseFloats(const base::DictionaryValue& dict, |
| const std::vector<std::string>& keys, |
| @@ -429,6 +444,8 @@ void UiScene::ApplyRecursiveTransforms(const ContentRectangle& element, |
| void UiScene::ApplyDictToElement(const base::DictionaryValue& dict, |
| ContentRectangle *element) { |
| int parent_id; |
| + //const base::DictionaryValue* item_dict; |
| + |
| if (dict.GetInteger("parentId", &parent_id)) { |
| CHECK_GE(parent_id, 0); |
| CHECK_NE(GetUiElementById(parent_id), nullptr); |
| @@ -438,15 +455,21 @@ void UiScene::ApplyDictToElement(const base::DictionaryValue& dict, |
| dict.GetBoolean("visible", &element->visible); |
| dict.GetBoolean("hitTestable", &element->hit_testable); |
| dict.GetBoolean("lockToFov", &element->lock_to_fov); |
| - Parse2DVec3f(dict, "size", &element->size); |
| - ParseVec3f(dict, "scale", &element->scale); |
| - ParseRotationAxisAngle(dict, "rotation", &element->rotation); |
| - ParseVec3f(dict, "translation", &element->translation); |
| - double opacity; |
| - if (dict.GetDouble("opacity", &opacity)) { |
| - element->opacity = opacity; |
| - } |
| + ParseNumber(dict, "sizeX", &element->size.x); |
|
cjgrant
2017/02/15 16:34:27
Independent of CSS custom properties, I'd like to
tiborg
2017/02/15 18:36:11
+1, this is a good idea.
cjgrant
2017/03/03 15:11:07
For the record, this change landed in ToT, and is
|
| + ParseNumber(dict, "sizeY", &element->size.y); |
| + ParseNumber(dict, "scaleX", &element->scale.x); |
| + ParseNumber(dict, "scaleY", &element->scale.y); |
| + ParseNumber(dict, "scaleZ", &element->scale.z); |
| + ParseNumber(dict, "rotationX", &element->rotation.x); |
| + ParseNumber(dict, "rotationY", &element->rotation.y); |
| + ParseNumber(dict, "rotationZ", &element->rotation.z); |
| + ParseNumber(dict, "rotationAngle", &element->rotation.angle); |
| + ParseNumber(dict, "translationX", &element->translation.x); |
| + ParseNumber(dict, "translationY", &element->translation.y); |
| + ParseNumber(dict, "translationZ", &element->translation.z); |
| + |
| + ParseNumber(dict, "opacity", &element->opacity); |
| if (dict.GetInteger("xAnchoring", |
| reinterpret_cast<int*>(&element->x_anchoring))) { |
| CHECK_GE(element->parent_id, 0); |