summaryrefslogtreecommitdiffstats
path: root/o3d/samples/o3djs/serialization.js
diff options
context:
space:
mode:
authorgman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-19 00:07:49 +0000
committergman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-19 00:07:49 +0000
commit8653167fd370f88b3bcc2be052a9aa26873dbe44 (patch)
tree602e188104e6d3992adac469f17d5c1605690f73 /o3d/samples/o3djs/serialization.js
parentc1b7f06be387b3828d38eccbf0e88d1ec71bac3b (diff)
downloadchromium_src-8653167fd370f88b3bcc2be052a9aa26873dbe44.zip
chromium_src-8653167fd370f88b3bcc2be052a9aa26873dbe44.tar.gz
chromium_src-8653167fd370f88b3bcc2be052a9aa26873dbe44.tar.bz2
expose Bitmap to JavaScript.
Also added Texture.drawImage(canvas...) There's still the big question of whether we should flip textures by default in the o3d code. Currently I'm flipping them by default in o3djs.texture.createTextureFromRawData and I'm flipping them by default in o3djs.canvas.CanvasQuad.updateTexture. I'm torn whether or not I should be flipping them. I feel like 2d examples and examples of displaying images, like a picasa viewer, would be simpler if we didn't flip by default but the problem then is if you load some textures through a collada scene they'll be flipped the opposite of any textures you load by hand. Review URL: http://codereview.chromium.org/171060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23678 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/samples/o3djs/serialization.js')
-rw-r--r--o3d/samples/o3djs/serialization.js11
1 files changed, 4 insertions, 7 deletions
diff --git a/o3d/samples/o3djs/serialization.js b/o3d/samples/o3djs/serialization.js
index bc459a3..2514bd7 100644
--- a/o3d/samples/o3djs/serialization.js
+++ b/o3d/samples/o3djs/serialization.js
@@ -39,6 +39,7 @@
o3djs.provide('o3djs.serialization');
o3djs.require('o3djs.error');
+o3djs.require('o3djs.texture');
/**
* A Module for handling events related to o3d and various browsers.
@@ -162,9 +163,7 @@ o3djs.serialization.Deserializer = function(pack, json) {
if (!rawData) {
throw 'Could not find texture ' + uri + ' in the archive';
}
- return deserializer.pack.createTextureFromRawData(
- rawData,
- true);
+ return o3djs.texture.createTextureFromRawData(pack, rawData, true);
} else {
return deserializer.pack.createTexture2D(
json.custom.width,
@@ -182,9 +181,7 @@ o3djs.serialization.Deserializer = function(pack, json) {
if (!rawData) {
throw 'Could not find texture ' + uri + ' in the archive';
}
- return deserializer.pack.createTextureFromRawData(
- rawData,
- true);
+ return o3djs.texture.createTextureFromRawData(pack, rawData, true);
} else {
return deserializer.pack.createTextureCUBE(
json.custom.edgeLength,
@@ -683,7 +680,7 @@ o3djs.serialization.deserialize = function(pack, json) {
/**
* Deserializes a single json object named 'scene.json' from a loaded
* o3djs.io.ArchiveInfo.
- * @param {!o3djs.io.archiveInfo} archiveInfo Archive to load from.
+ * @param {!o3djs.io.ArchiveInfo} archiveInfo Archive to load from.
* @param {string} sceneJsonUri The relative URI of the scene JSON file within
* the archive.
* @param {!o3d.Client} client An O3D client object.