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

Unified Diff: core/cross/file_request.h

Issue 149784: Add RawData request in preparation for manual loading of... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: Created 11 years, 5 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
Index: core/cross/file_request.h
===================================================================
--- core/cross/file_request.h (revision 20922)
+++ core/cross/file_request.h (working copy)
@@ -42,6 +42,7 @@
#include "core/cross/callback.h"
#include "core/cross/object_base.h"
#include "core/cross/pack.h"
+#include "import/cross/raw_data.h"
namespace o3d {
@@ -54,7 +55,8 @@
enum Type {
TYPE_INVALID,
TYPE_TEXTURE,
- TYPE_MAX = TYPE_TEXTURE,
+ TYPE_RAWDATA,
+ TYPE_MAX = TYPE_RAWDATA,
};
enum ReadyState { // These are copied from XMLHttpRequest.
@@ -82,6 +84,9 @@
if (type == "texture") {
return TYPE_TEXTURE;
}
+ if (type == "rawdata") {
+ return TYPE_RAWDATA;
+ }
return TYPE_INVALID;
}
@@ -109,6 +114,9 @@
Texture *texture() const {
return texture_.Get();
}
+ RawData *data() const {
+ return data_.Get();
+ }
bool generate_mipmaps() const { return generate_mipmaps_; }
void set_generate_mipmaps(bool value) {
generate_mipmaps_ = value;
@@ -117,6 +125,10 @@
CHECK(type_ == TYPE_TEXTURE);
texture_ = Texture::Ref(texture);
}
+ void set_data(RawData *data) {
+ CHECK(type_ == TYPE_RAWDATA);
+ data_ = RawData::Ref(data);
+ }
bool done() const {
return done_;
}
@@ -153,6 +165,7 @@
String uri_;
Type type_;
Texture::Ref texture_; // Only used on a successful texture load.
+ RawData::Ref data_; // Only used on a successful RawData load.
bool generate_mipmaps_;
bool done_; // Set after completion/failure to indicate success_ is valid.
bool success_; // Set after completion/failure to indicate which it is.
« no previous file with comments | « core/cross/bitmap.cc ('k') | import/cross/raw_data.h » ('j') | plugin/cross/async_loading.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698