Skip to content

Commit

Permalink
texture speed increase for image tags
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and unknown committed Mar 20, 2011
1 parent fed56a1 commit 71df9fe
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion c3dl/texture/texture.js
Expand Up @@ -233,7 +233,14 @@ c3dl.Texture = function ()
return returnCode;
}
this.update = function () {
if(sourcecan) {
if (sourcecan instanceof HTMLImageElement) {
if (sourcecan.src && sourcecan.src != tCanvas.oldSrc && sourcecan.complete) {
tCtx.drawImage(sourcecan, 0, 0, tCanvas.width, tCanvas.height);
textureImage.onload();
tCanvas.oldSrc = sourcecan.src;
}
}
else {
tCtx.drawImage(sourcecan, 0, 0, tCanvas.width, tCanvas.height);
textureImage.onload();
}
Expand Down

0 comments on commit 71df9fe

Please sign in to comment.