<commit_before>// Copyright (c) 2011 Hewlett-Packard Development Company, L.P. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

var ShaderKit = ShaderKit || {};


////////

// canvas - canvas HTML element
ShaderKit.Renderer = function (canvas) {
    this.gl = canvas.getContext("experimental-webgl");
    if (!this.gl)
        throw "This browswer does not have WebGL enabled.";
    this._buildQuad();
}

ShaderKit.Renderer.prototype.enableExtension = function (name) {
    return this.gl.getExtension(name);
}

ShaderKit.Renderer.prototype._buildQuad = function () {
    var gl = this.gl;

    this.vertexBuffer = gl.createBuffer();
    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    gl.bufferData(gl.ARRAY_BUFFER,
                  new Float32Array([ 0, 0, 0, 1, 1, 0, 1, 1 ]),
                  gl.STATIC_DRAW);
}

// shader - Shader to render
// renderTarget - optional RenderTarget, if not specified then render to canvas
ShaderKit.Renderer.prototype.render = function (shader, renderTarget) {
    var gl = this.gl;

    if (renderTarget)
        renderTarget.setCurrent(true);

    // Should use gl.drawingBufferWidth/Height but they aren't implemented
    gl.viewport(0, 0, gl.canvas.clientWidth, gl.canvas.clientHeight);
<commit_msg>Don't antialias ShaderKit.<commit_after>// Copyright (c) 2011 Hewlett-Packard Development Company, L.P. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

var ShaderKit = ShaderKit || {};


////////

// canvas - canvas HTML element
ShaderKit.Renderer = function (canvas) {
    this.gl = canvas.getContext("experimental-webgl", { antialias: false });
    if (!this.gl)
        throw "This browswer does not have WebGL enabled.";
    this._buildQuad();
}

ShaderKit.Renderer.prototype.enableExtension = function (name) {
    return this.gl.getExtension(name);
}

ShaderKit.Renderer.prototype._buildQuad = function () {
    var gl = this.gl;

    this.vertexBuffer = gl.createBuffer();
    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    gl.bufferData(gl.ARRAY_BUFFER,
                  new Float32Array([ 0, 0, 0, 1, 1, 0, 1, 1 ]),
                  gl.STATIC_DRAW);
}

// shader - Shader to render
// renderTarget - optional RenderTarget, if not specified then render to canvas
ShaderKit.Renderer.prototype.render = function (shader, renderTarget) {
    var gl = this.gl;

    if (renderTarget)
        renderTarget.setCurrent(true);

    // Should use gl.drawingBufferWidth/Height but they aren't implemented
    gl.viewport(0, 0, gl.canvas.clientWidth, gl.canvas.clientHeight);

{'fraction_non_alphanumeric': 0.11983624860439152, 'fraction_numerical': 0.01190919240788984, 'mean_word_length': 3.1353846153846154, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '665286', 'n_tokens_mistral': 834, 'n_tokens_neox': 788, 'n_words': 232}