зеркало из https://github.com/mozilla/shumway.git
Adds options to disable scratch canvases logging
This commit is contained in:
Родитель
e81c24367a
Коммит
c9a7f2695b
|
@ -200,12 +200,11 @@ Promise.all([gfxReady, playerReady]).then(function () {
|
|||
|
||||
createOptionsGUI();
|
||||
|
||||
gfxWindow.assetListContainer = document.getElementById("assetList");
|
||||
gfxWindow.scratchCanvasContainer = document.getElementById("scratchCanvasContainer");
|
||||
|
||||
setRelease(state.release);
|
||||
gfxWindow.resizeEaselContainer(state.width, state.height);
|
||||
gfxWindow.setLogAssets(state.logAssets);
|
||||
gfxWindow.setLogAssets(state.logAssets, document.getElementById("assetList"));
|
||||
gfxWindow.setLogScratchCanvases(state.logScratchCanvases,
|
||||
document.getElementById("scratchCanvasContainer"));
|
||||
|
||||
if (state.profileStartup && state.profileStartupDuration > 0) {
|
||||
profiler.start(performance.now(), state.profileStartupDuration, false);
|
||||
|
@ -231,7 +230,11 @@ document.addEventListener('inspectorOptionsChanged', function (e) {
|
|||
setRelease(state.release);
|
||||
break;
|
||||
case 'logAssets':
|
||||
gfxWindow.setLogAssets(state.logAssets);
|
||||
gfxWindow.setLogAssets(state.logAssets, document.getElementById("assetList"));
|
||||
break;
|
||||
case 'logScratchCanvases':
|
||||
gfxWindow.setLogScratchCanvases(state.logScratchCanvases,
|
||||
document.getElementById("scratchCanvasContainer"));
|
||||
break;
|
||||
case 'overlayFlash':
|
||||
gfxWindow.setFlashOverlayState(state.overlayFlash);
|
||||
|
|
|
@ -38,8 +38,15 @@ function setProfile(enabled) {
|
|||
}
|
||||
|
||||
var logAssets = false;
|
||||
function setLogAssets(enabled) {
|
||||
function setLogAssets(enabled, assetListContainer_) {
|
||||
logAssets = enabled;
|
||||
assetListContainer = assetListContainer_;
|
||||
}
|
||||
|
||||
var logScratchCanvases = false;
|
||||
function setLogScratchCanvases(enabled, scratchCanvasContainer_) {
|
||||
logScratchCanvases = enabled;
|
||||
scratchCanvasContainer = scratchCanvasContainer_;
|
||||
}
|
||||
|
||||
function resizeEaselContainer(width, height) {
|
||||
|
@ -168,8 +175,13 @@ HTMLCanvasElement.prototype.getContext = function getContext(contextId, args) {
|
|||
|
||||
var scratchCanvasContainer;
|
||||
function registerScratchCanvas(scratchCanvas) {
|
||||
if (scratchCanvasContainer) {
|
||||
if (logScratchCanvases) {
|
||||
scratchCanvasContainer.appendChild(scratchCanvas);
|
||||
} else {
|
||||
// Temporary hack to work around a bug that prevents SVG filters to work for off-screen canvases.
|
||||
// TODO remove
|
||||
scratchCanvas.style.display = 'none';
|
||||
document.body.appendChild(scratchCanvas);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ var stateDefaults = {
|
|||
logToConsole: false,
|
||||
logToDebugPanel: false,
|
||||
logAssets: false,
|
||||
logScratchCanvases: false,
|
||||
overlayFlash: false,
|
||||
fileReadChunkSize: 0,
|
||||
mute: false,
|
||||
|
@ -84,6 +85,7 @@ function createOptionsGUI() {
|
|||
inspectorOptions.add(state, "logToConsole").onChange(saveInspectorOption);
|
||||
inspectorOptions.add(state, "logToDebugPanel").onChange(saveInspectorOption);
|
||||
inspectorOptions.add(state, "logAssets").onChange(saveInspectorOption);
|
||||
inspectorOptions.add(state, "logScratchCanvases").onChange(saveInspectorOption);
|
||||
inspectorOptions.add(state, "profileStartup").onChange(saveInspectorOption);
|
||||
inspectorOptions.add(state, "profileStartupDuration").onChange(saveInspectorOption);
|
||||
inspectorOptions.add(state, "overlayFlash").onChange(saveInspectorOption);
|
||||
|
|
Загрузка…
Ссылка в новой задаче