CSC/ECE 517 Fall 2017/M1753 OffscreenCanvas API: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 17: Line 17:
'''Steps'''
'''Steps'''


1.Create the OffscreenCanvas and OffscreenCanvasRenderingContext2d interfaces.
* Create the OffscreenCanvas and OffscreenCanvasRenderingContext2d interfaces.
2. Hide the new interfaces by default and add a corresponding preference to enable the feature automated tests  
* Hide the new interfaces by default
3.add a __dir__.ini file to tests/wpt/metadata/offscreen-canvas which enables the new preference, then run the tests in that directory and update the expected test results.
* Enable the existing automated tests for this feature
implement the OffscreenCanvas constructor that creates a new canvas
* Implement the OffscreenCanvas constructor that creates a new canvas
implement the OffscreenCanvas.getContext ignoring the WebGL requirements, using HTMLCanvasElement.getContext for inspiration
* Implement the OffscreenCanvas.getContext ignoring the WebGL requirements


== '''Implementation''' ==
== '''Implementation''' ==

Revision as of 23:10, 22 October 2017

M1753 - Implement OffscreenCanvas API

The HTML specification defines a <canvas> element that can use a 2D or 3D rendering context. A new specification was recently developed that defines a canvas that can be used without being associated with an in-page canvas element, allowing for more efficient rendering.

Background Introduction

Servo[1] is a modern web browser engine designed to maximize the benefits of multi-core-based parallel processing. Written in the Rust language, servo was aimed for the application on Android and ARM processors, but now its applicable scope has expanded to Linux, Mac OS X, Windows, Android and Firefox OS (also known as Gonk) and other operating systems[2].


Rust[3] is a programming language that emphasizes security, concurrency and efficiency. The three keywords, safety, control of memory layout, and concurrency are the core features of rust, and also the primary factors that distinguish rust from other programming languages. Rust is developed on GitHub/Git [4], and every commit to the source code is documented by the version control system.


The OffscreenCanvas API supports a canvas to be rendered off screen. The performance of a webpage can be limited by using <canvas> since all of the javascript that manipulates the <canvas> has to run on the main thread, situation is not optimistic when the canvas operations are complex. The OffscreenCanvas API provides a way to interact with the same canvas APIs but in a different thread. This allows rendering to progress no matter what is going on in the main thread [5].

Project Description

Implement the OffscreenCanvas API: Servo has an implementation of the HTML Canvas API. Our project is to implement the OffscreenCanvas API which provides a canvas that can be rendered off screen and is available in both the window and worker contexts.


Steps

  • Create the OffscreenCanvas and OffscreenCanvasRenderingContext2d interfaces.
  • Hide the new interfaces by default
  • Enable the existing automated tests for this feature
  • Implement the OffscreenCanvas constructor that creates a new canvas
  • Implement the OffscreenCanvas.getContext ignoring the WebGL requirements

Implementation

Testing Details

Pull Request

Future Work

References