summaryrefslogtreecommitdiffstats
path: root/o3d/samples/o3d-webgl/bitmap.js
diff options
context:
space:
mode:
authorpetersont@google.com <petersont@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-22 23:03:47 +0000
committerpetersont@google.com <petersont@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-22 23:03:47 +0000
commite05040ff4032c43e6feb09c5810d84a149464b8e (patch)
tree5698e53fd4a5b9791026b3b6b0143e54e839950c /o3d/samples/o3d-webgl/bitmap.js
parent2e39f625a1e09e2a1b29bb90e3a4aa1fee5829b1 (diff)
downloadchromium_src-e05040ff4032c43e6feb09c5810d84a149464b8e.zip
chromium_src-e05040ff4032c43e6feb09c5810d84a149464b8e.tar.gz
chromium_src-e05040ff4032c43e6feb09c5810d84a149464b8e.tar.bz2
Implemented Texture2D.drawImage, along the way cleaned up a number of lingering bugs, moved some texture initialization so subsequent calls to gl.texSubImage2D wouldn't fail.
Review URL: http://codereview.chromium.org/1092003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42277 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/samples/o3d-webgl/bitmap.js')
-rw-r--r--o3d/samples/o3d-webgl/bitmap.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/o3d/samples/o3d-webgl/bitmap.js b/o3d/samples/o3d-webgl/bitmap.js
index 5e2fcfc..9551051 100644
--- a/o3d/samples/o3d-webgl/bitmap.js
+++ b/o3d/samples/o3d-webgl/bitmap.js
@@ -74,6 +74,24 @@ o3d.Bitmap.SLICE = 7;
/**
+ * The scratch canvas object.
+ * @private
+ */
+o3d.Bitmap.scratch_canvas_ = null;
+
+
+/**
+ * Gets a canvas to use for scratch work.
+ * @private
+ */
+o3d.Bitmap.getScratchCanvas_ = function() {
+ if (!o3d.Bitmap.scratch_canvas_)
+ o3d.Bitmap.scratch_canvas_ = document.createElement('CANVAS');
+ return o3d.Bitmap.scratch_canvas_;
+}
+
+
+/**
* In webgl the bitmap object is represented by an offscreen canvas.
* @type {Canvas}
* @private
@@ -89,6 +107,7 @@ o3d.Bitmap.prototype.flipVertically = function() {
};
+
/**
* Generates mip maps from the source level to lower levels.
*