Chromium Code Reviews| 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 |
| index b795444360826dbf3412e19eb84578c4b539c42c..2af39b446052ad86b258f8134d7cc5c911841b69 100644 |
| --- a/chrome/browser/android/vr_shell/gltf_parser.h |
| +++ b/chrome/browser/android/vr_shell/gltf_parser.h |
| @@ -9,6 +9,7 @@ |
| #include <string> |
| #include <unordered_map> |
| +#include "base/files/file_path.h" |
| #include "base/values.h" |
| #include "chrome/browser/android/vr_shell/gltf_asset.h" |
| @@ -28,7 +29,13 @@ class GltfParser { |
| public: |
| GltfParser(); |
| ~GltfParser(); |
| - std::unique_ptr<gltf::Asset> Parse(const base::DictionaryValue& dict); |
| + // Provide a path if your gltf references external files. |
| + // If so, run it off of the UI thread. |
|
mthiesse
2017/03/24 14:14:49
Actually, instead of telling users what thread to
acondor_
2017/03/24 14:52:00
Done.
|
| + std::unique_ptr<gltf::Asset> Parse( |
| + const base::DictionaryValue& dict, |
| + const base::FilePath& path = base::FilePath()); |
| + // Call this method out off the UI thread. |
|
mthiesse
2017/03/24 14:14:49
// Note: This function will perform IO.
acondor_
2017/03/24 14:52:00
Done.
|
| + std::unique_ptr<gltf::Asset> Parse(const base::FilePath& gltf_path); |
| private: |
| bool ParseInternal(const base::DictionaryValue& dict); |
| @@ -40,8 +47,11 @@ class GltfParser { |
| bool SetScenes(const base::DictionaryValue& dict); |
| std::unique_ptr<gltf::Mesh::Primitive> ProcessPrimitive( |
| const base::DictionaryValue& dict); |
| + std::unique_ptr<gltf::Buffer> ProcessUri(const std::string& uri_str); |
| + void Clear(); |
| std::unique_ptr<gltf::Asset> asset_; |
| + base::FilePath path_; |
| 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_; |