| Index: chrome/browser/android/vr_shell/gltf_parser.h
|
| diff --git a/chrome/browser/android/vr_shell/gltf_parser.h b/chrome/browser/android/vr_shell/gltf_parser.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9d0b8b9d6f220ef05a18ba290bd60146bd5b790b
|
| --- /dev/null
|
| +++ b/chrome/browser/android/vr_shell/gltf_parser.h
|
| @@ -0,0 +1,48 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CHROME_BROWSER_ANDROID_VR_SHELL_GLTF_PARSER_H_
|
| +#define CHROME_BROWSER_ANDROID_VR_SHELL_GLTF_PARSER_H_
|
| +
|
| +#include <memory>
|
| +#include <string>
|
| +#include <unordered_map>
|
| +
|
| +#include "base/values.h"
|
| +#include "chrome/browser/android/vr_shell/gltf_asset.h"
|
| +
|
| +namespace vr_shell {
|
| +
|
| +// Parser for glTF 1.0 specification
|
| +// https://github.com/KhronosGroup/glTF/tree/master/specification/1.0
|
| +// TODO(acondor): Implement glTF 2.0 parser. gltf::Asset is mostly version
|
| +// agnostic.
|
| +class GltfParser {
|
| + public:
|
| + GltfParser();
|
| + ~GltfParser();
|
| + std::unique_ptr<gltf::Asset> Parse(const base::DictionaryValue& dict);
|
| +
|
| + private:
|
| + void SetBuffers(const base::DictionaryValue& dict);
|
| + void SetBufferViews(const base::DictionaryValue& dict);
|
| + void SetAccessors(const base::DictionaryValue& dict);
|
| + void SetMeshes(const base::DictionaryValue& dict);
|
| + void SetNodes(const base::DictionaryValue& dict);
|
| + void SetScenes(const base::DictionaryValue& dict);
|
| +
|
| + std::unique_ptr<gltf::Asset> asset_;
|
| + std::unordered_map<std::string, std::size_t> buffer_ids_;
|
| + std::unordered_map<std::string, std::size_t> buffer_view_ids_;
|
| + std::unordered_map<std::string, std::size_t> accessor_ids_;
|
| + std::unordered_map<std::string, std::size_t> node_ids_;
|
| + std::unordered_map<std::string, std::size_t> mesh_ids_;
|
| + std::unordered_map<std::string, std::size_t> scene_ids_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(GltfParser);
|
| +};
|
| +
|
| +} // namespace vr_shell
|
| +
|
| +#endif // CHROME_BROWSER_ANDROID_VR_SHELL_GLTF_PARSER_H_
|
|
|