<commit_before>/**
 * Manages a stack of WebGL state frames that may be pushed and popped by SceneJS.renderer nodes.
 *  @private
 */
SceneJS._rendererModule = new (function() {

    var canvas;         // Currently active canvas
    var propStack;
    var dirty;

    SceneJS._eventModule.addListener(
            SceneJS._eventModule.SHADER_ACTIVATED,
            function() {
                dirty = true;
            });

    SceneJS._eventModule.addListener(
            SceneJS._eventModule.SHADER_RENDERING,
            function() {
                if (dirty) {
                    SceneJS._eventModule.fireEvent(
                            SceneJS._eventModule.RENDERER_EXPORTED,
                            propStack[propStack.length - 1]);
                    dirty = false;
                }
            });

    SceneJS._eventModule.addListener(
            SceneJS._eventModule.SHADER_DEACTIVATED,
            function() {
                dirty = true;
            });

    var _this = this;
    SceneJS._eventModule.addListener(
            SceneJS._eventModule.CANVAS_ACTIVATED,
            function(c) {
                canvas = c;
                propStack = [];
                var props = _this.createProps({
                    clear: { depth : true, color : true},
                    clearColor: {r: 0, g : 0, b : 0 },
                    clearDepth: 1.0,
                    //enableDepthTest:true,
                    enableCullFace: false,
                    depthRange: { zNear: 0, zFar: 1},
                    enableScissorTest: false,
                    viewport:{ x : 1, y : 1, width: c.canvas.width, height: canvas.canvas.height }
                });
                _this.pushProps(props);
            });

    this.createProps = function(props) {
        var restore;
        if (propStack.length > 0) {  // can't restore when no previous props set
            restore = {};
            for (var name in props) {<commit_msg>Setting initial WebGL props on beginning of traversal<commit_after>/**
 * Manages a stack of WebGL state frames that may be pushed and popped by SceneJS.renderer nodes.
 *  @private
 */
SceneJS._rendererModule = new (function() {

    var canvas;         // Currently active canvas
    var propStack;
    var dirty;

    SceneJS._eventModule.addListener(
            SceneJS._eventModule.SHADER_ACTIVATED,
            function() {
                dirty = true;
            });

    SceneJS._eventModule.addListener(
            SceneJS._eventModule.SHADER_RENDERING,
            function() {
                if (dirty) {
                    SceneJS._eventModule.fireEvent(
                            SceneJS._eventModule.RENDERER_EXPORTED,
                            propStack[propStack.length - 1]);
                    dirty = false;
                }
            });

    SceneJS._eventModule.addListener(
            SceneJS._eventModule.SHADER_DEACTIVATED,
            function() {
                dirty = true;
            });

    var _this = this;
    SceneJS._eventModule.addListener(
            SceneJS._eventModule.CANVAS_ACTIVATED,
            function(c) {
                canvas = c;
                propStack = [];
                var props = _this.createProps({
                    clear: { depth : true, color : true},
                    clearColor: {r: 0, g : 0, b : 0 },
                    clearDepth: 1.0,
                    //enableDepthTest:true,
                    enableCullFace: false,
                    depthRange: { zNear: 0, zFar: 1},
                    enableScissorTest: false,
                    viewport:{ x : 1, y : 1, width: c.canvas.width, height: canvas.canvas.height }
                });
                setProperties(canvas.context, props);
                _this.pushProps(props);
            });

    this.createProps = function(props) {
        var restore;
        if (propStack.length > 0) {  // can't restore when no previous props set
            restore = {};
            for (var name in props) {
{'fraction_non_alphanumeric': 0.09192825112107623, 'fraction_numerical': 0.005480817140009965, 'mean_word_length': 1.3493270918665887, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3090850', 'n_tokens_mistral': 1110, 'n_tokens_neox': 1018, 'n_words': 243}