Chromium Code Reviews| OLD | NEW | 
|---|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_GLTF_PARSER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_GLTF_PARSER_H_ | 
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_GLTF_PARSER_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_GLTF_PARSER_H_ | 
| 7 | 7 | 
| 8 #include <memory> | 8 #include <memory> | 
| 9 #include <string> | 9 #include <string> | 
| 10 #include <unordered_map> | 10 #include <unordered_map> | 
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 std::unordered_map<std::string, std::size_t> buffer_ids_; | 60 std::unordered_map<std::string, std::size_t> buffer_ids_; | 
| 61 std::unordered_map<std::string, std::size_t> buffer_view_ids_; | 61 std::unordered_map<std::string, std::size_t> buffer_view_ids_; | 
| 62 std::unordered_map<std::string, std::size_t> accessor_ids_; | 62 std::unordered_map<std::string, std::size_t> accessor_ids_; | 
| 63 std::unordered_map<std::string, std::size_t> node_ids_; | 63 std::unordered_map<std::string, std::size_t> node_ids_; | 
| 64 std::unordered_map<std::string, std::size_t> mesh_ids_; | 64 std::unordered_map<std::string, std::size_t> mesh_ids_; | 
| 65 std::unordered_map<std::string, std::size_t> scene_ids_; | 65 std::unordered_map<std::string, std::size_t> scene_ids_; | 
| 66 | 66 | 
| 67 DISALLOW_COPY_AND_ASSIGN(GltfParser); | 67 DISALLOW_COPY_AND_ASSIGN(GltfParser); | 
| 68 }; | 68 }; | 
| 69 | 69 | 
| 70 class BinaryGltfParser { | |
| 71 public: | |
| 72 // Note: If your glTF references external files, this function will perform | |
| 73 // IO, and a base path must be specified. | |
| 74 static std::unique_ptr<gltf::Asset> Parse( | |
| 75 const base::StringPiece& glb_content, | |
| 76 std::vector<std::unique_ptr<gltf::Buffer>>* buffers, | |
| 77 const base::FilePath& path = base::FilePath()); | |
| 78 | |
| 79 private: | |
| 80 enum { | |
| 81 kVersionStart = 4, | |
| 
 
mthiesse
2017/04/28 15:51:34
Remove this
 
acondor_
2017/04/28 16:07:01
Done.
 
 | |
| 82 kLengthStart = 8, | |
| 83 kContentLengthStart = 12, | |
| 84 kContentFormatStart = 16, | |
| 85 kContentStart = 20 | |
| 86 }; | |
| 87 }; | |
| 88 | |
| 70 } // namespace vr_shell | 89 } // namespace vr_shell | 
| 71 | 90 | 
| 72 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_GLTF_PARSER_H_ | 91 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_GLTF_PARSER_H_ | 
| OLD | NEW |