<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Djain2</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Djain2"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Djain2"/>
	<updated>2026-05-17T14:28:12Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100042</id>
		<title>CSC/ECE 517 Fall 2015/M1506-Refactor-GLES2-Implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100042"/>
		<updated>2015-12-04T01:13:05Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
===Setup of Development environment===&lt;br /&gt;
&lt;br /&gt;
* Servo can be built and compiled in the following steps:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* Next, we need a cargo override for servo to use our local copy of Rust-layers. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
&lt;br /&gt;
===Overview===&lt;br /&gt;
* After building servo and rust-layers successfully, we added a new command line argument in Servo, which would allow user to select the graphics backend (GL or ES2).&lt;br /&gt;
&lt;br /&gt;
Example is as below&lt;br /&gt;
    ./mach run [url] -G GL or ./mach run [url] --graphics GL (for GL)&lt;br /&gt;
    ./mach run [url] -G ES2 or ./mach run [url] --graphics ES2 (for ES2)&lt;br /&gt;
&lt;br /&gt;
* This option selected is passed onto the rust-layers, which is modified to support ES2 for both linux and android versions. Hence, based on the option selected by the user, rust-layers renders the corresponding graphic backend on linux and android targets.To achieve this, the main changes are done in the platform to remove the EGL specific implementation from the Android platform to a more generic one, so that it can be used by both android and linux systems.&lt;br /&gt;
&lt;br /&gt;
=='''Requirement Analysis'''==&lt;br /&gt;
&lt;br /&gt;
Earlier, only [https://en.wikipedia.org/wiki/OpenGL OpenGL] implementation was supported for Android targets and we would be extending the [https://en.wikipedia.org/wiki/OpenGL_ES#2.0 ES2] implementation to support it for Linux targets. &lt;br /&gt;
&lt;br /&gt;
===Initial step===&lt;br /&gt;
&lt;br /&gt;
Our [https://github.com/servo/servo/wiki/Refactor-GLES2-student-project initial step], implemented for the OSS project involved:&lt;br /&gt;
* compile Servo and ensure that it runs on tests/html/about-mozilla.html&lt;br /&gt;
* adding a new command-line option to allow selecting the graphics backend (GL or ES2) in &amp;lt;code&amp;gt;components/utils/opts.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
* clone rust-layers and build it independently of Servo&lt;br /&gt;
* adding a Cargo override for Servo to use the local copy of rust-layers&lt;br /&gt;
&lt;br /&gt;
===Final Requirements===&lt;br /&gt;
&lt;br /&gt;
* Enable selection of the render api working from the command line, so the user can pick whether to use GL or ES2&lt;br /&gt;
* Modify the necessary files so that the current display version of GL or ES2 are returned whenever either of them are selected&lt;br /&gt;
* Make the EGL libs available on Linux apart from android, for rust-layers to compile rust-egl on Linux build.&lt;br /&gt;
* Separate out the EGLImageNativeSurface implementation from Android and move it to EGL&lt;br /&gt;
* Enable use of EGL or GLX for Linux.&lt;br /&gt;
* In conclusion, implement a generic way of supporting EGL for both Linux and Android, such that ES2 is rendered as a display on linux targets as well.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
  Servo/components/utils/opts.rs&lt;br /&gt;
added the new command line option to enable user to select the option of GL or ES2 as the rendering backend. The options of GL or ES2 are stored as an enum called RenderApi , such that running the Servo with option --render-api=chosen_option sets the corresponding Api.&lt;br /&gt;
&lt;br /&gt;
  Servo/ports/glutin/window.rs&lt;br /&gt;
&amp;lt;code&amp;gt;gl_version()&amp;lt;/code&amp;gt; function is modified in a way that based on what is selected as the RenderApi option by the user, the corresponding version of the Api is set. To talk more in detail, if the render api is set to GL, it returns the current value (GL 2.1) &amp;amp; if set to ES2, it returns OpenGlEs 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;native_display()&amp;lt;/code&amp;gt; for linux target is also modified to call the specific NativeDisplay constructor based on the RenderApi option chosen by the user. Hence for the GL case, the existing NativeDisplay::new constructor is called, but if ES2 is selected, NativeDisplay::from_es2() is called, which has been introduced by us in an attempt to support ES2 for the linux platform as well.&lt;br /&gt;
&lt;br /&gt;
===Rust-Layers===&lt;br /&gt;
&lt;br /&gt;
  rust-layers/cargo.toml&lt;br /&gt;
In order to make the egl libraries available to the Linux too, the cargo.toml is edited which defines the different dependencies that various platforms has. Before, the dependency on rust-egl was added only for android targets but now these dependencies have been added for Linux targets as well.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/egl/surface.rs&lt;br /&gt;
In order to support EGL for both linux and android targets, we moved the implementation of &amp;lt;code&amp;gt;EGLImageNativeSurface&amp;lt;/code&amp;gt; from the android specific &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and introduced a new folder &amp;lt;code&amp;gt;egl&amp;lt;/code&amp;gt; which contains its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and implements a generic &amp;lt;code&amp;gt;EGLImageNativeSurface &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/lib.rs&lt;br /&gt;
Since egl needs to be supported for linux too now, the extern crate egl call needs to be linked on Linux as well now. Hence in the cfg flag, the target_os=&amp;quot;linux&amp;quot; is added in addition to android.&lt;br /&gt;
&lt;br /&gt;
In the pub mod platform { }, introduced a new pub mod egl {} section to pull in the new &amp;lt;code&amp;gt;egl/surface.rs&amp;lt;/code&amp;gt; implemented for both android and linux targets.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/linux/surface.rs&lt;br /&gt;
In order to ensure that ES2 is supported for linux targets too, we need to enable the use of EGL &amp;amp; GLX in the linux specific &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
A new enum is created for NativeDisplay which has two different values of &amp;lt;code&amp;gt;EGLDisplayInfo&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;GlxDisplayInfo&amp;lt;/code&amp;gt; and respectively, two constructors are created . The existing NativeDisplay::new constructor is modified to return &amp;lt;code&amp;gt;NativeDisplay::Glx(info)&amp;lt;/code&amp;gt; for the GL version , and the NativeDisplay::from_es2() constructor introduced earlier can return &amp;lt;code&amp;gt;NativeDisplay::::Egl(egl_info)&amp;lt;/code&amp;gt; for the ES2 version.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/surface.rs&lt;br /&gt;
Earlier, the android target was using its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and the linux target was using its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt;. But after the implementation of &amp;lt;code&amp;gt;egl/surface.rs&amp;lt;/code&amp;gt;, changes were made to platform &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; which uses the egl surface.rs for both android and linux now.&lt;br /&gt;
&lt;br /&gt;
=='''Design Principles'''==&lt;br /&gt;
&lt;br /&gt;
We are adhering to the following design principles for our implementation:&lt;br /&gt;
&lt;br /&gt;
'''Open-Closed Principle'''&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Open/closed_principle&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although our task is to modify the egl implementation to support it for linux targets too, we are not modifying the existing functionality of the android platform, instead we have extended the egl implementation to provide support for linux as well.&lt;br /&gt;
&lt;br /&gt;
'''Interface Segregation Principle'''&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Interface_segregation_principle&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The existing code currently has specific platform implementations for android and linux, and egl implementation is provided in android. We have extended the egl implementation to a more generic platform surface and divided the functionality for the native display into two small methods such that these methods can be individually called for whichever graphic backend option is chosen. This avoids the need to call the bigger functionality.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
The aim is to use ES2 implementation of rust layers for both android and Linux. So we need to use a design pattern that will allow us to extend the current implementation to support Linux targets too and give the user the flexibility to choose between the two implementations for rendering the backend.&lt;br /&gt;
&lt;br /&gt;
We propose to use [https://en.wikipedia.org/wiki/Decorator_pattern Decorator] pattern. The decorator pattern gives the user the ability to choose between the implementations that are desired, and attach the corresponding implementation to the target dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
==Flowchart describing Project Implementation==&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:RefactorGLESMozilla.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
==Class Diagram==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Class_diagram_Mozilla_1506.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
Some of the test cases which will be used to validate our changes are as follows:&lt;br /&gt;
* Printing the command line option selected by the user in the &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;.This ensures if the command line option selected is correctly passed onto the servo.&lt;br /&gt;
  println!(&amp;quot;selected {:?}&amp;quot;, opts.render_api);&lt;br /&gt;
* Printing the command line option selected by the user in the &amp;lt;code&amp;gt;window.rs&amp;lt;/code&amp;gt;.This ensures if the command line option selected is correctly propagated from the servo to the rust-layers.&lt;br /&gt;
* Test if the rust-egl compiles for the linux surface. A successful compilation ensures egl libraries are made available on Linux for rust-layers.&lt;br /&gt;
* Test if selecting an option ES2 though command line on a linux surface, renders a graphic display of ES2.&lt;br /&gt;
&lt;br /&gt;
== Video ==&lt;br /&gt;
A walkthrough of our entire project is available on this link: [https://www.youtube.com/watch?v=rq8MvpR1JyI Final Project Walkthrough]&lt;br /&gt;
&lt;br /&gt;
=='''Useful libraries'''==&lt;br /&gt;
&lt;br /&gt;
waffle-gl/waffle: A C library for selecting an OpenGL API and window system at runtime.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100041</id>
		<title>CSC/ECE 517 Fall 2015/M1506-Refactor-GLES2-Implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100041"/>
		<updated>2015-12-04T00:54:09Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
===Setup of Development environment===&lt;br /&gt;
&lt;br /&gt;
* Servo can be built and compiled in the following steps:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* Next, we need a cargo override for servo to use our local copy of Rust-layers. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
&lt;br /&gt;
===Overview===&lt;br /&gt;
* After building servo and rust-layers successfully, we added a new command line argument in Servo, which would allow user to select the graphics backend (GL or ES2).&lt;br /&gt;
&lt;br /&gt;
Example is as below&lt;br /&gt;
    ./mach run [url] -G GL or ./mach run [url] --graphics GL (for GL)&lt;br /&gt;
    ./mach run [url] -G ES2 or ./mach run [url] --graphics ES2 (for ES2)&lt;br /&gt;
&lt;br /&gt;
* This option selected is passed onto the rust-layers, which is modified to support ES2 for both linux and android versions. Hence, based on the option selected by the user, rust-layers renders the corresponding graphic backend on linux and android targets.To achieve this, the main changes are done in the platform to remove the EGL specific implementation from the Android platform to a more generic one, so that it can be used by both android and linux systems.&lt;br /&gt;
&lt;br /&gt;
=='''Requirement Analysis'''==&lt;br /&gt;
&lt;br /&gt;
Earlier, only [https://en.wikipedia.org/wiki/OpenGL OpenGL] implementation was supported for Android targets and we would be extending the [https://en.wikipedia.org/wiki/OpenGL_ES#2.0 ES2] implementation to support it for Linux targets. &lt;br /&gt;
&lt;br /&gt;
===Initial step===&lt;br /&gt;
&lt;br /&gt;
Our [https://github.com/servo/servo/wiki/Refactor-GLES2-student-project initial step], implemented for the OSS project involved:&lt;br /&gt;
* compile Servo and ensure that it runs on tests/html/about-mozilla.html&lt;br /&gt;
* adding a new command-line option to allow selecting the graphics backend (GL or ES2) in &amp;lt;code&amp;gt;components/utils/opts.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
* clone rust-layers and build it independently of Servo&lt;br /&gt;
* adding a Cargo override for Servo to use the local copy of rust-layers&lt;br /&gt;
&lt;br /&gt;
===Final Requirements===&lt;br /&gt;
&lt;br /&gt;
* Enable selection of the render api working from the command line, so the user can pick whether to use GL or ES2&lt;br /&gt;
* Modify the necessary files so that the current display version of GL or ES2 are returned whenever either of them are selected&lt;br /&gt;
* Make the EGL libs available on Linux apart from android, for rust-layers to compile rust-egl on Linux build.&lt;br /&gt;
* Separate out the EGLImageNativeSurface implementation from Android and move it to EGL&lt;br /&gt;
* Enable use of EGL or GLX for Linux.&lt;br /&gt;
* In conclusion, implement a generic way of supporting EGL for both Linux and Android, such that ES2 is rendered as a display on linux targets as well.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
  Servo/components/utils/opts.rs&lt;br /&gt;
added the new command line option to enable user to select the option of GL or ES2 as the rendering backend. The options of GL or ES2 are stored as an enum called RenderApi , such that running the Servo with option --render-api=chosen_option sets the corresponding Api.&lt;br /&gt;
&lt;br /&gt;
  Servo/ports/glutin/window.rs&lt;br /&gt;
&amp;lt;code&amp;gt;gl_version()&amp;lt;/code&amp;gt; function is modified in a way that based on what is selected as the RenderApi option by the user, the corresponding version of the Api is set. To talk more in detail, if the render api is set to GL, it returns the current value (GL 2.1) &amp;amp; if set to ES2, it returns OpenGlEs 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;native_display()&amp;lt;/code&amp;gt; for linux target is also modified to call the specific NativeDisplay constructor based on the RenderApi option chosen by the user. Hence for the GL case, the existing NativeDisplay::new constructor is called, but if ES2 is selected, NativeDisplay::from_es2() is called, which has been introduced by us in an attempt to support ES2 for the linux platform as well.&lt;br /&gt;
&lt;br /&gt;
===Rust-Layers===&lt;br /&gt;
&lt;br /&gt;
  rust-layers/cargo.toml&lt;br /&gt;
In order to make the egl libraries available to the Linux too, the cargo.toml is edited which defines the different dependencies that various platforms has. Before, the dependency on rust-egl was added only for android targets but now these dependencies have been added for Linux targets as well.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/egl/surface.rs&lt;br /&gt;
In order to support EGL for both linux and android targets, we moved the implementation of &amp;lt;code&amp;gt;EGLImageNativeSurface&amp;lt;/code&amp;gt; from the android specific &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and introduced a new folder &amp;lt;code&amp;gt;egl&amp;lt;/code&amp;gt; which contains its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and implements a generic &amp;lt;code&amp;gt;EGLImageNativeSurface &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/lib.rs&lt;br /&gt;
Since egl needs to be supported for linux too now, the extern crate egl call needs to be linked on Linux as well now. Hence in the cfg flag, the target_os=&amp;quot;linux&amp;quot; is added in addition to android.&lt;br /&gt;
&lt;br /&gt;
In the pub mod platform { }, introduced a new pub mod egl {} section to pull in the new &amp;lt;code&amp;gt;egl/surface.rs&amp;lt;/code&amp;gt; implemented for both android and linux targets.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/linux/surface.rs&lt;br /&gt;
In order to ensure that ES2 is supported for linux targets too, we need to enable the use of EGL &amp;amp; GLX in the linux specific &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
A new enum is created for NativeDisplay which has two different values of &amp;lt;code&amp;gt;EGLDisplayInfo&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;GlxDisplayInfo&amp;lt;/code&amp;gt; and respectively, two constructors are created . The existing NativeDisplay::new constructor is modified to return &amp;lt;code&amp;gt;NativeDisplay::Glx(info)&amp;lt;/code&amp;gt; for the GL version , and the NativeDisplay::from_es2() constructor introduced earlier can return &amp;lt;code&amp;gt;NativeDisplay::::Egl(egl_info)&amp;lt;/code&amp;gt; for the ES2 version.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/surface.rs&lt;br /&gt;
Earlier, the android target was using its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and the linux target was using its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt;. But after the implementation of &amp;lt;code&amp;gt;egl/surface.rs&amp;lt;/code&amp;gt;, changes were made to platform &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; which uses the egl surface.rs for both android and linux now.&lt;br /&gt;
&lt;br /&gt;
=='''Design Principles'''==&lt;br /&gt;
&lt;br /&gt;
We are adhering to the following design principles for our implementation:&lt;br /&gt;
&lt;br /&gt;
'''Open-Closed Principle'''&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Open/closed_principle&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although our task is to modify the egl implementation to support it for linux targets too, we are not modifying the existing functionality of the android platform, instead we have extended the egl implementation to provide support for linux as well.&lt;br /&gt;
&lt;br /&gt;
'''Interface Segregation Principle'''&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Interface_segregation_principle&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The existing code currently has specific platform implementations for android and linux, and egl implementation is provided in android. We have extended the egl implementation to a more generic platform surface and divided the functionality for the native display into two small methods such that these methods can be individually called for whichever graphic backend option is chosen. This avoids the need to call the bigger functionality.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
The aim is to use ES2 implementation of rust layers for both android and Linux. So we need to use a design pattern that will allow us to extend the current implementation to support Linux targets too and give the user the flexibility to choose between the two implementations for rendering the backend.&lt;br /&gt;
&lt;br /&gt;
We propose to use [https://en.wikipedia.org/wiki/Decorator_pattern Decorator] pattern. The decorator pattern gives the user the ability to choose between the implementations that are desired, and attach the corresponding implementation to the target dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
==Flowchart describing Project Implementation==&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:RefactorGLESMozilla.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
==Class Diagram==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Class_diagram_Mozilla_1506.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:RefactorGLESMozilla.png&amp;diff=100040</id>
		<title>File:RefactorGLESMozilla.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:RefactorGLESMozilla.png&amp;diff=100040"/>
		<updated>2015-12-04T00:31:24Z</updated>

		<summary type="html">&lt;p&gt;Djain2: uploaded a new version of &amp;amp;quot;File:RefactorGLESMozilla.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100039</id>
		<title>CSC/ECE 517 Fall 2015/M1506-Refactor-GLES2-Implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100039"/>
		<updated>2015-12-04T00:17:49Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
===Setup of Development environment===&lt;br /&gt;
&lt;br /&gt;
* Servo can be built and compiled in the following steps:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* Next, we need a cargo override for servo to use our local copy of Rust-layers. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
&lt;br /&gt;
===Overview===&lt;br /&gt;
* After building servo and rust-layers successfully, we added a new command line argument in Servo, which would allow user to select the graphics backend (GL or ES2).&lt;br /&gt;
&lt;br /&gt;
Example is as below&lt;br /&gt;
    ./mach run [url] -G GL or ./mach run [url] --graphics GL (for GL)&lt;br /&gt;
    ./mach run [url] -G ES2 or ./mach run [url] --graphics ES2 (for ES2)&lt;br /&gt;
&lt;br /&gt;
* This option selected is passed onto the rust-layers, which is modified to support ES2 for both linux and android versions. Hence, based on the option selected by the user, rust-layers renders the corresponding graphic backend on linux and android targets.To achieve this, the main changes are done in the platform to remove the EGL specific implementation from the Android platform to a more generic one, so that it can be used by both android and linux systems.&lt;br /&gt;
&lt;br /&gt;
=='''Requirement Analysis'''==&lt;br /&gt;
&lt;br /&gt;
Earlier, only [https://en.wikipedia.org/wiki/OpenGL OpenGL] implementation was supported for Android targets and we would be extending the [https://en.wikipedia.org/wiki/OpenGL_ES#2.0 ES2] implementation to support it for Linux targets. &lt;br /&gt;
&lt;br /&gt;
===Initial step===&lt;br /&gt;
&lt;br /&gt;
Our [https://github.com/servo/servo/wiki/Refactor-GLES2-student-project initial step], implemented for the OSS project involved:&lt;br /&gt;
* compile Servo and ensure that it runs on tests/html/about-mozilla.html&lt;br /&gt;
* adding a new command-line option to allow selecting the graphics backend (GL or ES2) in &amp;lt;code&amp;gt;components/utils/opts.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
* clone rust-layers and build it independently of Servo&lt;br /&gt;
* adding a Cargo override for Servo to use the local copy of rust-layers&lt;br /&gt;
&lt;br /&gt;
===Final Requirements===&lt;br /&gt;
&lt;br /&gt;
* Enable selection of the render api working from the command line, so the user can pick whether to use GL or ES2&lt;br /&gt;
* Modify the necessary files so that the current display version of GL or ES2 are returned whenever either of them are selected&lt;br /&gt;
* Make the EGL libs available on Linux apart from android, for rust-layers to compile rust-egl on Linux build.&lt;br /&gt;
* Separate out the EGLImageNativeSurface implementation from Android and move it to EGL&lt;br /&gt;
* Enable use of EGL or GLX for Linux.&lt;br /&gt;
* In conclusion, implement a generic way of supporting EGL for both Linux and Android, such that ES2 is rendered as a display on linux targets as well.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
  Servo/components/utils/opts.rs&lt;br /&gt;
added the new command line option to enable user to select the option of GL or ES2 as the rendering backend. The options of GL or ES2 are stored as an enum called RenderApi , such that running the Servo with option --render-api=chosen_option sets the corresponding Api.&lt;br /&gt;
&lt;br /&gt;
  Servo/ports/glutin/window.rs&lt;br /&gt;
&amp;lt;code&amp;gt;gl_version()&amp;lt;/code&amp;gt; function is modified in a way that based on what is selected as the RenderApi option by the user, the corresponding version of the Api is set. To talk more in detail, if the render api is set to GL, it returns the current value (GL 2.1) &amp;amp; if set to ES2, it returns OpenGlEs 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;native_display()&amp;lt;/code&amp;gt; for linux target is also modified to call the specific NativeDisplay constructor based on the RenderApi option chosen by the user. Hence for the GL case, the existing NativeDisplay::new constructor is called, but if ES2 is selected, NativeDisplay::from_es2() is called, which has been introduced by us in an attempt to support ES2 for the linux platform as well.&lt;br /&gt;
&lt;br /&gt;
===Rust-Layers===&lt;br /&gt;
&lt;br /&gt;
  rust-layers/cargo.toml&lt;br /&gt;
In order to make the egl libraries available to the Linux too, the cargo.toml is edited which defines the different dependencies that various platforms has. Before, the dependency on rust-egl was added only for android targets but now these dependencies have been added for Linux targets as well.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/egl/surface.rs&lt;br /&gt;
In order to support EGL for both linux and android targets, we moved the implementation of &amp;lt;code&amp;gt;EGLImageNativeSurface&amp;lt;/code&amp;gt; from the android specific &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and introduced a new folder &amp;lt;code&amp;gt;egl&amp;lt;/code&amp;gt; which contains its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and implements a generic &amp;lt;code&amp;gt;EGLImageNativeSurface &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/lib.rs&lt;br /&gt;
Since egl needs to be supported for linux too now, the extern crate egl call needs to be linked on Linux as well now. Hence in the cfg flag, the target_os=&amp;quot;linux&amp;quot; is added in addition to android.&lt;br /&gt;
&lt;br /&gt;
In the pub mod platform { }, introduced a new pub mod egl {} section to pull in the new &amp;lt;code&amp;gt;egl/surface.rs&amp;lt;/code&amp;gt; implemented for both android and linux targets.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/linux/surface.rs&lt;br /&gt;
In order to ensure that ES2 is supported for linux targets too, we need to enable the use of EGL &amp;amp; GLX in the linux specific &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
A new enum is created for NativeDisplay which has two different values of &amp;lt;code&amp;gt;EGLDisplayInfo&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;GlxDisplayInfo&amp;lt;/code&amp;gt; and respectively, two constructors are created . The existing NativeDisplay::new constructor is modified to return &amp;lt;code&amp;gt;NativeDisplay::Glx(info)&amp;lt;/code&amp;gt; for the GL version , and the NativeDisplay::from_es2() constructor introduced earlier can return &amp;lt;code&amp;gt;NativeDisplay::::Egl(egl_info)&amp;lt;/code&amp;gt; for the ES2 version.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/surface.rs&lt;br /&gt;
Earlier, the android target was using its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and the linux target was using its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt;. But after the implementation of &amp;lt;code&amp;gt;egl/surface.rs&amp;lt;/code&amp;gt;, changes were made to platform &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; which uses the egl surface.rs for both android and linux now.&lt;br /&gt;
&lt;br /&gt;
=='''Useful libraries'''==&lt;br /&gt;
&lt;br /&gt;
waffle-gl/waffle: A C library for selecting an OpenGL API and window system at runtime.&lt;br /&gt;
&lt;br /&gt;
=='''Design Principles'''==&lt;br /&gt;
&lt;br /&gt;
We are adhering to the following design principles for our implementation:&lt;br /&gt;
&lt;br /&gt;
'''Open-Closed Principle'''&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Open/closed_principle&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although our task is to modify the egl implementation to support it for linux targets too, we are not modifying the existing functionality of the android platform, instead we have extended the egl implementation to provide support for linux as well.&lt;br /&gt;
&lt;br /&gt;
'''Interface Segregation Principle'''&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Interface_segregation_principle&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The existing code currently has specific platform implementations for android and linux, and egl implementation is provided in android. We have extended the egl implementation to a more generic platform surface and divided the functionality for the native display into two small methods such that these methods can be individually called for whichever graphic backend option is chosen. This avoids the need to call the bigger functionality.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
The aim is to use ES2 implementation of rust layers for both android and Linux. So we need to use a design pattern that will allow us to extend the current implementation to support Linux targets too and give the user the flexibility to choose between the two implementations for rendering the backend.&lt;br /&gt;
&lt;br /&gt;
We propose to use [https://en.wikipedia.org/wiki/Decorator_pattern Decorator] pattern. The decorator pattern gives the user the ability to choose between the implementations that are desired, and attach the corresponding implementation to the target dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
==Flowchart describing Project Implementation==&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:RefactorGLESMozilla.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
==Class Diagram==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Class_diagram_Mozilla_1506.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Class_diagram_Mozilla_1506.png&amp;diff=100038</id>
		<title>File:Class diagram Mozilla 1506.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Class_diagram_Mozilla_1506.png&amp;diff=100038"/>
		<updated>2015-12-04T00:15:29Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100037</id>
		<title>CSC/ECE 517 Fall 2015/M1506-Refactor-GLES2-Implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100037"/>
		<updated>2015-12-04T00:14:07Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
===Setup of Development environment===&lt;br /&gt;
&lt;br /&gt;
* Servo can be built and compiled in the following steps:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* Next, we need a cargo override for servo to use our local copy of Rust-layers. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
&lt;br /&gt;
===Overview===&lt;br /&gt;
* After building servo and rust-layers successfully, we added a new command line argument in Servo, which would allow user to select the graphics backend (GL or ES2).&lt;br /&gt;
&lt;br /&gt;
Example is as below&lt;br /&gt;
    ./mach run [url] -G GL or ./mach run [url] --graphics GL (for GL)&lt;br /&gt;
    ./mach run [url] -G ES2 or ./mach run [url] --graphics ES2 (for ES2)&lt;br /&gt;
&lt;br /&gt;
* This option selected is passed onto the rust-layers, which is modified to support ES2 for both linux and android versions. Hence, based on the option selected by the user, rust-layers renders the corresponding graphic backend on linux and android targets.To achieve this, the main changes are done in the platform to remove the EGL specific implementation from the Android platform to a more generic one, so that it can be used by both android and linux systems.&lt;br /&gt;
&lt;br /&gt;
=='''Requirement Analysis'''==&lt;br /&gt;
&lt;br /&gt;
Earlier, only [https://en.wikipedia.org/wiki/OpenGL OpenGL] implementation was supported for Android targets and we would be extending the [https://en.wikipedia.org/wiki/OpenGL_ES#2.0 ES2] implementation to support it for Linux targets. &lt;br /&gt;
&lt;br /&gt;
===Initial step===&lt;br /&gt;
&lt;br /&gt;
Our [https://github.com/servo/servo/wiki/Refactor-GLES2-student-project initial step], implemented for the OSS project involved:&lt;br /&gt;
* compile Servo and ensure that it runs on tests/html/about-mozilla.html&lt;br /&gt;
* adding a new command-line option to allow selecting the graphics backend (GL or ES2) in &amp;lt;code&amp;gt;components/utils/opts.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
* clone rust-layers and build it independently of Servo&lt;br /&gt;
* adding a Cargo override for Servo to use the local copy of rust-layers&lt;br /&gt;
&lt;br /&gt;
===Final Requirements===&lt;br /&gt;
&lt;br /&gt;
* Enable selection of the render api working from the command line, so the user can pick whether to use GL or ES2&lt;br /&gt;
* Modify the necessary files so that the current display version of GL or ES2 are returned whenever either of them are selected&lt;br /&gt;
* Make the EGL libs available on Linux apart from android, for rust-layers to compile rust-egl on Linux build.&lt;br /&gt;
* Separate out the EGLImageNativeSurface implementation from Android and move it to EGL&lt;br /&gt;
* Enable use of EGL or GLX for Linux.&lt;br /&gt;
* In conclusion, implement a generic way of supporting EGL for both Linux and Android, such that ES2 is rendered as a display on linux targets as well.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
  Servo/components/utils/opts.rs&lt;br /&gt;
added the new command line option to enable user to select the option of GL or ES2 as the rendering backend. The options of GL or ES2 are stored as an enum called RenderApi , such that running the Servo with option --render-api=chosen_option sets the corresponding Api.&lt;br /&gt;
&lt;br /&gt;
  Servo/ports/glutin/window.rs&lt;br /&gt;
&amp;lt;code&amp;gt;gl_version()&amp;lt;/code&amp;gt; function is modified in a way that based on what is selected as the RenderApi option by the user, the corresponding version of the Api is set. To talk more in detail, if the render api is set to GL, it returns the current value (GL 2.1) &amp;amp; if set to ES2, it returns OpenGlEs 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;native_display()&amp;lt;/code&amp;gt; for linux target is also modified to call the specific NativeDisplay constructor based on the RenderApi option chosen by the user. Hence for the GL case, the existing NativeDisplay::new constructor is called, but if ES2 is selected, NativeDisplay::from_es2() is called, which has been introduced by us in an attempt to support ES2 for the linux platform as well.&lt;br /&gt;
&lt;br /&gt;
===Rust-Layers===&lt;br /&gt;
&lt;br /&gt;
  rust-layers/cargo.toml&lt;br /&gt;
In order to make the egl libraries available to the Linux too, the cargo.toml is edited which defines the different dependencies that various platforms has. Before, the dependency on rust-egl was added only for android targets but now these dependencies have been added for Linux targets as well.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/egl/surface.rs&lt;br /&gt;
In order to support EGL for both linux and android targets, we moved the implementation of &amp;lt;code&amp;gt;EGLImageNativeSurface&amp;lt;/code&amp;gt; from the android specific &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and introduced a new folder &amp;lt;code&amp;gt;egl&amp;lt;/code&amp;gt; which contains its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and implements a generic &amp;lt;code&amp;gt;EGLImageNativeSurface &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/lib.rs&lt;br /&gt;
Since egl needs to be supported for linux too now, the extern crate egl call needs to be linked on Linux as well now. Hence in the cfg flag, the target_os=&amp;quot;linux&amp;quot; is added in addition to android.&lt;br /&gt;
&lt;br /&gt;
In the pub mod platform { }, introduced a new pub mod egl {} section to pull in the new &amp;lt;code&amp;gt;egl/surface.rs&amp;lt;/code&amp;gt; implemented for both android and linux targets.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/linux/surface.rs&lt;br /&gt;
In order to ensure that ES2 is supported for linux targets too, we need to enable the use of EGL &amp;amp; GLX in the linux specific &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
A new enum is created for NativeDisplay which has two different values of &amp;lt;code&amp;gt;EGLDisplayInfo&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;GlxDisplayInfo&amp;lt;/code&amp;gt; and respectively, two constructors are created . The existing NativeDisplay::new constructor is modified to return &amp;lt;code&amp;gt;NativeDisplay::Glx(info)&amp;lt;/code&amp;gt; for the GL version , and the NativeDisplay::from_es2() constructor introduced earlier can return &amp;lt;code&amp;gt;NativeDisplay::::Egl(egl_info)&amp;lt;/code&amp;gt; for the ES2 version.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/surface.rs&lt;br /&gt;
Earlier, the android target was using its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and the linux target was using its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt;. But after the implementation of &amp;lt;code&amp;gt;egl/surface.rs&amp;lt;/code&amp;gt;, changes were made to platform &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; which uses the egl surface.rs for both android and linux now.&lt;br /&gt;
&lt;br /&gt;
=='''Useful libraries'''==&lt;br /&gt;
&lt;br /&gt;
waffle-gl/waffle: A C library for selecting an OpenGL API and window system at runtime.&lt;br /&gt;
&lt;br /&gt;
=='''Design Principles'''==&lt;br /&gt;
&lt;br /&gt;
We are adhering to the following design principles for our implementation:&lt;br /&gt;
&lt;br /&gt;
'''Open-Closed Principle'''&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Open/closed_principle&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although our task is to modify the egl implementation to support it for linux targets too, we are not modifying the existing functionality of the android platform, instead we have extended the egl implementation to provide support for linux as well.&lt;br /&gt;
&lt;br /&gt;
'''Interface Segregation Principle'''&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Interface_segregation_principle&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The existing code currently has specific platform implementations for android and linux, and egl implementation is provided in android. We have extended the egl implementation to a more generic platform surface and divided the functionality for the native display into two small methods such that these methods can be individually called for whichever graphic backend option is chosen. This avoids the need to call the bigger functionality.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
The aim is to use ES2 implementation of rust layers for both android and Linux. So we need to use a design pattern that will allow us to extend the current implementation to support Linux targets too and give the user the flexibility to choose between the two implementations for rendering the backend.&lt;br /&gt;
&lt;br /&gt;
We propose to use [https://en.wikipedia.org/wiki/Decorator_pattern Decorator] pattern. The decorator pattern gives the user the ability to choose between the implementations that are desired, and attach the corresponding implementation to the target dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
==Flowchart describing Project Implementation==&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:RefactorGLESMozilla.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
==Class Diagram==&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100036</id>
		<title>CSC/ECE 517 Fall 2015/M1506-Refactor-GLES2-Implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100036"/>
		<updated>2015-12-03T23:36:20Z</updated>

		<summary type="html">&lt;p&gt;Djain2: /* Requirement Analysis */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
===Setup of Development environment===&lt;br /&gt;
&lt;br /&gt;
* Servo can be built and compiled in the following steps:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* Next, we need a cargo override for servo to use our local copy of Rust-layers. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
&lt;br /&gt;
===Overview===&lt;br /&gt;
* After building servo and rust-layers successfully, we added a new command line argument in Servo, which would allow user to select the graphics backend (GL or ES2).&lt;br /&gt;
&lt;br /&gt;
Example is as below&lt;br /&gt;
    ./mach run [url] -G GL or ./mach run [url] --graphics GL (for GL)&lt;br /&gt;
    ./mach run [url] -G ES2 or ./mach run [url] --graphics ES2 (for ES2)&lt;br /&gt;
&lt;br /&gt;
* This option selected is passed onto the rust-layers, which is modified to support ES2 for both linux and android versions. Hence, based on the option selected by the user, rust-layers renders the corresponding graphic backend on linux and android targets.To achieve this, the main changes are done in the platform to remove the EGL specific implementation from the Android platform to a more generic one, so that it can be used by both android and linux systems.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:RefactorGLESMozilla.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Requirement Analysis'''==&lt;br /&gt;
&lt;br /&gt;
Earlier, only [https://en.wikipedia.org/wiki/OpenGL OpenGL] implementation was supported for Android targets and we would be extending the [https://en.wikipedia.org/wiki/OpenGL_ES#2.0 ES2] implementation to support it for Linux targets. &lt;br /&gt;
&lt;br /&gt;
===Initial step===&lt;br /&gt;
&lt;br /&gt;
Our [https://github.com/servo/servo/wiki/Refactor-GLES2-student-project initial step], implemented for the OSS project involved:&lt;br /&gt;
* compile Servo and ensure that it runs on tests/html/about-mozilla.html&lt;br /&gt;
* adding a new command-line option to allow selecting the graphics backend (GL or ES2) in &amp;lt;code&amp;gt;components/utils/opts.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
* clone rust-layers and build it independently of Servo&lt;br /&gt;
* adding a Cargo override for Servo to use the local copy of rust-layers&lt;br /&gt;
&lt;br /&gt;
===Final Requirements===&lt;br /&gt;
&lt;br /&gt;
* Enable selection of the render api working from the command line, so the user can pick whether to use GL or ES2&lt;br /&gt;
* Modify the necessary files so that the current display version of GL or ES2 are returned whenever either of them are selected&lt;br /&gt;
* Make the EGL libs available on Linux apart from android, for rust-layers to compile rust-egl on Linux build.&lt;br /&gt;
* Separate out the EGLImageNativeSurface implementation from Android and move it to EGL&lt;br /&gt;
* Enable use of EGL or GLX for Linux.&lt;br /&gt;
* In conclusion, implement a generic way of supporting EGL for both Linux and Android, such that ES2 is rendered as a display on linux targets as well.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
  Servo/components/utils/opts.rs&lt;br /&gt;
added the new command line option to enable user to select the option of GL or ES2 as the rendering backend. The options of GL or ES2 are stored as an enum called RenderApi , such that running the Servo with option --render-api=chosen_option sets the corresponding Api.&lt;br /&gt;
&lt;br /&gt;
  Servo/ports/glutin/window.rs&lt;br /&gt;
&amp;lt;code&amp;gt;gl_version()&amp;lt;/code&amp;gt; function is modified in a way that based on what is selected as the RenderApi option by the user, the corresponding version of the Api is set. To talk more in detail, if the render api is set to GL, it returns the current value (GL 2.1) &amp;amp; if set to ES2, it returns OpenGlEs 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;native_display()&amp;lt;/code&amp;gt; for linux target is also modified to call the specific NativeDisplay constructor based on the RenderApi option chosen by the user. Hence for the GL case, the existing NativeDisplay::new constructor is called, but if ES2 is selected, NativeDisplay::from_es2() is called, which has been introduced by us in an attempt to support ES2 for the linux platform as well.&lt;br /&gt;
&lt;br /&gt;
===Rust-Layers===&lt;br /&gt;
&lt;br /&gt;
  rust-layers/cargo.toml&lt;br /&gt;
In order to make the egl libraries available to the Linux too, the cargo.toml is edited which defines the different dependencies that various platforms has. Before, the dependency on rust-egl was added only for android targets but now these dependencies have been added for Linux targets as well.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/egl/surface.rs&lt;br /&gt;
In order to support EGL for both linux and android targets, we moved the implementation of &amp;lt;code&amp;gt;EGLImageNativeSurface&amp;lt;/code&amp;gt; from the android specific &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and introduced a new folder &amp;lt;code&amp;gt;egl&amp;lt;/code&amp;gt; which contains its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and implements a generic &amp;lt;code&amp;gt;EGLImageNativeSurface &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/lib.rs&lt;br /&gt;
Since egl needs to be supported for linux too now, the extern crate egl call needs to be linked on Linux as well now. Hence in the cfg flag, the target_os=&amp;quot;linux&amp;quot; is added in addition to android.&lt;br /&gt;
&lt;br /&gt;
In the pub mod platform { }, introduced a new pub mod egl {} section to pull in the new &amp;lt;code&amp;gt;egl/surface.rs&amp;lt;/code&amp;gt; implemented for both android and linux targets.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/linux/surface.rs&lt;br /&gt;
In order to ensure that ES2 is supported for linux targets too, we need to enable the use of EGL &amp;amp; GLX in the linux specific &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
A new enum is created for NativeDisplay which has two different values of &amp;lt;code&amp;gt;EGLDisplayInfo&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;GlxDisplayInfo&amp;lt;/code&amp;gt; and respectively, two constructors are created . The existing NativeDisplay::new constructor is modified to return &amp;lt;code&amp;gt;NativeDisplay::Glx(info)&amp;lt;/code&amp;gt; for the GL version , and the NativeDisplay::from_es2() constructor introduced earlier can return &amp;lt;code&amp;gt;NativeDisplay::::Egl(egl_info)&amp;lt;/code&amp;gt; for the ES2 version.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/surface.rs&lt;br /&gt;
Earlier, the android target was using its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and the linux target was using its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt;. But after the implementation of &amp;lt;code&amp;gt;egl/surface.rs&amp;lt;/code&amp;gt;, changes were made to platform &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; which uses the egl surface.rs for both android and linux now.&lt;br /&gt;
&lt;br /&gt;
=='''Useful libraries'''==&lt;br /&gt;
&lt;br /&gt;
waffle-gl/waffle: A C library for selecting an OpenGL API and window system at runtime.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
The aim is to use ES2 implementation of rust layers for both android and Linux. So we need to use a design pattern that will allow us to extend the current implementation to support Linux targets too and give the user the flexibility to choose between the two implementations for rendering the backend.&lt;br /&gt;
&lt;br /&gt;
We propose to use [https://en.wikipedia.org/wiki/Decorator_pattern Decorator] pattern. The decorator pattern gives the user the ability to choose between the implementations that are desired, and attach the corresponding implementation to the target dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100035</id>
		<title>CSC/ECE 517 Fall 2015/M1506-Refactor-GLES2-Implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100035"/>
		<updated>2015-12-03T23:18:01Z</updated>

		<summary type="html">&lt;p&gt;Djain2: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
===Setup of Development environment===&lt;br /&gt;
&lt;br /&gt;
* Servo can be built and compiled in the following steps:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* Next, we need a cargo override for servo to use our local copy of Rust-layers. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
&lt;br /&gt;
===Overview===&lt;br /&gt;
* After building servo and rust-layers successfully, we added a new command line argument in Servo, which would allow user to select the graphics backend (GL or ES2).&lt;br /&gt;
&lt;br /&gt;
Example is as below&lt;br /&gt;
    ./mach run [url] -G GL or ./mach run [url] --graphics GL (for GL)&lt;br /&gt;
    ./mach run [url] -G ES2 or ./mach run [url] --graphics ES2 (for ES2)&lt;br /&gt;
&lt;br /&gt;
* This option selected is passed onto the rust-layers, which is modified to support ES2 for both linux and android versions. Hence, based on the option selected by the user, rust-layers renders the corresponding graphic backend on linux and android targets.To achieve this, the main changes are done in the platform to remove the EGL specific implementation from the Android platform to a more generic one, so that it can be used by both android and linux systems.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:RefactorGLESMozilla.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Requirement Analysis'''==&lt;br /&gt;
&lt;br /&gt;
Earlier, only [https://en.wikipedia.org/wiki/OpenGL OpenGL] implementation was supported for Android targets and we would be extending the [https://en.wikipedia.org/wiki/OpenGL_ES#2.0 ES2] implementation to support it for Linux targets. As a part of the final project, we accomplished the following steps:&lt;br /&gt;
&lt;br /&gt;
* Enable selection of the render api working from the command line, so the user can pick whether to use GL or ES2&lt;br /&gt;
* Modify the necessary files so that the current version of GL or ES2 are returned whenever either of them are selected&lt;br /&gt;
* Make the EGL libs available on Linux for rust-layers to compile rust-egl on Linux build.&lt;br /&gt;
* Separate out the EGLImageNativeSurface implementation from Android and move it to EGL&lt;br /&gt;
* Enable use of EGL or GLX for Linux&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
  Servo/components/utils/opts.rs&lt;br /&gt;
added the new command line option to enable user to select the option of GL or ES2 as the rendering backend. The options of GL or ES2 are stored as an enum called RenderApi , such that running the Servo with option --render-api=chosen_option sets the corresponding Api.&lt;br /&gt;
&lt;br /&gt;
  Servo/ports/glutin/window.rs&lt;br /&gt;
&amp;lt;code&amp;gt;gl_version()&amp;lt;/code&amp;gt; function is modified in a way that based on what is selected as the RenderApi option by the user, the corresponding version of the Api is set. To talk more in detail, if the render api is set to GL, it returns the current value (GL 2.1) &amp;amp; if set to ES2, it returns OpenGlEs 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;native_display()&amp;lt;/code&amp;gt; for linux target is also modified to call the specific NativeDisplay constructor based on the RenderApi option chosen by the user. Hence for the GL case, the existing NativeDisplay::new constructor is called, but if ES2 is selected, NativeDisplay::from_es2() is called, which has been introduced by us in an attempt to support ES2 for the linux platform as well.&lt;br /&gt;
&lt;br /&gt;
===Rust-Layers===&lt;br /&gt;
&lt;br /&gt;
  rust-layers/cargo.toml&lt;br /&gt;
In order to make the egl libraries available to the Linux too, the cargo.toml is edited which defines the different dependencies that various platforms has. Before, the dependency on rust-egl was added only for android targets but now these dependencies have been added for Linux targets as well.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/egl/surface.rs&lt;br /&gt;
In order to support EGL for both linux and android targets, we moved the implementation of &amp;lt;code&amp;gt;EGLImageNativeSurface&amp;lt;/code&amp;gt; from the android specific &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and introduced a new folder &amp;lt;code&amp;gt;egl&amp;lt;/code&amp;gt; which contains its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and implements a generic &amp;lt;code&amp;gt;EGLImageNativeSurface &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/lib.rs&lt;br /&gt;
Since egl needs to be supported for linux too now, the extern crate egl call needs to be linked on Linux as well now. Hence in the cfg flag, the target_os=&amp;quot;linux&amp;quot; is added in addition to android.&lt;br /&gt;
&lt;br /&gt;
In the pub mod platform { }, introduced a new pub mod egl {} section to pull in the new &amp;lt;code&amp;gt;egl/surface.rs&amp;lt;/code&amp;gt; implemented for both android and linux targets.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/linux/surface.rs&lt;br /&gt;
In order to ensure that ES2 is supported for linux targets too, we need to enable the use of EGL &amp;amp; GLX in the linux specific &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
A new enum is created for NativeDisplay which has two different values of &amp;lt;code&amp;gt;EGLDisplayInfo&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;GlxDisplayInfo&amp;lt;/code&amp;gt; and respectively, two constructors are created . The existing NativeDisplay::new constructor is modified to return &amp;lt;code&amp;gt;NativeDisplay::Glx(info)&amp;lt;/code&amp;gt; for the GL version , and the NativeDisplay::from_es2() constructor introduced earlier can return &amp;lt;code&amp;gt;NativeDisplay::::Egl(egl_info)&amp;lt;/code&amp;gt; for the ES2 version.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/surface.rs&lt;br /&gt;
Earlier, the android target was using its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and the linux target was using its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt;. But after the implementation of &amp;lt;code&amp;gt;egl/surface.rs&amp;lt;/code&amp;gt;, changes were made to platform &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; which uses the egl surface.rs for both android and linux now.&lt;br /&gt;
&lt;br /&gt;
=='''Useful libraries'''==&lt;br /&gt;
&lt;br /&gt;
waffle-gl/waffle: A C library for selecting an OpenGL API and window system at runtime.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
The aim is to use ES2 implementation of rust layers for both android and Linux. So we need to use a design pattern that will allow us to extend the current implementation to support Linux targets too and give the user the flexibility to choose between the two implementations for rendering the backend.&lt;br /&gt;
&lt;br /&gt;
We propose to use [https://en.wikipedia.org/wiki/Decorator_pattern Decorator] pattern. The decorator pattern gives the user the ability to choose between the implementations that are desired, and attach the corresponding implementation to the target dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100034</id>
		<title>CSC/ECE 517 Fall 2015/M1506-Refactor-GLES2-Implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100034"/>
		<updated>2015-12-03T23:06:27Z</updated>

		<summary type="html">&lt;p&gt;Djain2: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
===Setup of Development environment===&lt;br /&gt;
&lt;br /&gt;
* Servo can be built and compiled in the following steps:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* Next, we need a cargo override for servo to use our local copy of Rust-layers. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
&lt;br /&gt;
===Overview===&lt;br /&gt;
* After building servo and rust-layers successfully, we added a new command line argument in Servo, which would allow user to select the graphics backend (GL or ES2).&lt;br /&gt;
&lt;br /&gt;
Example is as below&lt;br /&gt;
    ./mach run [url] -G GL or ./mach run [url] --graphics GL (for GL)&lt;br /&gt;
    ./mach run [url] -G ES2 or ./mach run [url] --graphics ES2 (for ES2)&lt;br /&gt;
 &lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function. For this, we did the following change:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; and then based on the boolean value from the servo &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, we set a variable with the respective enum value &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Then, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
* Now we need to change the platform implementation in [https://github.com/servo/rust-layers/blob/master/src/platform/surface.rs surface.rs] and provide a generic implementation to dynamically select between GL &amp;amp; ES2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:RefactorGLESMozilla.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Requirement Analysis'''==&lt;br /&gt;
&lt;br /&gt;
Earlier, only [https://en.wikipedia.org/wiki/OpenGL OpenGL] implementation was supported for Android targets and we would be extending the [https://en.wikipedia.org/wiki/OpenGL_ES#2.0 ES2] implementation to support it for Linux targets. As a part of the final project, we accomplished the following steps:&lt;br /&gt;
&lt;br /&gt;
* Enable selection of the render api working from the command line, so the user can pick whether to use GL or ES2&lt;br /&gt;
* Modify the necessary files so that the current version of GL or ES2 are returned whenever either of them are selected&lt;br /&gt;
* Make the EGL libs available on Linux for rust-layers to compile rust-egl on Linux build.&lt;br /&gt;
* Separate out the EGLImageNativeSurface implementation from Android and move it to EGL&lt;br /&gt;
* Enable use of EGL or GLX for Linux&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
  Servo/components/utils/opts.rs&lt;br /&gt;
added the new command line option to enable user to select the option of GL or ES2 as the rendering backend. The options of GL or ES2 are stored as an enum called RenderApi , such that running the Servo with option --render-api=chosen_option sets the corresponding Api.&lt;br /&gt;
&lt;br /&gt;
  Servo/ports/glutin/window.rs&lt;br /&gt;
&amp;lt;code&amp;gt;gl_version()&amp;lt;/code&amp;gt; function is modified in a way that based on what is selected as the RenderApi option by the user, the corresponding version of the Api is set. To talk more in detail, if the render api is set to GL, it returns the current value (GL 2.1) &amp;amp; if set to ES2, it returns OpenGlEs 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;native_display()&amp;lt;/code&amp;gt; for linux target is also modified to call the specific NativeDisplay constructor based on the RenderApi option chosen by the user. Hence for the GL case, the existing NativeDisplay::new constructor is called, but if ES2 is selected, NativeDisplay::from_es2() is called, which has been introduced by us in an attempt to support ES2 for the linux platform as well.&lt;br /&gt;
&lt;br /&gt;
===Rust-Layers===&lt;br /&gt;
&lt;br /&gt;
  rust-layers/cargo.toml&lt;br /&gt;
In order to make the egl libraries available to the Linux too, the cargo.toml is edited which defines the different dependencies that various platforms has. Before, the dependency on rust-egl was added only for android targets but now these dependencies have been added for Linux targets as well.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/egl/surface.rs&lt;br /&gt;
In order to support EGL for both linux and android targets, we moved the implementation of &amp;lt;code&amp;gt;EGLImageNativeSurface&amp;lt;/code&amp;gt; from the android specific &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and introduced a new folder &amp;lt;code&amp;gt;egl&amp;lt;/code&amp;gt; which contains its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and implements a generic &amp;lt;code&amp;gt;EGLImageNativeSurface &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/lib.rs&lt;br /&gt;
Since egl needs to be supported for linux too now, the extern crate egl call needs to be linked on Linux as well now. Hence in the cfg flag, the target_os=&amp;quot;linux&amp;quot; is added in addition to android.&lt;br /&gt;
&lt;br /&gt;
In the pub mod platform { }, introduced a new pub mod egl {} section to pull in the new &amp;lt;code&amp;gt;egl/surface.rs&amp;lt;/code&amp;gt; implemented for both android and linux targets.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/linux/surface.rs&lt;br /&gt;
In order to ensure that ES2 is supported for linux targets too, we need to enable the use of EGL &amp;amp; GLX in the linux specific &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
A new enum is created for NativeDisplay which has two different values of &amp;lt;code&amp;gt;EGLDisplayInfo&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;GlxDisplayInfo&amp;lt;/code&amp;gt; and respectively, two constructors are created . The existing NativeDisplay::new constructor is modified to return &amp;lt;code&amp;gt;NativeDisplay::Glx(info)&amp;lt;/code&amp;gt; for the GL version , and the NativeDisplay::from_es2() constructor introduced earlier can return &amp;lt;code&amp;gt;NativeDisplay::::Egl(egl_info)&amp;lt;/code&amp;gt; for the ES2 version.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/surface.rs&lt;br /&gt;
Earlier, the android target was using its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and the linux target was using its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt;. But after the implementation of &amp;lt;code&amp;gt;egl/surface.rs&amp;lt;/code&amp;gt;, changes were made to platform &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; which uses the egl surface.rs for both android and linux now.&lt;br /&gt;
&lt;br /&gt;
=='''Useful libraries'''==&lt;br /&gt;
&lt;br /&gt;
waffle-gl/waffle: A C library for selecting an OpenGL API and window system at runtime.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
The aim is to use ES2 implementation of rust layers for both android and Linux. So we need to use a design pattern that will allow us to extend the current implementation to support Linux targets too and give the user the flexibility to choose between the two implementations for rendering the backend.&lt;br /&gt;
&lt;br /&gt;
We propose to use [https://en.wikipedia.org/wiki/Decorator_pattern Decorator] pattern. The decorator pattern gives the user the ability to choose between the implementations that are desired, and attach the corresponding implementation to the target dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100033</id>
		<title>CSC/ECE 517 Fall 2015/M1506-Refactor-GLES2-Implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100033"/>
		<updated>2015-12-03T23:01:51Z</updated>

		<summary type="html">&lt;p&gt;Djain2: /* Project Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
===Setup of Development environment===&lt;br /&gt;
&lt;br /&gt;
* Servo can be built and compiled in the following steps:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* Next, we need a cargo override for servo to use our local copy of Rust-layers. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
&lt;br /&gt;
===Overview===&lt;br /&gt;
* After building servo and rust-layers successfully, we added a new command line argument in Servo, which would allow user to select the graphics backend (GL or ES2).&lt;br /&gt;
   Example is as below&lt;br /&gt;
    ./mach run [url] -G GL or ./mach run [url] --graphics GL (for GL)&lt;br /&gt;
    ./mach run [url] -G ES2 or ./mach run [url] --graphics ES2 (for ES2)&lt;br /&gt;
 &lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function. For this, we did the following change:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; and then based on the boolean value from the servo &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, we set a variable with the respective enum value &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Then, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
* Now we need to change the platform implementation in [https://github.com/servo/rust-layers/blob/master/src/platform/surface.rs surface.rs] and provide a generic implementation to dynamically select between GL &amp;amp; ES2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:RefactorGLESMozilla.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Requirement Analysis'''==&lt;br /&gt;
&lt;br /&gt;
Earlier, only [https://en.wikipedia.org/wiki/OpenGL OpenGL] implementation was supported for Android targets and we would be extending the [https://en.wikipedia.org/wiki/OpenGL_ES#2.0 ES2] implementation to support it for Linux targets. As a part of the final project, we accomplished the following steps:&lt;br /&gt;
&lt;br /&gt;
* Enable selection of the render api working from the command line, so the user can pick whether to use GL or ES2&lt;br /&gt;
* Modify the necessary files so that the current version of GL or ES2 are returned whenever either of them are selected&lt;br /&gt;
* Make the EGL libs available on Linux for rust-layers to compile rust-egl on Linux build.&lt;br /&gt;
* Separate out the EGLImageNativeSurface implementation from Android and move it to EGL&lt;br /&gt;
* Enable use of EGL or GLX for Linux&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
  Servo/components/utils/opts.rs&lt;br /&gt;
added the new command line option to enable user to select the option of GL or ES2 as the rendering backend. The options of GL or ES2 are stored as an enum called RenderApi , such that running the Servo with option --render-api=chosen_option sets the corresponding Api.&lt;br /&gt;
&lt;br /&gt;
  Servo/ports/glutin/window.rs&lt;br /&gt;
&amp;lt;code&amp;gt;gl_version()&amp;lt;/code&amp;gt; function is modified in a way that based on what is selected as the RenderApi option by the user, the corresponding version of the Api is set. To talk more in detail, if the render api is set to GL, it returns the current value (GL 2.1) &amp;amp; if set to ES2, it returns OpenGlEs 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;native_display()&amp;lt;/code&amp;gt; for linux target is also modified to call the specific NativeDisplay constructor based on the RenderApi option chosen by the user. Hence for the GL case, the existing NativeDisplay::new constructor is called, but if ES2 is selected, NativeDisplay::from_es2() is called, which has been introduced by us in an attempt to support ES2 for the linux platform as well.&lt;br /&gt;
&lt;br /&gt;
===Rust-Layers===&lt;br /&gt;
&lt;br /&gt;
  rust-layers/cargo.toml&lt;br /&gt;
In order to make the egl libraries available to the Linux too, the cargo.toml is edited which defines the different dependencies that various platforms has. Before, the dependency on rust-egl was added only for android targets but now these dependencies have been added for Linux targets as well.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/egl/surface.rs&lt;br /&gt;
In order to support EGL for both linux and android targets, we moved the implementation of &amp;lt;code&amp;gt;EGLImageNativeSurface&amp;lt;/code&amp;gt; from the android specific &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and introduced a new folder &amp;lt;code&amp;gt;egl&amp;lt;/code&amp;gt; which contains its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and implements a generic &amp;lt;code&amp;gt;EGLImageNativeSurface &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/lib.rs&lt;br /&gt;
Since egl needs to be supported for linux too now, the extern crate egl call needs to be linked on Linux as well now. Hence in the cfg flag, the target_os=&amp;quot;linux&amp;quot; is added in addition to android.&lt;br /&gt;
&lt;br /&gt;
In the pub mod platform { }, introduced a new pub mod egl {} section to pull in the new &amp;lt;code&amp;gt;egl/surface.rs&amp;lt;/code&amp;gt; implemented for both android and linux targets.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/linux/surface.rs&lt;br /&gt;
In order to ensure that ES2 is supported for linux targets too, we need to enable the use of EGL &amp;amp; GLX in the linux specific &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
A new enum is created for NativeDisplay which has two different values of &amp;lt;code&amp;gt;EGLDisplayInfo&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;GlxDisplayInfo&amp;lt;/code&amp;gt; and respectively, two constructors are created . The existing NativeDisplay::new constructor is modified to return &amp;lt;code&amp;gt;NativeDisplay::Glx(info)&amp;lt;/code&amp;gt; for the GL version , and the NativeDisplay::from_es2() constructor introduced earlier can return &amp;lt;code&amp;gt;NativeDisplay::::Egl(egl_info)&amp;lt;/code&amp;gt; for the ES2 version.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/surface.rs&lt;br /&gt;
Earlier, the android target was using its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and the linux target was using its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt;. But after the implementation of &amp;lt;code&amp;gt;egl/surface.rs&amp;lt;/code&amp;gt;, changes were made to platform &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; which uses the egl surface.rs for both android and linux now.&lt;br /&gt;
&lt;br /&gt;
=='''Useful libraries'''==&lt;br /&gt;
&lt;br /&gt;
waffle-gl/waffle: A C library for selecting an OpenGL API and window system at runtime.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
The aim is to use ES2 implementation of rust layers for both android and Linux. So we need to use a design pattern that will allow us to extend the current implementation to support Linux targets too and give the user the flexibility to choose between the two implementations for rendering the backend.&lt;br /&gt;
&lt;br /&gt;
We propose to use [https://en.wikipedia.org/wiki/Decorator_pattern Decorator] pattern. The decorator pattern gives the user the ability to choose between the implementations that are desired, and attach the corresponding implementation to the target dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100032</id>
		<title>CSC/ECE 517 Fall 2015/M1506-Refactor-GLES2-Implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100032"/>
		<updated>2015-12-03T22:52:27Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
===Setup of Development environment===&lt;br /&gt;
&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We added a command line option which lets the user enter the option &amp;lt;code&amp;gt;-E&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--es2&amp;lt;/code&amp;gt; if the user wants to set ES2 as the graphic back end option. GL is set by default, hence if the user doesn't give any argument, Gl is selected as the graphic back end option. Example is as below&lt;br /&gt;
    ./mach run [url] -E&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function. For this, we did the following change:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; and then based on the boolean value from the servo &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, we set a variable with the respective enum value &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Then, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
* Now we need to change the platform implementation in [https://github.com/servo/rust-layers/blob/master/src/platform/surface.rs surface.rs] and provide a generic implementation to dynamically select between GL &amp;amp; ES2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:RefactorGLESMozilla.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Requirement Analysis'''==&lt;br /&gt;
&lt;br /&gt;
Earlier, only [https://en.wikipedia.org/wiki/OpenGL OpenGL] implementation was supported for Android targets and we would be extending the [https://en.wikipedia.org/wiki/OpenGL_ES#2.0 ES2] implementation to support it for Linux targets. As a part of the final project, we accomplished the following steps:&lt;br /&gt;
&lt;br /&gt;
* Enable selection of the render api working from the command line, so the user can pick whether to use GL or ES2&lt;br /&gt;
* Modify the necessary files so that the current version of GL or ES2 are returned whenever either of them are selected&lt;br /&gt;
* Make the EGL libs available on Linux for rust-layers to compile rust-egl on Linux build.&lt;br /&gt;
* Separate out the EGLImageNativeSurface implementation from Android and move it to EGL&lt;br /&gt;
* Enable use of EGL or GLX for Linux&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
  Servo/components/utils/opts.rs&lt;br /&gt;
added the new command line option to enable user to select the option of GL or ES2 as the rendering backend. The options of GL or ES2 are stored as an enum called RenderApi , such that running the Servo with option --render-api=chosen_option sets the corresponding Api.&lt;br /&gt;
&lt;br /&gt;
  Servo/ports/glutin/window.rs&lt;br /&gt;
&amp;lt;code&amp;gt;gl_version()&amp;lt;/code&amp;gt; function is modified in a way that based on what is selected as the RenderApi option by the user, the corresponding version of the Api is set. To talk more in detail, if the render api is set to GL, it returns the current value (GL 2.1) &amp;amp; if set to ES2, it returns OpenGlEs 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;native_display()&amp;lt;/code&amp;gt; for linux target is also modified to call the specific NativeDisplay constructor based on the RenderApi option chosen by the user. Hence for the GL case, the existing NativeDisplay::new constructor is called, but if ES2 is selected, NativeDisplay::from_es2() is called, which has been introduced by us in an attempt to support ES2 for the linux platform as well.&lt;br /&gt;
&lt;br /&gt;
===Rust-Layers===&lt;br /&gt;
&lt;br /&gt;
  rust-layers/cargo.toml&lt;br /&gt;
In order to make the egl libraries available to the Linux too, the cargo.toml is edited which defines the different dependencies that various platforms has. Before, the dependency on rust-egl was added only for android targets but now these dependencies have been added for Linux targets as well.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/egl/surface.rs&lt;br /&gt;
In order to support EGL for both linux and android targets, we moved the implementation of &amp;lt;code&amp;gt;EGLImageNativeSurface&amp;lt;/code&amp;gt; from the android specific &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and introduced a new folder &amp;lt;code&amp;gt;egl&amp;lt;/code&amp;gt; which contains its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and implements a generic &amp;lt;code&amp;gt;EGLImageNativeSurface &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/lib.rs&lt;br /&gt;
Since egl needs to be supported for linux too now, the extern crate egl call needs to be linked on Linux as well now. Hence in the cfg flag, the target_os=&amp;quot;linux&amp;quot; is added in addition to android.&lt;br /&gt;
&lt;br /&gt;
In the pub mod platform { }, introduced a new pub mod egl {} section to pull in the new &amp;lt;code&amp;gt;egl/surface.rs&amp;lt;/code&amp;gt; implemented for both android and linux targets.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/linux/surface.rs&lt;br /&gt;
In order to ensure that ES2 is supported for linux targets too, we need to enable the use of EGL &amp;amp; GLX in the linux specific &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
A new enum is created for NativeDisplay which has two different values of &amp;lt;code&amp;gt;EGLDisplayInfo&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;GlxDisplayInfo&amp;lt;/code&amp;gt; and respectively, two constructors are created . The existing NativeDisplay::new constructor is modified to return &amp;lt;code&amp;gt;NativeDisplay::Glx(info)&amp;lt;/code&amp;gt; for the GL version , and the NativeDisplay::from_es2() constructor introduced earlier can return &amp;lt;code&amp;gt;NativeDisplay::::Egl(egl_info)&amp;lt;/code&amp;gt; for the ES2 version.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/surface.rs&lt;br /&gt;
Earlier, the android target was using its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and the linux target was using its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt;. But after the implementation of &amp;lt;code&amp;gt;egl/surface.rs&amp;lt;/code&amp;gt;, changes were made to platform &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; which uses the egl surface.rs for both android and linux now.&lt;br /&gt;
&lt;br /&gt;
=='''Useful libraries'''==&lt;br /&gt;
&lt;br /&gt;
waffle-gl/waffle: A C library for selecting an OpenGL API and window system at runtime.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
The aim is to use ES2 implementation of rust layers for both android and Linux. So we need to use a design pattern that will allow us to extend the current implementation to support Linux targets too and give the user the flexibility to choose between the two implementations for rendering the backend.&lt;br /&gt;
&lt;br /&gt;
We propose to use [https://en.wikipedia.org/wiki/Decorator_pattern Decorator] pattern. The decorator pattern gives the user the ability to choose between the implementations that are desired, and attach the corresponding implementation to the target dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100031</id>
		<title>CSC/ECE 517 Fall 2015/M1506-Refactor-GLES2-Implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100031"/>
		<updated>2015-12-03T22:48:49Z</updated>

		<summary type="html">&lt;p&gt;Djain2: /* Rust-Layers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We added a command line option which lets the user enter the option &amp;lt;code&amp;gt;-E&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--es2&amp;lt;/code&amp;gt; if the user wants to set ES2 as the graphic back end option. GL is set by default, hence if the user doesn't give any argument, Gl is selected as the graphic back end option. Example is as below&lt;br /&gt;
    ./mach run [url] -E&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function. For this, we did the following change:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; and then based on the boolean value from the servo &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, we set a variable with the respective enum value &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Then, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
* Now we need to change the platform implementation in [https://github.com/servo/rust-layers/blob/master/src/platform/surface.rs surface.rs] and provide a generic implementation to dynamically select between GL &amp;amp; ES2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:RefactorGLESMozilla.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Requirement Analysis'''==&lt;br /&gt;
&lt;br /&gt;
Earlier, only [https://en.wikipedia.org/wiki/OpenGL OpenGL] implementation was supported for Android targets and we would be extending the [https://en.wikipedia.org/wiki/OpenGL_ES#2.0 ES2] implementation to support it for Linux targets. As a part of the final project, we accomplished the following steps:&lt;br /&gt;
&lt;br /&gt;
* Enable selection of the render api working from the command line, so the user can pick whether to use GL or ES2&lt;br /&gt;
* Modify the necessary files so that the current version of GL or ES2 are returned whenever either of them are selected&lt;br /&gt;
* Make the EGL libs available on Linux for rust-layers to compile rust-egl on Linux build.&lt;br /&gt;
* Separate out the EGLImageNativeSurface implementation from Android and move it to EGL&lt;br /&gt;
* Enable use of EGL or GLX for Linux&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
  Servo/components/utils/opts.rs&lt;br /&gt;
added the new command line option to enable user to select the option of GL or ES2 as the rendering backend. The options of GL or ES2 are stored as an enum called RenderApi , such that running the Servo with option --render-api=chosen_option sets the corresponding Api.&lt;br /&gt;
&lt;br /&gt;
  Servo/ports/glutin/window.rs&lt;br /&gt;
&amp;lt;code&amp;gt;gl_version()&amp;lt;/code&amp;gt; function is modified in a way that based on what is selected as the RenderApi option by the user, the corresponding version of the Api is set. To talk more in detail, if the render api is set to GL, it returns the current value (GL 2.1) &amp;amp; if set to ES2, it returns OpenGlEs 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;native_display()&amp;lt;/code&amp;gt; for linux target is also modified to call the specific NativeDisplay constructor based on the RenderApi option chosen by the user. Hence for the GL case, the existing NativeDisplay::new constructor is called, but if ES2 is selected, NativeDisplay::from_es2() is called, which has been introduced by us in an attempt to support ES2 for the linux platform as well.&lt;br /&gt;
&lt;br /&gt;
===Rust-Layers===&lt;br /&gt;
&lt;br /&gt;
  rust-layers/cargo.toml&lt;br /&gt;
In order to make the egl libraries available to the Linux too, the cargo.toml is edited which defines the different dependencies that various platforms has. Before, the dependency on rust-egl was added only for android targets but now these dependencies have been added for Linux targets as well.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/egl/surface.rs&lt;br /&gt;
In order to support EGL for both linux and android targets, we moved the implementation of &amp;lt;code&amp;gt;EGLImageNativeSurface&amp;lt;/code&amp;gt; from the android specific &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and introduced a new folder &amp;lt;code&amp;gt;egl&amp;lt;/code&amp;gt; which contains its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and implements a generic &amp;lt;code&amp;gt;EGLImageNativeSurface &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/lib.rs&lt;br /&gt;
Since egl needs to be supported for linux too now, the extern crate egl call needs to be linked on Linux as well now. Hence in the cfg flag, the target_os=&amp;quot;linux&amp;quot; is added in addition to android.&lt;br /&gt;
&lt;br /&gt;
In the pub mod platform { }, introduced a new pub mod egl {} section to pull in the new &amp;lt;code&amp;gt;egl/surface.rs&amp;lt;/code&amp;gt; implemented for both android and linux targets.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/linux/surface.rs&lt;br /&gt;
In order to ensure that ES2 is supported for linux targets too, we need to enable the use of EGL &amp;amp; GLX in the linux specific &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
A new enum is created for NativeDisplay which has two different values of &amp;lt;code&amp;gt;EGLDisplayInfo&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;GlxDisplayInfo&amp;lt;/code&amp;gt; and respectively, two constructors are created . The existing NativeDisplay::new constructor is modified to return &amp;lt;code&amp;gt;NativeDisplay::Glx(info)&amp;lt;/code&amp;gt; for the GL version , and the NativeDisplay::from_es2() constructor introduced earlier can return &amp;lt;code&amp;gt;NativeDisplay::::Egl(egl_info)&amp;lt;/code&amp;gt; for the ES2 version.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/surface.rs&lt;br /&gt;
Earlier, the android target was using its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and the linux target was using its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt;. But after the implementation of &amp;lt;code&amp;gt;egl/surface.rs&amp;lt;/code&amp;gt;, changes were made to platform &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; which uses the egl surface.rs for both android and linux now.&lt;br /&gt;
&lt;br /&gt;
=='''Useful libraries'''==&lt;br /&gt;
&lt;br /&gt;
waffle-gl/waffle: A C library for selecting an OpenGL API and window system at runtime.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
The aim is to use ES2 implementation of rust layers for both android and Linux. So we need to use a design pattern that will allow us to extend the current implementation to support Linux targets too and give the user the flexibility to choose between the two implementations for rendering the backend.&lt;br /&gt;
&lt;br /&gt;
We propose to use [https://en.wikipedia.org/wiki/Decorator_pattern Decorator] pattern. The decorator pattern gives the user the ability to choose between the implementations that are desired, and attach the corresponding implementation to the target dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100030</id>
		<title>CSC/ECE 517 Fall 2015/M1506-Refactor-GLES2-Implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100030"/>
		<updated>2015-12-03T22:44:07Z</updated>

		<summary type="html">&lt;p&gt;Djain2: /* Rust-Layers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We added a command line option which lets the user enter the option &amp;lt;code&amp;gt;-E&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--es2&amp;lt;/code&amp;gt; if the user wants to set ES2 as the graphic back end option. GL is set by default, hence if the user doesn't give any argument, Gl is selected as the graphic back end option. Example is as below&lt;br /&gt;
    ./mach run [url] -E&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function. For this, we did the following change:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; and then based on the boolean value from the servo &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, we set a variable with the respective enum value &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Then, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
* Now we need to change the platform implementation in [https://github.com/servo/rust-layers/blob/master/src/platform/surface.rs surface.rs] and provide a generic implementation to dynamically select between GL &amp;amp; ES2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:RefactorGLESMozilla.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Requirement Analysis'''==&lt;br /&gt;
&lt;br /&gt;
Earlier, only [https://en.wikipedia.org/wiki/OpenGL OpenGL] implementation was supported for Android targets and we would be extending the [https://en.wikipedia.org/wiki/OpenGL_ES#2.0 ES2] implementation to support it for Linux targets. As a part of the final project, we accomplished the following steps:&lt;br /&gt;
&lt;br /&gt;
* Enable selection of the render api working from the command line, so the user can pick whether to use GL or ES2&lt;br /&gt;
* Modify the necessary files so that the current version of GL or ES2 are returned whenever either of them are selected&lt;br /&gt;
* Make the EGL libs available on Linux for rust-layers to compile rust-egl on Linux build.&lt;br /&gt;
* Separate out the EGLImageNativeSurface implementation from Android and move it to EGL&lt;br /&gt;
* Enable use of EGL or GLX for Linux&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
  Servo/components/utils/opts.rs&lt;br /&gt;
added the new command line option to enable user to select the option of GL or ES2 as the rendering backend. The options of GL or ES2 are stored as an enum called RenderApi , such that running the Servo with option --render-api=chosen_option sets the corresponding Api.&lt;br /&gt;
&lt;br /&gt;
  Servo/ports/glutin/window.rs&lt;br /&gt;
&amp;lt;code&amp;gt;gl_version()&amp;lt;/code&amp;gt; function is modified in a way that based on what is selected as the RenderApi option by the user, the corresponding version of the Api is set. To talk more in detail, if the render api is set to GL, it returns the current value (GL 2.1) &amp;amp; if set to ES2, it returns OpenGlEs 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;native_display()&amp;lt;/code&amp;gt; for linux target is also modified to call the specific NativeDisplay constructor based on the RenderApi option chosen by the user. Hence for the GL case, the existing NativeDisplay::new constructor is called, but if ES2 is selected, NativeDisplay::from_es2() is called, which has been introduced by us in an attempt to support ES2 for the linux platform as well.&lt;br /&gt;
&lt;br /&gt;
===Rust-Layers===&lt;br /&gt;
&lt;br /&gt;
  rust-layers/cargo.toml&lt;br /&gt;
In order to make the egl libraries available to the Linux too, the cargo.toml is edited which defines the different dependencies that various platforms has. Before, the dependency on rust-egl was added only for android targets but now these dependencies have been added for Linux targets as well.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/egl/surface.rs&lt;br /&gt;
In order to support EGL for both linux and android targets, we moved the implementation of &amp;lt;code&amp;gt;EGLImageNativeSurface&amp;lt;/code&amp;gt; from the android specific &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and introduced a new folder &amp;lt;code&amp;gt;egl&amp;lt;/code&amp;gt; which contains its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and implements a generic &amp;lt;code&amp;gt;EGLImageNativeSurface &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/lib.rs&lt;br /&gt;
Since egl needs to be supported for linux too now, the extern crate egl call needs to be linked on Linux as well now. Hence in the cfg flag, the target_os=&amp;quot;linux&amp;quot; is added in addition to android.&lt;br /&gt;
&lt;br /&gt;
In the pub mod platform { }, introduced a new pub mod egl {} section to pull in the new &amp;lt;code&amp;gt;egl/surface.rs&amp;lt;/code&amp;gt; implemented for both android and linux targets.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/linux/surface.rs&lt;br /&gt;
In order to ensure that ES2 is supported for linux targets too, we need to enable the use of EGL &amp;amp; GLX in the linux specific &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
A new enum is created for NativeDisplay which has two different values of &amp;lt;code&amp;gt;EGLDisplayInfo&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;GlxDisplayInfo&amp;lt;/code&amp;gt; and respectively, two constructors are created . The existing NativeDisplay::new constructor is modified to return &amp;lt;code&amp;gt;NativeDisplay::Glx(info)&amp;lt;/code&amp;gt; for the GL version , and the NativeDisplay::from_es2() constructor introduced earlier can return &amp;lt;code&amp;gt;NativeDisplay::::Egl(egl_info)&amp;lt;/code&amp;gt; for the ES2 version.&lt;br /&gt;
&lt;br /&gt;
=='''Useful libraries'''==&lt;br /&gt;
&lt;br /&gt;
waffle-gl/waffle: A C library for selecting an OpenGL API and window system at runtime.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
The aim is to use ES2 implementation of rust layers for both android and Linux. So we need to use a design pattern that will allow us to extend the current implementation to support Linux targets too and give the user the flexibility to choose between the two implementations for rendering the backend.&lt;br /&gt;
&lt;br /&gt;
We propose to use [https://en.wikipedia.org/wiki/Decorator_pattern Decorator] pattern. The decorator pattern gives the user the ability to choose between the implementations that are desired, and attach the corresponding implementation to the target dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100029</id>
		<title>CSC/ECE 517 Fall 2015/M1506-Refactor-GLES2-Implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100029"/>
		<updated>2015-12-03T22:41:57Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We added a command line option which lets the user enter the option &amp;lt;code&amp;gt;-E&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--es2&amp;lt;/code&amp;gt; if the user wants to set ES2 as the graphic back end option. GL is set by default, hence if the user doesn't give any argument, Gl is selected as the graphic back end option. Example is as below&lt;br /&gt;
    ./mach run [url] -E&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function. For this, we did the following change:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; and then based on the boolean value from the servo &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, we set a variable with the respective enum value &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Then, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
* Now we need to change the platform implementation in [https://github.com/servo/rust-layers/blob/master/src/platform/surface.rs surface.rs] and provide a generic implementation to dynamically select between GL &amp;amp; ES2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:RefactorGLESMozilla.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Requirement Analysis'''==&lt;br /&gt;
&lt;br /&gt;
Earlier, only [https://en.wikipedia.org/wiki/OpenGL OpenGL] implementation was supported for Android targets and we would be extending the [https://en.wikipedia.org/wiki/OpenGL_ES#2.0 ES2] implementation to support it for Linux targets. As a part of the final project, we accomplished the following steps:&lt;br /&gt;
&lt;br /&gt;
* Enable selection of the render api working from the command line, so the user can pick whether to use GL or ES2&lt;br /&gt;
* Modify the necessary files so that the current version of GL or ES2 are returned whenever either of them are selected&lt;br /&gt;
* Make the EGL libs available on Linux for rust-layers to compile rust-egl on Linux build.&lt;br /&gt;
* Separate out the EGLImageNativeSurface implementation from Android and move it to EGL&lt;br /&gt;
* Enable use of EGL or GLX for Linux&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
  Servo/components/utils/opts.rs&lt;br /&gt;
added the new command line option to enable user to select the option of GL or ES2 as the rendering backend. The options of GL or ES2 are stored as an enum called RenderApi , such that running the Servo with option --render-api=chosen_option sets the corresponding Api.&lt;br /&gt;
&lt;br /&gt;
  Servo/ports/glutin/window.rs&lt;br /&gt;
&amp;lt;code&amp;gt;gl_version()&amp;lt;/code&amp;gt; function is modified in a way that based on what is selected as the RenderApi option by the user, the corresponding version of the Api is set. To talk more in detail, if the render api is set to GL, it returns the current value (GL 2.1) &amp;amp; if set to ES2, it returns OpenGlEs 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;native_display()&amp;lt;/code&amp;gt; for linux target is also modified to call the specific NativeDisplay constructor based on the RenderApi option chosen by the user. Hence for the GL case, the existing NativeDisplay::new constructor is called, but if ES2 is selected, NativeDisplay::from_es2() is called, which has been introduced by us in an attempt to support ES2 for the linux platform as well.&lt;br /&gt;
&lt;br /&gt;
===Rust-Layers===&lt;br /&gt;
&lt;br /&gt;
  rust-layers/cargo.toml&lt;br /&gt;
In order to make the egl libraries available to the Linux too, the cargo.toml is edited which defines the different dependencies that various platforms has. Before, the dependency on rust-egl was added only for android targets but now these dependencies have been added for Linux targets as well.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/egl/surface.rs&lt;br /&gt;
In order to support EGL for both linux and android targets, we moved the implementation of &amp;lt;code&amp;gt;EGLImageNativeSurface&amp;lt;/code&amp;gt; from the android specific &amp;lt;code&amp;gt;surface.rs&amp;gt; and introduced a new folder &amp;lt;code&amp;gt;egl&amp;lt;/code&amp;gt; which contains its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and implements a generic &amp;lt;code&amp;gt;EGLImageNativeSurface &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/lib.rs&lt;br /&gt;
Since egl needs to be supported for linux too now, the extern crate egl call needs to be linked on Linux as well now. Hence in the cfg flag, the target_os=&amp;quot;linux&amp;quot; is added in addition to android.&lt;br /&gt;
&lt;br /&gt;
In the pub mod platform { }, introduced a new pub mod egl {} section to pull in the new &amp;lt;code&amp;gt;egl/surface.rs&amp;lt;/code&amp;gt; implemented for both android and linux targets.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/linux/surface.rs&lt;br /&gt;
In order to ensure that ES2 is supported for linux targets too, we need to enable the use of EGL &amp;amp; GLX in the linux specific &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
A new enum is created for NativeDisplay which has two different values of &amp;lt;code&amp;gt;EGLDisplayInfo&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;GlxDisplayInfo&amp;lt;/code&amp;gt; and respectively, two constructors are created . The existing NativeDisplay::new constructor is modified to return &amp;lt;code&amp;gt;NativeDisplay::Glx(info)&amp;lt;/code&amp;gt; for the GL version , and the NativeDisplay::from_es2() constructor introduced earlier can return &amp;lt;code&amp;gt;NativeDisplay::::Egl(egl_info)&amp;lt;/code&amp;gt; for the ES2 version.&lt;br /&gt;
&lt;br /&gt;
=='''Useful libraries'''==&lt;br /&gt;
&lt;br /&gt;
waffle-gl/waffle: A C library for selecting an OpenGL API and window system at runtime.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
The aim is to use ES2 implementation of rust layers for both android and Linux. So we need to use a design pattern that will allow us to extend the current implementation to support Linux targets too and give the user the flexibility to choose between the two implementations for rendering the backend.&lt;br /&gt;
&lt;br /&gt;
We propose to use [https://en.wikipedia.org/wiki/Decorator_pattern Decorator] pattern. The decorator pattern gives the user the ability to choose between the implementations that are desired, and attach the corresponding implementation to the target dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100028</id>
		<title>CSC/ECE 517 Fall 2015/M1506-Refactor-GLES2-Implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100028"/>
		<updated>2015-12-03T22:38:53Z</updated>

		<summary type="html">&lt;p&gt;Djain2: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We added a command line option which lets the user enter the option &amp;lt;code&amp;gt;-E&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--es2&amp;lt;/code&amp;gt; if the user wants to set ES2 as the graphic back end option. GL is set by default, hence if the user doesn't give any argument, Gl is selected as the graphic back end option. Example is as below&lt;br /&gt;
    ./mach run [url] -E&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function. For this, we did the following change:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; and then based on the boolean value from the servo &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, we set a variable with the respective enum value &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Then, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
* Now we need to change the platform implementation in [https://github.com/servo/rust-layers/blob/master/src/platform/surface.rs surface.rs] and provide a generic implementation to dynamically select between GL &amp;amp; ES2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:RefactorGLESMozilla.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Requirement Analysis'''==&lt;br /&gt;
&lt;br /&gt;
Earlier, only [https://en.wikipedia.org/wiki/OpenGL OpenGL] implementation was supported for Android targets and we would be extending the [https://en.wikipedia.org/wiki/OpenGL_ES#2.0 ES2] implementation to support it for Linux targets. As a part of the final project, we accomplished the following steps:&lt;br /&gt;
&lt;br /&gt;
* Enable selection of the render api working from the command line, so the user can pick whether to use GL or ES2&lt;br /&gt;
* Modify the necessary files so that the current version of GL or ES2 are returned whenever either of them are selected&lt;br /&gt;
* Make the EGL libs available on Linux for rust-layers to compile rust-egl on Linux build.&lt;br /&gt;
* Separate out the EGLImageNativeSurface implementation from Android and move it to EGL&lt;br /&gt;
* Enable use of EGL or GLX for Linux&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
  Servo/components/utils/opts.rs&lt;br /&gt;
added the new command line option to enable user to select the option of GL or ES2 as the rendering backend. The options of GL or ES2 are stored as an enum called RenderApi , such that running the Servo with option --render-api=chosen_option sets the corresponding Api.&lt;br /&gt;
&lt;br /&gt;
  Servo/ports/glutin/window.rs&lt;br /&gt;
&amp;lt;code&amp;gt;gl_version()&amp;lt;/code&amp;gt; function is modified in a way that based on what is selected as the RenderApi option by the user, the corresponding version of the Api is set. To talk more in detail, if the render api is set to GL, it returns the current value (GL 2.1) &amp;amp; if set to ES2, it returns OpenGlEs 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;native_display()&amp;lt;/code&amp;gt; for linux target is also modified to call the specific NativeDisplay constructor based on the RenderApi option chosen by the user. Hence for the GL case, the existing NativeDisplay::new constructor is called, but if ES2 is selected, NativeDisplay::from_es2() is called, which has been introduced by us in an attempt to support ES2 for the linux platform as well.&lt;br /&gt;
&lt;br /&gt;
===Rust-Layers===&lt;br /&gt;
&lt;br /&gt;
  rust-layers/cargo.toml&lt;br /&gt;
In order to make the egl libraries available to the Linux too, the cargo.toml is edited which defines the different dependencies that various platforms has. Before, the dependency on rust-egl was added only for android targets but now these dependencies have been added for Linux targets as well.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/egl/surface.rs&lt;br /&gt;
In order to support EGL for both linux and android targets, we moved the implementation of &amp;lt;code&amp;gt;EGLImageNativeSurface&amp;lt;/code&amp;gt; from the android specific &amp;lt;code&amp;gt;surface.rs&amp;gt; and introduced a new folder &amp;lt;code&amp;gt;egl&amp;lt;/code&amp;gt; which contains its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and implements a generic &amp;lt;code&amp;gt;EGLImageNativeSurface &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/lib.rs&lt;br /&gt;
Since egl needs to be supported for linux too now, the extern crate egl call needs to be linked on Linux as well now. Hence in the cfg flag, the target_os=&amp;quot;linux&amp;quot; is added in addition to android.&lt;br /&gt;
&lt;br /&gt;
In the pub mod platform { }, introduced a new pub mod egl {} section to pull in the new &amp;lt;code&amp;gt;egl/surface.rs implemented for both android and linux targets.&lt;br /&gt;
&lt;br /&gt;
  rust-layers/src/platform/linux/surface.rs&lt;br /&gt;
In order to ensure that ES2 is supported for linux targets too, we need to enable the use of EGL &amp;amp; GLX in the linux specific &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
A new enum is created for NativeDisplay which has two different values of &amp;lt;code&amp;gt;EGLDisplayInfo&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;GlxDisplayInfo&amp;lt;/code&amp;gt; and respectively, two constructors are created . The existing NativeDisplay::new constructor is modified to return &amp;lt;code&amp;gt;NativeDisplay::Glx(info)&amp;lt;/code&amp;gt; for the GL version , and the NativeDisplay::from_es2() constructor introduced earlier can return &amp;lt;code&amp;gt;NativeDisplay::::Egl(egl_info)&amp;lt;/code&amp;gt; for the ES2 version.&lt;br /&gt;
&lt;br /&gt;
=='''Useful libraries'''==&lt;br /&gt;
&lt;br /&gt;
waffle-gl/waffle: A C library for selecting an OpenGL API and window system at runtime.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
The aim is to use ES2 implementation of rust layers for both android and Linux. So we need to use a design pattern that will allow us to extend the current implementation to support Linux targets too and give the user the flexibility to choose between the two implementations for rendering the backend.&lt;br /&gt;
&lt;br /&gt;
We propose to use [https://en.wikipedia.org/wiki/Decorator_pattern Decorator] pattern. The decorator pattern gives the user the ability to choose between the implementations that are desired, and attach the corresponding implementation to the target dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100027</id>
		<title>CSC/ECE 517 Fall 2015/M1506-Refactor-GLES2-Implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100027"/>
		<updated>2015-12-03T22:05:56Z</updated>

		<summary type="html">&lt;p&gt;Djain2: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We added a command line option which lets the user enter the option &amp;lt;code&amp;gt;-E&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--es2&amp;lt;/code&amp;gt; if the user wants to set ES2 as the graphic back end option. GL is set by default, hence if the user doesn't give any argument, Gl is selected as the graphic back end option. Example is as below&lt;br /&gt;
    ./mach run [url] -E&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function. For this, we did the following change:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; and then based on the boolean value from the servo &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, we set a variable with the respective enum value &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Then, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
* Now we need to change the platform implementation in [https://github.com/servo/rust-layers/blob/master/src/platform/surface.rs surface.rs] and provide a generic implementation to dynamically select between GL &amp;amp; ES2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:RefactorGLESMozilla.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Requirement Analysis'''==&lt;br /&gt;
&lt;br /&gt;
Earlier, only [https://en.wikipedia.org/wiki/OpenGL OpenGL] implementation was supported for Android targets and we would be extending the [https://en.wikipedia.org/wiki/OpenGL_ES#2.0 ES2] implementation to support it for Linux targets. As a part of the final project, we accomplished the following steps:&lt;br /&gt;
&lt;br /&gt;
* Enable selection of the render api working from the command line, so the user can pick whether to use GL or ES2&lt;br /&gt;
* Modify the necessary files so that the current version of GL or ES2 are returned whenever either of them are selected&lt;br /&gt;
* Make the EGL libs available on Linux for rust-layers to compile rust-egl on Linux build.&lt;br /&gt;
* Separate out the EGLImageNativeSurface implementation from Android and move it to EGL&lt;br /&gt;
* Enable use of EGL or GLX for Linux&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
  Servo/components/utils/opts.rs&lt;br /&gt;
added the new command line option to enable user to select the option of GL or ES2 as the rendering backend. The options of GL or ES2 are stored as an enum called RenderApi , such that running the Servo with option --render-api=chosen_option sets the corresponding Api.&lt;br /&gt;
&lt;br /&gt;
  Servo/ports/glutin/window.rs&lt;br /&gt;
&amp;lt;code&amp;gt;gl_version()&amp;lt;/code&amp;gt; function is modified in a way that based on what is selected as the RenderApi option by the user, the corresponding version of the Api is set. To talk more in detail, if the render api is set to GL, it returns the current value (GL 2.1) &amp;amp; if set to ES2, it returns OpenGlEs 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;native_display()&amp;lt;/code&amp;gt; for linux target is also modified to call the specific NativeDisplay constructor based on the RenderApi option chosen by the user. Hence for the GL case, the existing NativeDisplay::new constructor is called, but if ES2 is selected, NativeDisplay::from_es2() is called, which has been introduced by us in an attempt to support ES2 for the linux platform as well.&lt;br /&gt;
&lt;br /&gt;
===Rust-Layers===&lt;br /&gt;
&lt;br /&gt;
  rust-layers/cargo.toml&lt;br /&gt;
In order to make the egl libraries available to the Linux too, the cargo.toml is edited which defines the different dependencies that various platforms has. Before, the dependency on rust-egl was added only for android targets but now these dependencies have been added for Linux targets as well.&lt;br /&gt;
&lt;br /&gt;
   rust-layers/src/platform/egl/surface.rs&lt;br /&gt;
In order to support EGL for both linux and android targets, we moved the implementation of &amp;lt;code&amp;gt;EGLImageNativeSurface&amp;lt;/code&amp;gt; from the android specific &amp;lt;code&amp;gt;surface.rs&amp;gt; and introduced a new folder &amp;lt;code&amp;gt;egl&amp;lt;/code&amp;gt; which contains its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and implements a generic &amp;lt;code&amp;gt;EGLImageNativeSurface &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Useful libraries'''==&lt;br /&gt;
&lt;br /&gt;
waffle-gl/waffle: A C library for selecting an OpenGL API and window system at runtime.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
The aim is to use ES2 implementation of rust layers for both android and Linux. So we need to use a design pattern that will allow us to extend the current implementation to support Linux targets too and give the user the flexibility to choose between the two implementations for rendering the backend.&lt;br /&gt;
&lt;br /&gt;
We propose to use [https://en.wikipedia.org/wiki/Decorator_pattern Decorator] pattern. The decorator pattern gives the user the ability to choose between the implementations that are desired, and attach the corresponding implementation to the target dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100026</id>
		<title>CSC/ECE 517 Fall 2015/M1506-Refactor-GLES2-Implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100026"/>
		<updated>2015-12-03T22:01:39Z</updated>

		<summary type="html">&lt;p&gt;Djain2: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We added a command line option which lets the user enter the option &amp;lt;code&amp;gt;-E&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--es2&amp;lt;/code&amp;gt; if the user wants to set ES2 as the graphic back end option. GL is set by default, hence if the user doesn't give any argument, Gl is selected as the graphic back end option. Example is as below&lt;br /&gt;
    ./mach run [url] -E&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function. For this, we did the following change:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; and then based on the boolean value from the servo &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, we set a variable with the respective enum value &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Then, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
* Now we need to change the platform implementation in [https://github.com/servo/rust-layers/blob/master/src/platform/surface.rs surface.rs] and provide a generic implementation to dynamically select between GL &amp;amp; ES2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:RefactorGLESMozilla.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Requirement Analysis'''==&lt;br /&gt;
&lt;br /&gt;
Earlier, only [https://en.wikipedia.org/wiki/OpenGL OpenGL] implementation was supported for Android targets and we would be extending the [https://en.wikipedia.org/wiki/OpenGL_ES#2.0 ES2] implementation to support it for Linux targets. As a part of the final project, we accomplished the following steps:&lt;br /&gt;
&lt;br /&gt;
* Enable selection of the render api working from the command line, so the user can pick whether to use GL or ES2&lt;br /&gt;
* Modify the necessary files so that the current version of GL or ES2 are returned whenever either of them are selected&lt;br /&gt;
* Make the EGL libs available on Linux for rust-layers to compile rust-egl on Linux build.&lt;br /&gt;
* Separate out the EGLImageNativeSurface implementation from Android and move it to EGL&lt;br /&gt;
* Enable use of EGL or GLX for Linux&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
  Servo/components/utils/opts.rs&lt;br /&gt;
added the new command line option to enable user to select the option of GL or ES2 as the rendering backend. The options of GL or ES2 are stored as an enum called RenderApi , such that running the Servo with option --render-api=chosen_option sets the corresponding Api.&lt;br /&gt;
&lt;br /&gt;
  Servo/ports/glutin/window.rs&lt;br /&gt;
&amp;lt;code&amp;gt;gl_version()&amp;lt;/code&amp;gt; function is modified in a way that based on what is selected as the RenderApi option by the user, the corresponding version of the Api is set. To talk more in detail, if the render api is set to GL, it returns the current value (GL 2.1) &amp;amp; if set to ES2, it returns OpenGlEs 2.0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;native_display()&amp;lt;/code&amp;gt; for linux target is also modified to call the specific NativeDisplay constructor based on the RenderApi option chosen by the user. Hence for the GL case, the existing NativeDisplay::new constructor is called, but if ES2 is selected, NativeDisplay::from_es2() is called, which has been introduced by us in an attempt to support ES2 for the linux platform as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Rust-Layers===&lt;br /&gt;
&lt;br /&gt;
  rust-layers/cargo.toml&lt;br /&gt;
In order to make the egl libraries available to the Linux too, the cargo.toml is edited which defines the different dependencies that various platforms has. Before, the dependency on rust-egl was added only for android targets but now these dependencies have been added for Linux targets as well.&lt;br /&gt;
&lt;br /&gt;
   rust-layers/src/platform/egl/surface.rs&lt;br /&gt;
In order to support EGL for both linux and android targets, we moved the implementation of &amp;lt;code&amp;gt;EGLImageNativeSurface&amp;lt;/code&amp;gt; from the android specific &amp;lt;code&amp;gt;surface.rs&amp;gt; and introduced a new folder &amp;lt;code&amp;gt;egl&amp;lt;/code&amp;gt; which contains its own &amp;lt;code&amp;gt;surface.rs&amp;lt;/code&amp;gt; and implements a generic &amp;lt;code&amp;gt;EGLImageNativeSurface &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Useful libraries'''==&lt;br /&gt;
&lt;br /&gt;
waffle-gl/waffle: A C library for selecting an OpenGL API and window system at runtime.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
The aim is to use ES2 implementation of rust layers for both android and Linux. So we need to use a design pattern that will allow us to extend the current implementation to support Linux targets too and give the user the flexibility to choose between the two implementations for rendering the backend.&lt;br /&gt;
&lt;br /&gt;
We propose to use [https://en.wikipedia.org/wiki/Decorator_pattern Decorator] pattern. The decorator pattern gives the user the ability to choose between the implementations that are desired, and attach the corresponding implementation to the target dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100025</id>
		<title>CSC/ECE 517 Fall 2015/M1506-Refactor-GLES2-Implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100025"/>
		<updated>2015-12-03T21:49:30Z</updated>

		<summary type="html">&lt;p&gt;Djain2: /* Servo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We added a command line option which lets the user enter the option &amp;lt;code&amp;gt;-E&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--es2&amp;lt;/code&amp;gt; if the user wants to set ES2 as the graphic back end option. GL is set by default, hence if the user doesn't give any argument, Gl is selected as the graphic back end option. Example is as below&lt;br /&gt;
    ./mach run [url] -E&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function. For this, we did the following change:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; and then based on the boolean value from the servo &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, we set a variable with the respective enum value &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Then, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
* Now we need to change the platform implementation in [https://github.com/servo/rust-layers/blob/master/src/platform/surface.rs surface.rs] and provide a generic implementation to dynamically select between GL &amp;amp; ES2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:RefactorGLESMozilla.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Requirement Analysis'''==&lt;br /&gt;
&lt;br /&gt;
Earlier, only [https://en.wikipedia.org/wiki/OpenGL OpenGL] implementation was supported for Android targets and we would be extending the [https://en.wikipedia.org/wiki/OpenGL_ES#2.0 ES2] implementation to support it for Linux targets. As a part of the final project, we accomplished the following steps:&lt;br /&gt;
&lt;br /&gt;
* Enable selection of the render api working from the command line, so the user can pick whether to use GL or ES2&lt;br /&gt;
* Modify the necessary files so that the current version of GL or ES2 are returned whenever either of them are selected&lt;br /&gt;
* Make the EGL libs available on Linux for rust-layers to compile rust-egl on Linux build.&lt;br /&gt;
* Separate out the EGLImageNativeSurface implementation from Android and move it to EGL&lt;br /&gt;
* Enable use of EGL or GLX for Linux&lt;br /&gt;
&lt;br /&gt;
=='''Implementation'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
  Servo/components/utils/opts.rs&lt;br /&gt;
added the new command line option to enable user to select the option of GL or ES2 as the rendering backend. The options of GL or ES2 are stored as an enum called RenderApi , such that running the Servo with option --render-api=chosen_option sets the corresponding Api.&lt;br /&gt;
&lt;br /&gt;
  Servo/ports/glutin/window.rs&lt;br /&gt;
&amp;lt;code&amp;gt;gl_version()&amp;lt;/code&amp;gt; function is modified in a way that based on what is selected as the RenderApi option by the user, the corresponding version of the Api is set. To talk more in detail, if the render api is set to GL, it returns the current value (GL 2.1) &amp;amp; if set to ES2, it returns OpenGlEs 2.0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;native_display()&amp;lt;/code&amp;gt; for linux target is also modified to call the specific NativeDisplay constructor based on the RenderApi option chosen by the user. Hence for the GL case, the existing NativeDisplay::new constructor is called, but if ES2 is selected, NativeDisplay::from_es2() is called, which has been introduced by us in an attempt to support ES2 for the linux platform as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Rust-Layers===&lt;br /&gt;
&lt;br /&gt;
=='''Useful libraries'''==&lt;br /&gt;
&lt;br /&gt;
waffle-gl/waffle: A C library for selecting an OpenGL API and window system at runtime.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
The aim is to use ES2 implementation of rust layers for both android and Linux. So we need to use a design pattern that will allow us to extend the current implementation to support Linux targets too and give the user the flexibility to choose between the two implementations for rendering the backend.&lt;br /&gt;
&lt;br /&gt;
We propose to use [https://en.wikipedia.org/wiki/Decorator_pattern Decorator] pattern. The decorator pattern gives the user the ability to choose between the implementations that are desired, and attach the corresponding implementation to the target dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100023</id>
		<title>CSC/ECE 517 Fall 2015/M1506-Refactor-GLES2-Implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100023"/>
		<updated>2015-12-03T21:39:02Z</updated>

		<summary type="html">&lt;p&gt;Djain2: /* Files modified */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We added a command line option which lets the user enter the option &amp;lt;code&amp;gt;-E&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--es2&amp;lt;/code&amp;gt; if the user wants to set ES2 as the graphic back end option. GL is set by default, hence if the user doesn't give any argument, Gl is selected as the graphic back end option. Example is as below&lt;br /&gt;
    ./mach run [url] -E&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function. For this, we did the following change:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; and then based on the boolean value from the servo &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, we set a variable with the respective enum value &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Then, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
* Now we need to change the platform implementation in [https://github.com/servo/rust-layers/blob/master/src/platform/surface.rs surface.rs] and provide a generic implementation to dynamically select between GL &amp;amp; ES2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:RefactorGLESMozilla.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Requirement Analysis'''==&lt;br /&gt;
&lt;br /&gt;
Earlier, only [https://en.wikipedia.org/wiki/OpenGL OpenGL] implementation was supported for Android targets and we would be extending the [https://en.wikipedia.org/wiki/OpenGL_ES#2.0 ES2] implementation to support it for Linux targets. As a part of the final project, we accomplished the following steps:&lt;br /&gt;
&lt;br /&gt;
* Enable selection of the render api working from the command line, so the user can pick whether to use GL or ES2&lt;br /&gt;
* Modify the necessary files so that the current version of GL or ES2 are returned whenever either of them are selected&lt;br /&gt;
* Make the EGL libs available on Linux for rust-layers to compile rust-egl on Linux build.&lt;br /&gt;
* Separate out the EGLImageNativeSurface implementation from Android and move it to EGL&lt;br /&gt;
* Enable use of EGL or GLX for Linux&lt;br /&gt;
&lt;br /&gt;
=='''Files modified'''==&lt;br /&gt;
&lt;br /&gt;
===Servo===&lt;br /&gt;
&lt;br /&gt;
  Servo/components/utils/opts.rs&lt;br /&gt;
added the new command line option to enable user to select the option of GL or ES2 as the rendering backend. The options of GL or ES2 are stored as an enum called RenderApi , such that running the Servo with option --render-api=chosen_option sets the corresponding Api.&lt;br /&gt;
&lt;br /&gt;
  Servo/ports/glutin/window.rs&lt;br /&gt;
&amp;lt;code&amp;gt;gl_version()&amp;lt;/code&amp;gt; function is modified in a way that based on what is selected as the RenderApi option by the user, the corresponding version of the Api is set. To talk more in detail, if the render api is set to GL, it returns the current value (GL 2.1) &amp;amp; if set to ES2, it returns OpenGlEs 2.0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rust-layers/src/platform/surface.rs: providing generic GL implementation that can dynamically select between the 2 interfaces.&lt;br /&gt;
&lt;br /&gt;
=='''Useful libraries'''==&lt;br /&gt;
&lt;br /&gt;
waffle-gl/waffle: A C library for selecting an OpenGL API and window system at runtime.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
The aim is to use ES2 implementation of rust layers for both android and Linux. So we need to use a design pattern that will allow us to extend the current implementation to support Linux targets too and give the user the flexibility to choose between the two implementations for rendering the backend.&lt;br /&gt;
&lt;br /&gt;
We propose to use [https://en.wikipedia.org/wiki/Decorator_pattern Decorator] pattern. The decorator pattern gives the user the ability to choose between the implementations that are desired, and attach the corresponding implementation to the target dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100020</id>
		<title>CSC/ECE 517 Fall 2015/M1506-Refactor-GLES2-Implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100020"/>
		<updated>2015-12-03T21:19:19Z</updated>

		<summary type="html">&lt;p&gt;Djain2: /* Files modified */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We added a command line option which lets the user enter the option &amp;lt;code&amp;gt;-E&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--es2&amp;lt;/code&amp;gt; if the user wants to set ES2 as the graphic back end option. GL is set by default, hence if the user doesn't give any argument, Gl is selected as the graphic back end option. Example is as below&lt;br /&gt;
    ./mach run [url] -E&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function. For this, we did the following change:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; and then based on the boolean value from the servo &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, we set a variable with the respective enum value &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Then, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
* Now we need to change the platform implementation in [https://github.com/servo/rust-layers/blob/master/src/platform/surface.rs surface.rs] and provide a generic implementation to dynamically select between GL &amp;amp; ES2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:RefactorGLESMozilla.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Requirement Analysis'''==&lt;br /&gt;
&lt;br /&gt;
Earlier, only [https://en.wikipedia.org/wiki/OpenGL OpenGL] implementation was supported for Android targets and we would be extending the [https://en.wikipedia.org/wiki/OpenGL_ES#2.0 ES2] implementation to support it for Linux targets. As a part of the final project, we accomplished the following steps:&lt;br /&gt;
&lt;br /&gt;
* Enable selection of the render api working from the command line, so the user can pick whether to use GL or ES2&lt;br /&gt;
* Modify the necessary files so that the current version of GL or ES2 are returned whenever either of them are selected&lt;br /&gt;
* Make the EGL libs available on Linux for rust-layers to compile rust-egl on Linux build.&lt;br /&gt;
* Separate out the EGLImageNativeSurface implementation from Android and move it to EGL&lt;br /&gt;
* Enable use of EGL or GLX for Linux&lt;br /&gt;
&lt;br /&gt;
=='''Files modified'''==&lt;br /&gt;
&lt;br /&gt;
  Servo/components/utils/opts.rs&lt;br /&gt;
added the new command line option to enable user to select the option of GL or ES2 as the rendering backend. The options of GL or ES2 are stored as an enum called RenderApi , such that running the Servo with option --render-api=chosen_option sets the corresponding Api.&lt;br /&gt;
&lt;br /&gt;
  Servo/ports/glutin/window.rs&lt;br /&gt;
&amp;lt;code&amp;gt;gl_version()&amp;lt;/code&amp;gt; function is modified in a way that based on what is selected as the RenderApi option by the user, the corresponding version of the Api is set. To talk more in detail,&lt;br /&gt;
&lt;br /&gt;
=='''Files to be modified'''==&lt;br /&gt;
&lt;br /&gt;
rust-layers/src/platform/surface.rs: providing generic GL implementation that can dynamically select between the 2 interfaces.&lt;br /&gt;
&lt;br /&gt;
=='''Useful libraries'''==&lt;br /&gt;
&lt;br /&gt;
waffle-gl/waffle: A C library for selecting an OpenGL API and window system at runtime.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
The aim is to use ES2 implementation of rust layers for both android and Linux. So we need to use a design pattern that will allow us to extend the current implementation to support Linux targets too and give the user the flexibility to choose between the two implementations for rendering the backend.&lt;br /&gt;
&lt;br /&gt;
We propose to use [https://en.wikipedia.org/wiki/Decorator_pattern Decorator] pattern. The decorator pattern gives the user the ability to choose between the implementations that are desired, and attach the corresponding implementation to the target dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
=='''To Be Determined Information'''==&lt;br /&gt;
* Whether waffle-gl is to be imported, or simply used as example for base functionality&lt;br /&gt;
* Where android surface.rs  implements ES2 vs GL (ie, what is the dividing line between a GL graphics implementation, and an ES2 graphics implementation).&lt;br /&gt;
* Acquiring Android interface to test modified “general” GL_ES implementation.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100018</id>
		<title>CSC/ECE 517 Fall 2015/M1506-Refactor-GLES2-Implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=100018"/>
		<updated>2015-12-03T21:09:35Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We added a command line option which lets the user enter the option &amp;lt;code&amp;gt;-E&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--es2&amp;lt;/code&amp;gt; if the user wants to set ES2 as the graphic back end option. GL is set by default, hence if the user doesn't give any argument, Gl is selected as the graphic back end option. Example is as below&lt;br /&gt;
    ./mach run [url] -E&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function. For this, we did the following change:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; and then based on the boolean value from the servo &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, we set a variable with the respective enum value &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Then, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
* Now we need to change the platform implementation in [https://github.com/servo/rust-layers/blob/master/src/platform/surface.rs surface.rs] and provide a generic implementation to dynamically select between GL &amp;amp; ES2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:RefactorGLESMozilla.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Requirement Analysis'''==&lt;br /&gt;
&lt;br /&gt;
Earlier, only [https://en.wikipedia.org/wiki/OpenGL OpenGL] implementation was supported for Linux targets and we would be extending the [https://en.wikipedia.org/wiki/OpenGL_ES#2.0 ES2] implementation to support it for linux targets too. As a part of the final project, we propose to perform the following steps:&lt;br /&gt;
&lt;br /&gt;
* Change the platform implementation to provide a more generic way to dynamically select between GL and ES2. &lt;br /&gt;
* Remove the Linux/Android specific #cfg flags.&lt;br /&gt;
* Place a general #cfg flag for both Android and Linux to provide a more generic implementation of dynamic selection between GL and ES2&lt;br /&gt;
* Make changes to EGL platform to make it work on desktop GL&lt;br /&gt;
&lt;br /&gt;
=='''Files modified'''==&lt;br /&gt;
&lt;br /&gt;
    Servo/components/utils/opts.rs&lt;br /&gt;
added the new command line option to allow selecting the graphics backend.&lt;br /&gt;
rust-layers/src/rendergl.rs: changed the RenderContext new function to allow the dynamic selection of graphics backend.&lt;br /&gt;
&lt;br /&gt;
=='''Files to be modified'''==&lt;br /&gt;
&lt;br /&gt;
rust-layers/src/platform/surface.rs: providing generic GL implementation that can dynamically select between the 2 interfaces.&lt;br /&gt;
&lt;br /&gt;
=='''Useful libraries'''==&lt;br /&gt;
&lt;br /&gt;
waffle-gl/waffle: A C library for selecting an OpenGL API and window system at runtime.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
The aim is to use ES2 implementation of rust layers for both android and Linux. So we need to use a design pattern that will allow us to extend the current implementation to support Linux targets too and give the user the flexibility to choose between the two implementations for rendering the backend.&lt;br /&gt;
&lt;br /&gt;
We propose to use [https://en.wikipedia.org/wiki/Decorator_pattern Decorator] pattern. The decorator pattern gives the user the ability to choose between the implementations that are desired, and attach the corresponding implementation to the target dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
=='''To Be Determined Information'''==&lt;br /&gt;
* Whether waffle-gl is to be imported, or simply used as example for base functionality&lt;br /&gt;
* Where android surface.rs  implements ES2 vs GL (ie, what is the dividing line between a GL graphics implementation, and an ES2 graphics implementation).&lt;br /&gt;
* Acquiring Android interface to test modified “general” GL_ES implementation.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=99681</id>
		<title>CSC/ECE 517 Fall 2015/M1506-Refactor-GLES2-Implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=99681"/>
		<updated>2015-11-13T22:30:45Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We added a command line option which lets the user enter the option &amp;lt;code&amp;gt;-E&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--es2&amp;lt;/code&amp;gt; if the user wants to set ES2 as the graphic back end option. GL is set by default, hence if the user doesn't give any argument, Gl is selected as the graphic back end option. Example is as below&lt;br /&gt;
    ./mach run [url] -E&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function. For this, we did the following change:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; and then based on the boolean value from the servo &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, we set a variable with the respective enum value &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Then, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
* Now we need to change the platform implementation in [https://github.com/servo/rust-layers/blob/master/src/platform/surface.rs surface.rs] and provide a generic implementation to dynamically select between GL &amp;amp; ES2.&lt;br /&gt;
&lt;br /&gt;
=='''Requirement Analysis'''==&lt;br /&gt;
&lt;br /&gt;
Earlier, only [https://en.wikipedia.org/wiki/OpenGL OpenGL] implementation was supported for Linux targets and we would be extending the [https://en.wikipedia.org/wiki/OpenGL_ES#2.0 ES2] implementation to support it for linux targets too. As a part of the final project, we propose to perform the following steps:&lt;br /&gt;
&lt;br /&gt;
* Change the platform implementation to provide a more generic way to dynamically select between GL and ES2. &lt;br /&gt;
* Remove the Linux/Android specific #cfg flags.&lt;br /&gt;
* Place a general #cfg flag for both Android and Linux to provide a more generic implementation of dynamic selection between GL and ES2&lt;br /&gt;
* Make changes to EGL platform to make it work on desktop GL&lt;br /&gt;
&lt;br /&gt;
=='''Files modified'''==&lt;br /&gt;
&lt;br /&gt;
Servo/components/utils/opts.rs: added the new command line option to allow selecting the graphics backend.&lt;br /&gt;
rust-layers/src/rendergl.rs: changed the RenderContext new function to allow the dynamic selection of graphics backend.&lt;br /&gt;
&lt;br /&gt;
=='''Files to be modified'''==&lt;br /&gt;
&lt;br /&gt;
rust-layers/src/platform/surface.rs: providing generic GL implementation that can dynamically select between the 2 interfaces.&lt;br /&gt;
&lt;br /&gt;
=='''Useful libraries'''==&lt;br /&gt;
&lt;br /&gt;
waffle-gl/waffle: A C library for selecting an OpenGL API and window system at runtime.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
The aim is to use ES2 implementation of rust layers for both android and Linux. So we need to use a design pattern that will allow us to extend the current implementation to support Linux targets too and give the user the flexibility to choose between the two implementations for rendering the backend.&lt;br /&gt;
&lt;br /&gt;
We propose to use “Decorator” pattern. The decorator pattern gives the user the ability to choose between the implementations that are desired, and attach the corresponding implementation to the target dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
=='''To Be Determined Information'''==&lt;br /&gt;
* Whether waffle-gl is to be imported, or simply used as example for base functionality&lt;br /&gt;
* Where android surface.rs  implements ES2 vs GL (ie, what is the dividing line between a GL graphics implementation, and an ES2 graphics implementation).&lt;br /&gt;
* Acquiring Android interface to test modified “general” GL_ES implementation.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=99677</id>
		<title>CSC/ECE 517 Fall 2015/M1506-Refactor-GLES2-Implementation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/M1506-Refactor-GLES2-Implementation&amp;diff=99677"/>
		<updated>2015-11-13T22:22:05Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We added a command line option which lets the user enter the option &amp;lt;code&amp;gt;-E&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--es2&amp;lt;/code&amp;gt; if the user wants to set ES2 as the graphic back end option. GL is set by default, hence if the user doesn't give any argument, Gl is selected as the graphic back end option. Example is as below&lt;br /&gt;
    ./mach run [url] -E&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function. For this, we did the following change:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; and then based on the boolean value from the servo &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, we set a variable with the respective enum value &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Then, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
* Now &lt;br /&gt;
&lt;br /&gt;
=='''Requirement Analysis'''==&lt;br /&gt;
&lt;br /&gt;
Earlier, only [https://en.wikipedia.org/wiki/OpenGL OpenGL] implementation was supported for Linux targets and we would be extending the [https://en.wikipedia.org/wiki/OpenGL_ES#2.0 ES2] implementation to support it for linux targets too. As a part of the final project, we propose to perform the following steps:&lt;br /&gt;
&lt;br /&gt;
* Change the platform implementation to provide a more generic way to dynamically select between GL and ES2. &lt;br /&gt;
* Remove the Linux/Android specific #cfg flags.&lt;br /&gt;
* Place a general #cfg flag for both Android and Linux to provide a more generic implementation of dynamic selection between GL and ES2&lt;br /&gt;
* Make changes to EGL platform to make it work on desktop GL&lt;br /&gt;
&lt;br /&gt;
=='''Files modified'''==&lt;br /&gt;
&lt;br /&gt;
Servo/components/utils/opts.rs: added the new command line option to allow selecting the graphics backend.&lt;br /&gt;
rust-layers/src/rendergl.rs: changed the RenderContext new function to allow the dynamic selection of graphics backend.&lt;br /&gt;
&lt;br /&gt;
=='''Files to be modified'''==&lt;br /&gt;
&lt;br /&gt;
rust-layers/src/platform/surface.rs: providing generic GL implementation that can dynamically select between the 2 interfaces.&lt;br /&gt;
&lt;br /&gt;
=='''Useful libraries'''==&lt;br /&gt;
&lt;br /&gt;
waffle-gl/waffle: A C library for selecting an OpenGL API and window system at runtime.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
The aim is to use ES2 implementation of rust layers for both android and Linux. So we need to use a design pattern that will allow us to extend the current implementation to support Linux targets too and give the user the flexibility to choose between the two implementations for rendering the backend.&lt;br /&gt;
&lt;br /&gt;
We propose to use “Decorator” pattern. The decorator pattern gives the user the ability to choose between the implementations that are desired, and attach the corresponding implementation to the target dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
=='''To Be Determined Information'''==&lt;br /&gt;
* Whether waffle-gl is to be imported, or simply used as example for base functionality&lt;br /&gt;
* Where android surface.rs  implements ES2 vs GL (ie, what is the dividing line between a GL graphics implementation, and an ES2 graphics implementation).&lt;br /&gt;
* Acquiring Android interface to test modified “general” GL_ES implementation.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
After making our changes , the user can now dynamically pass in the option of GL or ES2 through the graphic command line option, and this option is passed on through the compositor to the rust layers during initialization. A video demonstration for the code changes is available [https://drive.google.com/file/d/0B9TVPg3YRoHqQUlvQXZkUUJPRzA/view?usp=sharing here]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97377</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97377"/>
		<updated>2015-10-30T21:53:06Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We added a command line option which lets the user enter the option &amp;lt;code&amp;gt;-E&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--es2&amp;lt;/code&amp;gt; if the user wants to set ES2 as the graphic back end option. GL is set by default, hence if the user doesn't give any argument, Gl is selected as the graphic back end option. Example is as below&lt;br /&gt;
    ./mach run [url] -E&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function. For this, we did the following change:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; and then based on the boolean value from the servo &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, we set a variable with the respective enum value &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Finally, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
We attempted to follow good OO practices by implementing the [https://en.wikipedia.org/wiki/Strategy_pattern Strategy design pattern] using Enum. &lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
After making our changes , the user can now dynamically pass in the option of GL or ES2 through the graphic command line option, and this option is passed on through the compositor to the rust layers during initialization. A video demonstration for the code changes is available [https://drive.google.com/file/d/0B9TVPg3YRoHqQUlvQXZkUUJPRzA/view?usp=sharing here]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97375</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97375"/>
		<updated>2015-10-30T21:50:42Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We added a command line option which lets the user enter the option &amp;lt;code&amp;gt;-E&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--es2&amp;lt;/code&amp;gt; if the user wants to set ES2 as the graphic back end option. GL is set by default, hence if the user doesn't give any argument, Gl is selected as the graphic back end option. Example is as below&lt;br /&gt;
    ./mach run [url] -E&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function. For this, we did the following change:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; and then based on the boolean value from the servo &amp;lt;code&amp;gt;opts.rs&amp;lt;/code&amp;gt;, we set a variable with the respective enum value &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Finally, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
We attempted to follow good OO practices by implementing the [https://en.wikipedia.org/wiki/Strategy_pattern Strategy design pattern] using Enum. &lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
After making our changes , the user can now dynamically pass in the option of GL or ES2 through the graphic command line option, and this option is passed on through the compositor to the rust layers during initialization. A video demonstration for the code changes is available [https://drive.google.com/file/d/0B9TVPg3YRoHqZmxmN1RLcTdHLXc/view here]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97168</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97168"/>
		<updated>2015-10-25T22:00:05Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; in [https://github.com/prashantgupta24/servo/blob/master/components/util/opts.rs opts.rs], default being &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
- We added a command line option which lets the user enter the option in the form of a string. Example is as below&lt;br /&gt;
    ./mach run [url] -G GL/ES2&lt;br /&gt;
- We compare the string entered through command line against the enum values and return an error if the string entered is not GL or ES2.&lt;br /&gt;
    error: graphics option should be GL or ES2&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function.&lt;br /&gt;
* Finally, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
We attempted to follow good OO practices by implementing the [https://en.wikipedia.org/wiki/Strategy_pattern Strategy design pattern] using Enum. &lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
After making our changes , the user can now dynamically pass in the option of GL or ES2 through the graphic command line option, and this option is passed on through the compositor to the rust layers during initialization. A video demonstration for the code changes is available [https://drive.google.com/file/d/0B9TVPg3YRoHqZmxmN1RLcTdHLXc/view here]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97167</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97167"/>
		<updated>2015-10-25T21:59:02Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; in [https://github.com/prashantgupta24/servo/blob/master/components/util/opts.rs opts.rs], default being &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
- We added a command line option which lets the user enter the option in the form of a string. Example is as below&lt;br /&gt;
    ./mach run [url] -G GL/ES2&lt;br /&gt;
- We compare the string entered through command line against the enum values and return an error if the string entered is not GL or ES2.&lt;br /&gt;
    error: graphics option should be GL or ES2&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function.&lt;br /&gt;
* Finally, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
We attempted to follow good OO practices by implementing the [(https://en.wikipedia.org/wiki/Strategy_pattern Strategy design pattern] using Enum. &lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
After making our changes , the user can now dynamically pass in the option of GL or ES2 through the graphic command line option, and this option is passed on through the compositor to the rust layers during initialization. A video demonstration for the code changes is available [https://drive.google.com/file/d/0B9TVPg3YRoHqZmxmN1RLcTdHLXc/view here]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&amp;lt;br&amp;gt;&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&amp;lt;br&amp;gt;&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&amp;lt;br&amp;gt;&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&amp;lt;br&amp;gt;&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&amp;lt;br&amp;gt;&lt;br /&gt;
6.    http://rustbyexample.com/&amp;lt;br&amp;gt;&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97166</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97166"/>
		<updated>2015-10-25T21:57:07Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo/&amp;lt;/ref&amp;gt; is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; in [https://github.com/prashantgupta24/servo/blob/master/components/util/opts.rs opts.rs], default being &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
- We added a command line option which lets the user enter the option in the form of a string. Example is as below&lt;br /&gt;
    ./mach run [url] -G GL/ES2&lt;br /&gt;
- We compare the string entered through command line against the enum values and return an error if the string entered is not GL or ES2.&lt;br /&gt;
    error: graphics option should be GL or ES2&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function.&lt;br /&gt;
* Finally, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
We attempted to follow good OO practices by implementing the [(https://en.wikipedia.org/wiki/Strategy_pattern Strategy design pattern] using Enum. &lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
After making our changes , the user can now dynamically pass in the option of GL or ES2 through the graphic command line option, and this option is passed on through the compositor to the rust layers during initialization. A video demonstration for the code changes is available [https://drive.google.com/file/d/0B9TVPg3YRoHqZmxmN1RLcTdHLXc/view here]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&lt;br /&gt;
2.    https://en.wikipedia.org/wiki/Rust_(programming_language)&lt;br /&gt;
3.    https://en.wikipedia.org/wiki/Servo_(layout_engine)&lt;br /&gt;
4.    https://github.com/servo/servo/wiki/Refactor-GLES2-student-project&lt;br /&gt;
5.    http://doc.crates.io/guide.html#overriding-dependencies&lt;br /&gt;
6.    http://rustbyexample.com/&lt;br /&gt;
7.    http://javarevisited.blogspot.com/2014/11/strategy-design-pattern-in-java-using-Enum-Example.html&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97165</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97165"/>
		<updated>2015-10-25T21:54:39Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo/&amp;lt;/ref&amp;gt; is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; in [https://github.com/prashantgupta24/servo/blob/master/components/util/opts.rs opts.rs], default being &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
- We added a command line option which lets the user enter the option in the form of a string. Example is as below&lt;br /&gt;
    ./mach run [url] -G GL/ES2&lt;br /&gt;
- We compare the string entered through command line against the enum values and return an error if the string entered is not GL or ES2.&lt;br /&gt;
    error: graphics option should be GL or ES2&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function.&lt;br /&gt;
* Finally, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
We attempted to follow good OO practices by implementing the [(https://en.wikipedia.org/wiki/Strategy_pattern Strategy design pattern] using Enum. &lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
After making our changes , the user can now dynamically pass in the option of GL or ES2 through the graphic command line option, and this option is passed on through the compositor to the rust layers during initialization. A video demonstration for the code changes is available [https://drive.google.com/file/d/0B9TVPg3YRoHqZmxmN1RLcTdHLXc/view here]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
1.    https://doc.rust-lang.org/stable/book/&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97164</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97164"/>
		<updated>2015-10-25T21:53:39Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo/&amp;lt;/ref&amp;gt; is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; in [https://github.com/prashantgupta24/servo/blob/master/components/util/opts.rs opts.rs], default being &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
- We added a command line option which lets the user enter the option in the form of a string. Example is as below&lt;br /&gt;
    ./mach run [url] -G GL/ES2&lt;br /&gt;
- We compare the string entered through command line against the enum values and return an error if the string entered is not GL or ES2.&lt;br /&gt;
    error: graphics option should be GL or ES2&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function.&lt;br /&gt;
* Finally, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
We attempted to follow good OO practices by implementing the [(https://en.wikipedia.org/wiki/Strategy_pattern Strategy design pattern] using Enum. &lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
After making our changes , the user can now dynamically pass in the option of GL or ES2 through the graphic command line option, and this option is passed on through the compositor to the rust layers during initialization. A video demonstration for the code changes is available [https://drive.google.com/file/d/0B9TVPg3YRoHqZmxmN1RLcTdHLXc/view here]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97163</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97163"/>
		<updated>2015-10-25T21:51:44Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo/&amp;lt;/ref&amp;gt; is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; in [https://github.com/prashantgupta24/servo/blob/master/components/util/opts.rs opts.rs], default being &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
- We added a command line option which lets the user enter the option in the form of a string. Example is as below&lt;br /&gt;
    ./mach run [url] -G GL/ES2&lt;br /&gt;
- We compare the string entered through command line against the enum values and return an error if the string entered is not GL or ES2.&lt;br /&gt;
    error: graphics option should be GL or ES2&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function.&lt;br /&gt;
* Finally, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
We attempted to follow good OO practices by implementing the [(https://en.wikipedia.org/wiki/Strategy_pattern Strategy design pattern] using Enum. &lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
After making our changes , the user can now dynamically pass in the option of GL or ES2 through the graphic command line option, and this option is passed on through the compositor to the rust layers during initialization. A video demonstration for the code changes is available [https://drive.google.com/file/d/0B9TVPg3YRoHqZmxmN1RLcTdHLXc/view here]&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97162</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97162"/>
		<updated>2015-10-25T21:51:20Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo/&amp;lt;/ref&amp;gt; is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; in [https://github.com/prashantgupta24/servo/blob/master/components/util/opts.rs opts.rs], default being &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
- We added a command line option which lets the user enter the option in the form of a string. Example is as below&lt;br /&gt;
    ./mach run [url] -G GL/ES2&lt;br /&gt;
- We compare the string entered through command line against the enum values and return an error if the string entered is not GL or ES2.&lt;br /&gt;
    error: graphics option should be GL or ES2&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function.&lt;br /&gt;
* Finally, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
We attempted to follow good OO practices by implementing the [(https://en.wikipedia.org/wiki/Strategy_pattern Strategy design pattern] using Enum. &lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
After making our changes , the user can now dynamically pass in the option of GL or ES2 through the graphic command line option, and this option is passed on through the compositor to the rust layers during initialization. A video demonstration for the code changes is available [&lt;br /&gt;
https://drive.google.com/file/d/0B9TVPg3YRoHqZmxmN1RLcTdHLXc/view here]&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97161</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97161"/>
		<updated>2015-10-25T21:49:54Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo/&amp;lt;/ref&amp;gt; is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; in [https://github.com/prashantgupta24/servo/blob/master/components/util/opts.rs opts.rs], default being &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
- We added a command line option which lets the user enter the option in the form of a string. Example is as below&lt;br /&gt;
    ./mach run [url] -G GL/ES2&lt;br /&gt;
- We compare the string entered through command line against the enum values and return an error if the string entered is not GL or ES2.&lt;br /&gt;
    error: graphics option should be GL or ES2&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function.&lt;br /&gt;
* Finally, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
We attempted to follow good OO practices by implementing the [(https://en.wikipedia.org/wiki/Strategy_pattern Strategy design pattern] using Enum. &lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
After making our changes , the user can now dynamically pass in the option of GL or ES2 through the graphic command line option, and this option is passed on through the compositor to the rust layers during initialization. A video demonstration for the code changes is available [https://drive.google.com/a/ncsu.edu/file/d/0B9TVPg3YRoHqZmxmN1RLcTdHLXc/view?ts=562d49d5 here]&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97160</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97160"/>
		<updated>2015-10-25T21:44:09Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo/&amp;lt;/ref&amp;gt; is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; in [https://github.com/prashantgupta24/servo/blob/master/components/util/opts.rs opts.rs], default being &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
- We added a command line option which lets the user enter the option in the form of a string. Example is as below&lt;br /&gt;
    ./mach run [url] -G GL/ES2&lt;br /&gt;
- We compare the string entered through command line against the enum values and return an error if the string entered is not GL or ES2.&lt;br /&gt;
    error: graphics option should be GL or ES2&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs] in the &amp;lt;code&amp;gt;RenderContext::new&amp;lt;/code&amp;gt; function.&lt;br /&gt;
* Finally, we had to use the new command line option to pass the selected graphics back-end option to the Rust-layers context which we created in the previous step. For this we made changes to the [https://github.com/prashantgupta24/servo/blob/master/components/compositing/compositor.rs compositor.rs] in Compositing folder which is how Servo interacts with the Rust layers. The command line option is passed through the &amp;lt;code&amp;gt;initialize_compositing&amp;lt;/code&amp;gt; function.&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97159</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97159"/>
		<updated>2015-10-25T21:37:04Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo/&amp;lt;/ref&amp;gt; is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; in [https://github.com/prashantgupta24/servo/blob/master/components/util/opts.rs opts.rs], default being &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
- We added a command line option which lets the user enter the option in the form of a string. Example is as below&lt;br /&gt;
    ./mach run [url] -G GL/ES2&lt;br /&gt;
- We compare the string entered through command line against the enum values and return an error if the string entered is not GL or ES2.&lt;br /&gt;
    error: graphics option should be GL or ES2&lt;br /&gt;
* Next, we had to add a flag in Rust-layers. This change was made in the file [https://github.com/prashantgupta24/rust-layers/blob/master/src/rendergl.rs Rust/src/rendergl.rs]&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97158</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97158"/>
		<updated>2015-10-25T21:21:13Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo/&amp;lt;/ref&amp;gt; is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; in [https://github.com/prashantgupta24/servo/blob/master/components/util/opts.rs opts.rs], default being &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
- We added a command line option which lets the user enter the option in the form of a string. Example is as below&lt;br /&gt;
    ./mach run [url] -G GL/ES2&lt;br /&gt;
- We compare the string entered through command line against the enum values and return an error if the string entered is not GL or ES2.&lt;br /&gt;
    error: graphics option should be GL or ES2&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97157</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97157"/>
		<updated>2015-10-25T21:15:31Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo/&amp;lt;/ref&amp;gt; is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; in [https://github.com/prashantgupta24/servo/blob/master/components/util/opts.rs opts.rs], default being &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
- We added a command line option which lets the user enter the option in the form of a string. Example is as below&lt;br /&gt;
    ./mach run [url] -G option&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97156</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97156"/>
		<updated>2015-10-25T21:14:54Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo/&amp;lt;/ref&amp;gt; is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
- We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; in [https://github.com/prashantgupta24/servo/blob/master/components/util/opts.rs opts.rs], default being &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt;&lt;br /&gt;
- We added a command line option which lets the user enter the option in the form of a string. Example is as below&lt;br /&gt;
    ./mach run [url] -G option&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97155</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97155"/>
		<updated>2015-10-25T21:10:57Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo/&amp;lt;/ref&amp;gt; is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;br /&gt;
* Next, we had to add a new command line argument in Servo, which would allow selecting the graphics background (GL or ES2). For this, we made the following changes:&lt;br /&gt;
 - We defined an enum &amp;lt;code&amp;gt;GraphicOption&amp;lt;/code&amp;gt; which defined two options &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ES2&amp;lt;/code&amp;gt; in [https://github.com/prashantgupta24/servo/blob/master/components/util/opts.rs opts.rs], default being &amp;lt;code&amp;gt;GL&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97154</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97154"/>
		<updated>2015-10-25T20:54:28Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo/&amp;lt;/ref&amp;gt; is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97153</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97153"/>
		<updated>2015-10-25T20:53:52Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo/&amp;lt;/ref&amp;gt; is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
* The next requirement was to build the Rust-layers independently of Servo. For this, we &lt;br /&gt;
* Next, we had to over-ride cargo to use our local copy of Rust-layers, so we had to add a cargo override to it. For this, we created a &amp;lt;code&amp;gt;.cargo&amp;lt;/code&amp;gt; folder in our home directory(same place that servo and Rust-layers reside), and added a &amp;lt;code&amp;gt;config&amp;lt;code&amp;gt; file to that folder. The content of that config file is a path to our local Rust-layers.&lt;br /&gt;
    paths = [path/to/rust_layers]&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97152</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97152"/>
		<updated>2015-10-25T20:48:38Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo/&amp;lt;/ref&amp;gt; is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
 Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97151</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97151"/>
		<updated>2015-10-25T20:47:54Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo/&amp;lt;/ref&amp;gt; is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
  Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build --dev&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97150</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97150"/>
		<updated>2015-10-25T20:45:43Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo/&amp;lt;/ref&amp;gt; is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
* The project requirement initially stated that we build and Compile servo. Following are the steps for this:&lt;br /&gt;
{{&amp;amp;nbsp}}-{{&amp;amp;nbsp}}Servo is built with [https://mail.mozilla.org/pipermail/rust-dev/2014-March/009090.html Cargo], the Rust package manager. Mozilla's Mach tools are used to orchestrate the build and other tasks.&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97149</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97149"/>
		<updated>2015-10-25T20:40:45Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo/&amp;lt;/ref&amp;gt; is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97148</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97148"/>
		<updated>2015-10-25T20:27:44Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo/&amp;lt;/ref&amp;gt; is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
&lt;br /&gt;
[http://doc.rust-lang.org/book/README.html Rust] is an open source systems programming language developed by Mozilla. Servo is written in Rust. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97147</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97147"/>
		<updated>2015-10-25T20:26:03Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo/&amp;lt;/ref&amp;gt; is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
=='''Introduction'''==&lt;br /&gt;
===Servo===&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
===Rust===&lt;br /&gt;
&lt;br /&gt;
Servo is written in the [http://doc.rust-lang.org/book/README.html Rust] , an open source systems programming language developed by Mozilla. The main purpose behind it's design is to be thread safe and concurrent. The emphasis is also on speed, safety and control of memory layout.&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97146</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97146"/>
		<updated>2015-10-25T20:21:09Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo/&amp;lt;/ref&amp;gt; is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Servo_(layout_engine) Servo]Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in [https://www.rust-lang.org/ Rust] language. The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Servo is written in the [http://doc.rust-lang.org/book/README.html Rust] language, which is also being developed by Mozilla Research. The language is being refined through feedback from Servo development, and writing the Rust compiler itself. Rust is a systems programming language similar to C and C++ in syntax (but semantically very different). The emphasis is on speed, safety, concurrency and control of memory layout.&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97145</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97145"/>
		<updated>2015-10-25T20:16:55Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST ''''&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo/&amp;lt;/ref&amp;gt; is a prototype web browser engine written in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[http://en.wikipedia.org/wiki/JavaScript RUST]&amp;lt;/span&amp;gt; language.Servo uses a variety of back-end implementations for drawing graphics depending on the operating system.One of such back-end is only compatible with Android right now, and we want to extend and refactor that back-end to enable on all Linux systems..&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Mozilla are working on a project called Servo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TEsting&lt;br /&gt;
123&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97144</id>
		<title>CSC/ECE 517 Fall 2015/Mozilla Refactor GLES2</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015/Mozilla_Refactor_GLES2&amp;diff=97144"/>
		<updated>2015-10-25T20:05:02Z</updated>

		<summary type="html">&lt;p&gt;Djain2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Refactor GLES2 Student Project with SERVO &amp;amp; RUST '''&lt;br /&gt;
&lt;br /&gt;
This wiki deals with our implementation of a&amp;lt;code&amp;gt; [http://en.wikipedia.org/wiki/Canvas_element CANVAS] &amp;lt;/code&amp;gt; for the Mozilla Servo Project using the Rust Programming Language.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Mozilla are working on a project called Servo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TEsting&lt;br /&gt;
123&lt;/div&gt;</summary>
		<author><name>Djain2</name></author>
	</entry>
</feed>