Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Unified Diff: chrome/browser/android/vr_shell/gltf_parser.h

Issue 2774653002: Support for parsing external file references in a glTF resource. (Closed)
Patch Set: Scoping Clean call. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/android/vr_shell/BUILD.gn ('k') | chrome/browser/android/vr_shell/gltf_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..63283363ce37f52f50752605dbaeee0233e6d452 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);
+ // Note: If your glTF references external files, this function will perform
+ // IO, and a base path must be specified.
+ std::unique_ptr<gltf::Asset> Parse(
+ const base::DictionaryValue& dict,
+ const base::FilePath& path = base::FilePath());
+ // Note: This function will perform IO.
+ 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_;
« no previous file with comments | « chrome/browser/android/vr_shell/BUILD.gn ('k') | chrome/browser/android/vr_shell/gltf_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698