List of usage examples for com.google.gwt.modernizr.client.utils CanvasElement getContext
public final native Object getContext(String ctxType) ;
From source file:com.google.gwt.modernizr.client.tests.Canvas.java
License:MIT License
@Override protected boolean runTest() { CanvasElement canvas = CanvasElement.create(); return canvas.getContext("2d") != null; }
From source file:com.google.gwt.modernizr.client.tests.Webgl.java
License:MIT License
@Override protected boolean runTest() { CanvasElement canvas = CanvasElement.create(); try {//from www. ja va 2s.c o m if (canvas.getContext("webgl") != null) { return true; } } catch (Exception e) { } try { if (canvas.getContext("experimental-webgl") != null) { return true; } } catch (Exception e) { } return false; }