code: public void setSize (int width, int height) {
      rootElement.getStyle().setWidth(width, Unit.PX);
      rootElement.getStyle().setHeight(height, Unit.PX);
      // the frame buffer may be larger (or smaller) than the logical size, depending on whether
      // we're on a HiDPI display, or how the game has configured things (maybe they're scaling down
      // from native resolution to improve performance)
      Scale fbScale = new Scale(frameBufferPixelRatio);
      canvas.setWidth(fbScale.scaledCeil(width));
      canvas.setHeight(fbScale.scaledCeil(height));
      // set the canvas's CSS size to the logical size; the browser works in logical pixels
      canvas.getStyle().setWidth(width, Style.Unit.PX);
      canvas.getStyle().setHeight(height, Style.Unit.PX);
      viewportChanged(canvas.getWidth(), canvas.getHeight());
    }
docs: Sizes or resizes the root element that contains the game view. This is specified in pixels as
  understood by page elements. If the page is actually being dispalyed on a HiDPI (Retina)
  device, the actual framebuffer may be 2x (or larger) the specified size.