Chromium Code Reviews

Unified Diff: samples/o3d-webgl/client.js

Issue 1092003: Fixed a lot of bugs with render surfaces and bitmaps. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « samples/o3d-webgl/buffer.js ('k') | samples/o3d-webgl/draw_list.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/o3d-webgl/client.js
===================================================================
--- samples/o3d-webgl/client.js (revision 41482)
+++ samples/o3d-webgl/client.js (working copy)
@@ -479,6 +479,14 @@
/**
+ * Whether content is displayed in full-screen mode or in a plugin window. The
+ * default is false [not full-screen].
+ * @type {!Array<function(!o3d.Event): void>}
+ */
+o3d.Client.prototype.event_callbacks_ = [];
+
+
+/**
* Returns the width of the current drawing area [plugin or full-screen] in
* pixels.
*/
@@ -518,7 +526,16 @@
*/
o3d.Client.prototype.initWithCanvas = function(canvas) {
var gl;
- try {gl = canvas.getContext("experimental-webgl") } catch(e) { }
+
+ var standard_attributes = {
+ alpha : true,
+ depth : true,
+ stencil : true,
+ antialias : true,
+ premultipliedAlpha : true
+ };
+
+ try {gl = canvas.getContext("experimental-webgl", standard_attributes) } catch(e) { }
if (!gl)
try {gl = canvas.getContext("moz-webgl") } catch(e) { }
if (!gl) {
@@ -526,7 +543,8 @@
return null;
}
- canvas.client.gl = gl;
+ this.gl = gl;
+
gl.client = this;
gl.displayInfo = {width: canvas.width,
height: canvas.height};
@@ -640,7 +658,7 @@
*/
o3d.Client.prototype.setEventCallback =
function(type, handler) {
- this.eventCallbacks[type] = handler;
+ this.event_callbacks_[type] = handler;
};
@@ -650,7 +668,7 @@
*/
o3d.Client.prototype.clearEventCallback =
function(type) {
- this.eventCallbacks[type] = null;
+ this.event_callbacks_[type] = null;
};
« no previous file with comments | « samples/o3d-webgl/buffer.js ('k') | samples/o3d-webgl/draw_list.js » ('j') | no next file with comments »

Powered by Google App Engine