Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Unified Diff: LayoutTests/fast/canvas/webgl/resources/webgl-test-utils.js

Issue 10441002: Merge 117918 - Must set/reset pixel unpack alignment to 1 during texSubImage2D (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/canvas/webgl/resources/webgl-test-utils.js
===================================================================
--- LayoutTests/fast/canvas/webgl/resources/webgl-test-utils.js (revision 118258)
+++ LayoutTests/fast/canvas/webgl/resources/webgl-test-utils.js (working copy)
@@ -453,14 +453,19 @@
*/
var create3DContext = function(opt_canvas, opt_attributes) {
opt_canvas = opt_canvas || document.createElement("canvas");
+ if (typeof opt_canvas == 'string') {
+ opt_canvas = document.getElementById(opt_canvas);
+ }
var context = null;
- try {
- context = opt_canvas.getContext("webgl", opt_attributes);
- } catch(e) {}
- if (!context) {
+ var names = ["webgl", "experimental-webgl"];
+ for (var i = 0; i < names.length; ++i) {
try {
- context = opt_canvas.getContext("experimental-webgl", opt_attributes);
- } catch(e) {}
+ context = opt_canvas.getContext(names[i], opt_attributes);
+ } catch (e) {
+ }
+ if (context) {
+ break;
+ }
}
if (!context) {
testFailed("Unable to fetch WebGL rendering context for Canvas");

Powered by Google App Engine
This is Rietveld 408576698