Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
33
gaia/dev_apps/membuster/index.html
Executable file
33
gaia/dev_apps/membuster/index.html
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1">
|
||||
<meta charset="utf-8">
|
||||
<title>Template</title>
|
||||
|
||||
<style>
|
||||
#canvases {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 0px;
|
||||
}
|
||||
canvas {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
}
|
||||
</style>
|
||||
<script src="membuster.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div>
|
||||
<button id="sys">Bust system memory</button>
|
||||
<button id="gfx">Bust graphics memory</button>
|
||||
</div>
|
||||
<div><span id="log"></span></div>
|
||||
<div id="canvases"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
63
gaia/dev_apps/membuster/manifest.webapp
Executable file
63
gaia/dev_apps/membuster/manifest.webapp
Executable file
|
|
@ -0,0 +1,63 @@
|
|||
{
|
||||
"name": "Membuster",
|
||||
"description": "Busts your memory",
|
||||
"launch_path": "/index.html",
|
||||
"developer": {
|
||||
"name": "The Gaia Team",
|
||||
"url": "https://github.com/mozilla-b2g/gaia"
|
||||
},
|
||||
"locales": {
|
||||
"ar": {
|
||||
"name": "Membuster",
|
||||
"description": "Busts your memory"
|
||||
},
|
||||
"de": {
|
||||
"name": "Membuster",
|
||||
"description": "Busts your memory"
|
||||
},
|
||||
"el": {
|
||||
"name": "Membuster",
|
||||
"description": "Busts your memory"
|
||||
},
|
||||
"en-US": {
|
||||
"name": "Membuster",
|
||||
"description": "Busts your memory"
|
||||
},
|
||||
"es": {
|
||||
"name": "Membuster",
|
||||
"description": "Busts your memory"
|
||||
},
|
||||
"fr": {
|
||||
"name": "Membuster",
|
||||
"description": "Busts your memory"
|
||||
},
|
||||
"it": {
|
||||
"name": "Membuster",
|
||||
"description": "Busts your memory"
|
||||
},
|
||||
"pt-BR": {
|
||||
"name": "Membuster",
|
||||
"description": "Busts your memory"
|
||||
},
|
||||
"ru": {
|
||||
"name": "Membuster",
|
||||
"description": "Busts your memory"
|
||||
},
|
||||
"tr": {
|
||||
"name": "Membuster",
|
||||
"description": "Busts your memory"
|
||||
},
|
||||
"zh-TW": {
|
||||
"name": "Membuster",
|
||||
"description": "Busts your memory"
|
||||
}
|
||||
},
|
||||
"default_locale": "en-US",
|
||||
"icons": {
|
||||
"84": "/style/icons/membuster_84.png",
|
||||
"126": "/style/icons/membuster_126.png",
|
||||
"142": "/style/icons/membuster_142.png",
|
||||
"189": "/style/icons/membuster_189.png",
|
||||
"284": "/style/icons/membuster_284.png"
|
||||
}
|
||||
}
|
||||
66
gaia/dev_apps/membuster/membuster.js
Executable file
66
gaia/dev_apps/membuster/membuster.js
Executable file
|
|
@ -0,0 +1,66 @@
|
|||
var arr = [];
|
||||
function bustSysmem() {
|
||||
setInterval(allocChunk, 1000);
|
||||
}
|
||||
|
||||
var chunks = [ ]; // root the chunks
|
||||
var nextChunkMB = 32;
|
||||
var totalAllocMB = 0;
|
||||
function allocChunk() {
|
||||
var allocSizeMB = nextChunkMB * 1024 * 1024;
|
||||
var array = new ArrayBuffer(allocSizeMB);
|
||||
|
||||
// Ensure all pages are committed.
|
||||
var view = new Int32Array(array);
|
||||
for (var j = 0; j < view.length; j += 1024) {
|
||||
view[j] = 42;
|
||||
}
|
||||
|
||||
totalAllocMB += nextChunkMB;
|
||||
log("Allocated "+ nextChunkMB +"MB; total so far is "+ totalAllocMB+ "MB");
|
||||
|
||||
if (nextChunkMB > 1) {
|
||||
nextChunkMB >>= 1
|
||||
}
|
||||
|
||||
chunks.push(array);
|
||||
}
|
||||
|
||||
function bustGfxmem() {
|
||||
setInterval(allocCanvas, 1000);
|
||||
}
|
||||
|
||||
var totalGfxMB = 0;
|
||||
function allocCanvas() {
|
||||
var c = document.createElement("canvas");
|
||||
// We want to allocate 1MB of gfx mem. Canvases are double buffered
|
||||
// and default to RGBA. So we create one with 128K pixels.
|
||||
var w = 128, h = 1024;
|
||||
c.width = w;
|
||||
c.height = h;
|
||||
|
||||
var ctx = c.getContext('2d');
|
||||
ctx.clearRect(0, 0, w, h);
|
||||
ctx.fillStyle = 'rgba(0, 0, 255, 0.1)';
|
||||
ctx.rect(0, 0, w, h);
|
||||
ctx.fill();
|
||||
|
||||
++totalGfxMB;
|
||||
log("Allocated 1MB gfx memory; total so far is ~"+ totalGfxMB +"MB");
|
||||
|
||||
document.getElementById("canvases").appendChild(c);
|
||||
}
|
||||
|
||||
var logElt;
|
||||
function log(msg) {
|
||||
if (!logElt) {
|
||||
logElt = document.getElementById("log");
|
||||
}
|
||||
logElt.textContent = msg;
|
||||
console.log(msg);
|
||||
}
|
||||
|
||||
window.onload = function() {
|
||||
document.getElementById("sys").onclick = function() { bustSysmem(); };
|
||||
document.getElementById("gfx").onclick = function() { bustGfxmem(); };
|
||||
};
|
||||
BIN
gaia/dev_apps/membuster/style/icons/membuster_126.png
Executable file
BIN
gaia/dev_apps/membuster/style/icons/membuster_126.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
BIN
gaia/dev_apps/membuster/style/icons/membuster_142.png
Executable file
BIN
gaia/dev_apps/membuster/style/icons/membuster_142.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 2 KiB |
BIN
gaia/dev_apps/membuster/style/icons/membuster_189.png
Executable file
BIN
gaia/dev_apps/membuster/style/icons/membuster_189.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
BIN
gaia/dev_apps/membuster/style/icons/membuster_284.png
Executable file
BIN
gaia/dev_apps/membuster/style/icons/membuster_284.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 4.4 KiB |
BIN
gaia/dev_apps/membuster/style/icons/membuster_84.png
Executable file
BIN
gaia/dev_apps/membuster/style/icons/membuster_84.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Loading…
Reference in a new issue