Example usage for com.google.gwt.modernizr.client.utils CanvasElement create

List of usage examples for com.google.gwt.modernizr.client.utils CanvasElement create

Introduction

In this page you can find the example usage for com.google.gwt.modernizr.client.utils CanvasElement create.

Prototype

public static CanvasElement create() 

Source Link

Usage

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.CanvasText.java

License:MIT License

@Override
protected boolean runTest() {
    return Modernizr.canvas() && CanvasElement.create().isTextSupported();
}

From source file:com.google.gwt.modernizr.client.tests.Webgl.java

License:MIT License

@Override
protected boolean runTest() {
    CanvasElement canvas = CanvasElement.create();

    try {/* ww  w  .ja  va2 s  .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;
}