diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-06-06 16:07:39 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-06-06 16:07:39 -0700 |
commit | f663e4fb30bad72783d5059f1efcd70b83846979 (patch) | |
tree | fe89eda86528fb71915c61e7f93ca898b3b8cee2 /src | |
parent | cec906c9c27fba775270e62aa3359489fe452c56 (diff) |
proxy getExtension
Diffstat (limited to 'src')
-rw-r--r-- | src/proxyClient.js | 2 | ||||
-rw-r--r-- | src/proxyWorker.js | 2 | ||||
-rw-r--r-- | src/webGLClient.js | 10 | ||||
-rw-r--r-- | src/webGLWorker.js | 6 |
4 files changed, 14 insertions, 6 deletions
diff --git a/src/proxyClient.js b/src/proxyClient.js index 53412671..3b27c12a 100644 --- a/src/proxyClient.js +++ b/src/proxyClient.js @@ -31,7 +31,7 @@ WebGLClient.prefetch(); // XXX not guaranteed to be before worker main() var workerResponded = false; worker.onmessage = function worker_onmessage(event) { - dump('client got ' + JSON.stringify(event.data) + '\n'); + //dump('client got ' + JSON.stringify(event.data) + '\n'); if (!workerResponded) { workerResponded = true; if (Module.setStatus) Module.setStatus(''); diff --git a/src/proxyWorker.js b/src/proxyWorker.js index 459365cd..a844eac8 100644 --- a/src/proxyWorker.js +++ b/src/proxyWorker.js @@ -143,7 +143,7 @@ onmessage = function onmessage(message) { } messageBuffer.push(message); } - dump('worker got ' + JSON.stringify(message.data) + '\n'); + //dump('worker got ' + JSON.stringify(message.data) + '\n'); switch (message.data.target) { case 'document': { document.fireEvent(message.data.event); diff --git a/src/webGLClient.js b/src/webGLClient.js index 02756ddb..a0cc7b7d 100644 --- a/src/webGLClient.js +++ b/src/webGLClient.js @@ -2,6 +2,16 @@ function WebGLClient() { function renderCommands(buffer) { + var ctx = Module.ctx; + var i = 0; + var len = buffer.length; + while (i < len) { + var command = buffer[i++]; + var numArgs = buffer[i++]; + var args = buffer.slice(i, i+numArgs); + i += numArgs; + ctx[command].apply(ctx, args); + } } this.onmessage = function(msg) { diff --git a/src/webGLWorker.js b/src/webGLWorker.js index eb230e51..582016f7 100644 --- a/src/webGLWorker.js +++ b/src/webGLWorker.js @@ -442,7 +442,7 @@ function WebGLWorker() { // Helpers this.onmessage = function(msg) { - dump('worker GL got ' + JSON.stringify(msg) + '\n'); + //dump('worker GL got ' + JSON.stringify(msg) + '\n'); switch(msg.op) { case 'setPrefetched': { that.prefetchedParameters = msg.parameters; @@ -461,17 +461,15 @@ function WebGLWorker() { } this.getParameter = function(name) { - dump('worker getParameter ' + JSON.stringify(this.prefetchedParameters) + '\n'); assert(name); if (name in this.prefetchedParameters) return this.prefetchedParameters[name]; throw 'TODO: get parameter ' + name + ' : ' + revname(name); }; this.getExtension = function(name) { - dump('worker getExtension ' + JSON.stringify(this.prefetchedExtensions) + '\n'); var i = this.prefetchedExtensions.indexOf(name); if (i < 0) return null; - // XXX send a msg, to enable it in the client + commandBuffer.push('getExtension', 1, name); return true; // TODO: return an object here }; |