Changeset 140851 in webkit


Ignore:
Timestamp:
Jan 25, 2013 11:20:08 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Move WebGLErrorsToConsole page setting to window.internals.settings
https://bugs.webkit.org/show_bug.cgi?id=107218

Source/WebCore:

Patch by Arnaud Renevier <a.renevier@sisa.samsung.com> on 2013-01-25
Reviewed by Kenneth Russell.

Define webGLErrorsToConsoleEnabled as true by default. Also,
WebGLRenderingContext::m_synthesizedErrorsToConsole is true by default
and can be disabled by settings.

Add a ConsoleDisplayPreference parameter to synthesizeGLError
(defaults to DisplayInConsole). When called with DontDisplayInConsole,
an error message will not be displayed (even if
m_synthesizedErrorsToConsole is true).

Call synthesizeGLError with DontDisplayInConsole in case of synthetic
context lost.

No new tests: covered by existing tests.

  • html/canvas/WebGLRenderingContext.cpp:

(WebCore):
(WebCore::WebGLRenderingContext::WebGLRenderingContext):
(WebCore::WebGLRenderingContext::setupFlags):
(WebCore::WebGLRenderingContext::validateRenderingState):
(WebCore::WebGLRenderingContext::loseContextImpl):
(WebCore::WebGLRenderingContext::synthesizeGLError):

  • html/canvas/WebGLRenderingContext.h:
  • page/Settings.in:

LayoutTests:

Set WebGLErrorsToConsoleEnabled to false for WebGL tests which have
errors. Some WebGL error messages depend on OpenGL implementations, so
logging error messages would lead to platform specific output.

Patch by Arnaud Renevier <a.renevier@sisa.samsung.com> on 2013-01-25
Reviewed by Kenneth Russell.

  • fast/canvas/webgl/attrib-location-length-limits.html:
  • fast/canvas/webgl/bad-arguments-test.html:
  • fast/canvas/webgl/buffer-bind-test.html:
  • fast/canvas/webgl/buffer-data-array-buffer.html:
  • fast/canvas/webgl/compressed-tex-image.html:
  • fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias.html:
  • fast/canvas/webgl/context-lost-restored.html:
  • fast/canvas/webgl/context-lost.html:
  • fast/canvas/webgl/draw-arrays-out-of-bounds.html:
  • fast/canvas/webgl/draw-elements-out-of-bounds.html:
  • fast/canvas/webgl/error-reporting.html:
  • fast/canvas/webgl/framebuffer-object-attachment.html:
  • fast/canvas/webgl/framebuffer-test.html:
  • fast/canvas/webgl/get-active-test.html:
  • fast/canvas/webgl/gl-bind-attrib-location-test.html:
  • fast/canvas/webgl/gl-enable-enum-test.html:
  • fast/canvas/webgl/gl-enum-tests.html:
  • fast/canvas/webgl/gl-object-get-calls.html:
  • fast/canvas/webgl/gl-uniform-arrays.html:
  • fast/canvas/webgl/gl-uniformmatrix4fv.html:
  • fast/canvas/webgl/gl-vertexattribpointer.html:
  • fast/canvas/webgl/glsl-conformance.html:
  • fast/canvas/webgl/incorrect-context-object-behaviour.html:
  • fast/canvas/webgl/index-validation-copies-indices.html:
  • fast/canvas/webgl/index-validation-verifies-too-many-indices.html:
  • fast/canvas/webgl/index-validation.html:
  • fast/canvas/webgl/invalid-passed-params.html:
  • fast/canvas/webgl/null-object-behaviour.html:
  • fast/canvas/webgl/object-deletion-behaviour.html:
  • fast/canvas/webgl/program-test.html:
  • fast/canvas/webgl/read-pixels-pack-alignment.html:
  • fast/canvas/webgl/read-pixels-test.html:
  • fast/canvas/webgl/script-tests/texImageTest.js:
  • fast/canvas/webgl/shader-deleted-by-accessor.html:
  • fast/canvas/webgl/shader-precision-format.html:
  • fast/canvas/webgl/tex-input-validation.html:
  • fast/canvas/webgl/tex-sub-image-2d-bad-args.html:
  • fast/canvas/webgl/texture-complete.html:
  • fast/canvas/webgl/texture-npot.html:
  • fast/canvas/webgl/type-conversion-test.html:
  • fast/canvas/webgl/uniform-location-length-limits.html:
  • fast/canvas/webgl/uniform-location.html:
  • fast/canvas/webgl/webgl-depth-texture.html:
  • fast/canvas/webgl/webgl-specific.html:
  • fast/canvas/webgl/webgl-texture-binding-preserved.html:
  • inspector/profiler/webgl/webgl-profiler-api-changes.html:
  • inspector/profiler/webgl/webgl-profiler-get-error.html:
Location:
trunk
Files:
52 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r140848 r140851  
     12013-01-25  Arnaud Renevier  <a.renevier@sisa.samsung.com>
     2
     3        Move WebGLErrorsToConsole page setting to window.internals.settings
     4        https://bugs.webkit.org/show_bug.cgi?id=107218
     5
     6        Set WebGLErrorsToConsoleEnabled to false for WebGL tests which have
     7        errors. Some WebGL error messages depend on OpenGL implementations, so
     8        logging error messages would lead to platform specific output.
     9
     10        Reviewed by Kenneth Russell.
     11
     12        * fast/canvas/webgl/attrib-location-length-limits.html:
     13        * fast/canvas/webgl/bad-arguments-test.html:
     14        * fast/canvas/webgl/buffer-bind-test.html:
     15        * fast/canvas/webgl/buffer-data-array-buffer.html:
     16        * fast/canvas/webgl/compressed-tex-image.html:
     17        * fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias.html:
     18        * fast/canvas/webgl/context-lost-restored.html:
     19        * fast/canvas/webgl/context-lost.html:
     20        * fast/canvas/webgl/draw-arrays-out-of-bounds.html:
     21        * fast/canvas/webgl/draw-elements-out-of-bounds.html:
     22        * fast/canvas/webgl/error-reporting.html:
     23        * fast/canvas/webgl/framebuffer-object-attachment.html:
     24        * fast/canvas/webgl/framebuffer-test.html:
     25        * fast/canvas/webgl/get-active-test.html:
     26        * fast/canvas/webgl/gl-bind-attrib-location-test.html:
     27        * fast/canvas/webgl/gl-enable-enum-test.html:
     28        * fast/canvas/webgl/gl-enum-tests.html:
     29        * fast/canvas/webgl/gl-object-get-calls.html:
     30        * fast/canvas/webgl/gl-uniform-arrays.html:
     31        * fast/canvas/webgl/gl-uniformmatrix4fv.html:
     32        * fast/canvas/webgl/gl-vertexattribpointer.html:
     33        * fast/canvas/webgl/glsl-conformance.html:
     34        * fast/canvas/webgl/incorrect-context-object-behaviour.html:
     35        * fast/canvas/webgl/index-validation-copies-indices.html:
     36        * fast/canvas/webgl/index-validation-verifies-too-many-indices.html:
     37        * fast/canvas/webgl/index-validation.html:
     38        * fast/canvas/webgl/invalid-passed-params.html:
     39        * fast/canvas/webgl/null-object-behaviour.html:
     40        * fast/canvas/webgl/object-deletion-behaviour.html:
     41        * fast/canvas/webgl/program-test.html:
     42        * fast/canvas/webgl/read-pixels-pack-alignment.html:
     43        * fast/canvas/webgl/read-pixels-test.html:
     44        * fast/canvas/webgl/script-tests/texImageTest.js:
     45        * fast/canvas/webgl/shader-deleted-by-accessor.html:
     46        * fast/canvas/webgl/shader-precision-format.html:
     47        * fast/canvas/webgl/tex-input-validation.html:
     48        * fast/canvas/webgl/tex-sub-image-2d-bad-args.html:
     49        * fast/canvas/webgl/texture-complete.html:
     50        * fast/canvas/webgl/texture-npot.html:
     51        * fast/canvas/webgl/type-conversion-test.html:
     52        * fast/canvas/webgl/uniform-location-length-limits.html:
     53        * fast/canvas/webgl/uniform-location.html:
     54        * fast/canvas/webgl/webgl-depth-texture.html:
     55        * fast/canvas/webgl/webgl-specific.html:
     56        * fast/canvas/webgl/webgl-texture-binding-preserved.html:
     57        * inspector/profiler/webgl/webgl-profiler-api-changes.html:
     58        * inspector/profiler/webgl/webgl-profiler-get-error.html:
     59
    1602013-01-25  Abhishek Arya  <inferno@chromium.org>
    261
  • trunk/LayoutTests/fast/canvas/webgl/attrib-location-length-limits.html

    r130417 r140851  
    5252    window.initNonKhronosFramework(false);
    5353}
     54if (window.internals)
     55    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    5456
    5557var wtu = WebGLTestUtils;
  • trunk/LayoutTests/fast/canvas/webgl/bad-arguments-test.html

    r98407 r140851  
    1010
    1111<script>
     12if (window.internals)
     13    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
     14
    1215var wtu = WebGLTestUtils;
    1316description("Tests calling WebGL APIs with wrong argument types");
  • trunk/LayoutTests/fast/canvas/webgl/buffer-bind-test.html

    r98407 r140851  
    1616debug("");
    1717debug("Canvas.getContext");
     18
     19if (window.internals)
     20    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    1821
    1922var gl = create3DContext(document.getElementById("canvas"));
  • trunk/LayoutTests/fast/canvas/webgl/buffer-data-array-buffer.html

    r98407 r140851  
    1212
    1313debug('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=41884">https://bugs.webkit.org/show_bug.cgi?id=41884</a> : <code>Implement bufferData and bufferSubData with ArrayBuffer as input</code>');
     14
     15if (window.internals)
     16    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    1417
    1518var gl = create3DContext();
  • trunk/LayoutTests/fast/canvas/webgl/compressed-tex-image.html

    r105706 r140851  
    1515
    1616debug("");
     17
     18if (window.internals)
     19    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    1720
    1821var wtu = WebGLTestUtils;
  • trunk/LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias.html

    r119014 r140851  
    4848        window.initNonKhronosFramework(true);
    4949    }
     50
     51    if (window.internals)
     52        window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    5053
    5154    description('Verify WebGLContextAttributes are working as specified, including alpha, depth, stencil, antialias, but not premultipliedAlpha');
  • trunk/LayoutTests/fast/canvas/webgl/context-lost-restored.html

    r104102 r140851  
    77<script src="resources/webgl-test-utils.js"></script>
    88<script>
     9if (window.internals)
     10    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
     11
    912var wtu = WebGLTestUtils;
    1013var canvas;
  • trunk/LayoutTests/fast/canvas/webgl/context-lost.html

    r104102 r140851  
    77<script src="resources/webgl-test-utils.js"></script>
    88<script>
     9if (window.internals)
     10    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
     11
    912var wtu;
    1013var canvas;
  • trunk/LayoutTests/fast/canvas/webgl/draw-arrays-out-of-bounds.html

    r98407 r140851  
    1010<script>
    1111description("Test of drawArrays with out-of-bounds parameters");
     12
     13if (window.internals)
     14    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    1215
    1316var context = create3DContext();
  • trunk/LayoutTests/fast/canvas/webgl/draw-elements-out-of-bounds.html

    r98407 r140851  
    1010<script>
    1111description("Test of drawElements with out-of-bounds parameters");
     12
     13if (window.internals)
     14    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    1215
    1316var context = create3DContext();
  • trunk/LayoutTests/fast/canvas/webgl/error-reporting.html

    r98407 r140851  
    1010<script>
    1111description("Tests generation of synthetic and real GL errors");
     12
     13if (window.internals)
     14    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    1215
    1316var context = create3DContext();
  • trunk/LayoutTests/fast/canvas/webgl/framebuffer-object-attachment.html

    r123521 r140851  
    1212
    1313<script>
     14if (window.internals)
     15    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
     16
    1417var wtu = WebGLTestUtils;
    1518var gl;
  • trunk/LayoutTests/fast/canvas/webgl/framebuffer-test.html

    r98407 r140851  
    1717debug("");
    1818debug("Canvas.getContext");
     19
     20if (window.internals)
     21    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    1922
    2023var canvas = document.getElementById("canvas");
  • trunk/LayoutTests/fast/canvas/webgl/get-active-test.html

    r98407 r140851  
    1111<script>
    1212description("Test of getActiveAttrib and getActiveUniform");
     13
     14if (window.internals)
     15    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    1316
    1417var context = create3DContext();
  • trunk/LayoutTests/fast/canvas/webgl/gl-bind-attrib-location-test.html

    r98407 r140851  
    3434<script>
    3535description("This test ensures WebGL implementations don't allow names that start with 'gl_' when calling bindAttribLocation.");
     36
     37if (window.internals)
     38    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    3639
    3740debug("");
  • trunk/LayoutTests/fast/canvas/webgl/gl-enable-enum-test.html

    r98407 r140851  
    1818debug("");
    1919debug("Canvas.getContext");
     20
     21if (window.internals)
     22    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    2023
    2124var gl = create3DContext(document.getElementById("canvas"));
  • trunk/LayoutTests/fast/canvas/webgl/gl-enum-tests.html

    r98407 r140851  
    1818debug("");
    1919debug("Canvas.getContext");
     20
     21if (window.internals)
     22    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    2023
    2124var gl = create3DContext(document.getElementById("canvas"));
  • trunk/LayoutTests/fast/canvas/webgl/gl-object-get-calls.html

    r98407 r140851  
    1212<script>
    1313description("Test of get calls against GL objects like getBufferParameter, etc.");
     14
     15if (window.internals)
     16    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    1417
    1518function sizeInBytes(type) {
  • trunk/LayoutTests/fast/canvas/webgl/gl-uniform-arrays.html

    r98407 r140851  
    8282debug("");
    8383
     84if (window.internals)
     85    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
     86
    8487var gl = create3DContext(document.getElementById("example"));
    8588
  • trunk/LayoutTests/fast/canvas/webgl/gl-uniformmatrix4fv.html

    r98407 r140851  
    3737debug("Checking gl.uniformMatrix.");
    3838
     39if (window.internals)
     40    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
     41
    3942gl = initWebGL("example", "vshader", "fshader", [ "vPosition"], [ 0, 0, 0, 1 ], 1);
    4043for (var ii = 2; ii <= 4; ++ii) {
  • trunk/LayoutTests/fast/canvas/webgl/gl-vertexattribpointer.html

    r98407 r140851  
    1919debug("");
    2020debug("Canvas.getContext");
     21
     22if (window.internals)
     23    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    2124
    2225var wtu = WebGLTestUtils;
  • trunk/LayoutTests/fast/canvas/webgl/glsl-conformance.html

    r122281 r140851  
    221221debug("");
    222222debug("Canvas.getContext");
     223
     224if (window.internals)
     225    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    223226
    224227var wtu = WebGLTestUtils;
  • trunk/LayoutTests/fast/canvas/webgl/incorrect-context-object-behaviour.html

    r98407 r140851  
    1010<script>
    1111description("Tests calling WebGL APIs with objects from other contexts");
     12
     13if (window.internals)
     14    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    1215
    1316var contextA = create3DContext();
  • trunk/LayoutTests/fast/canvas/webgl/index-validation-copies-indices.html

    r98407 r140851  
    1010<script>
    1111description('Test that client data is always copied during bufferData and bufferSubData calls, because otherwise the data the GL uses to draw may differ from that checked by the index validation code.')
     12
     13if (window.internals)
     14    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    1215
    1316var context = create3DContext();
  • trunk/LayoutTests/fast/canvas/webgl/index-validation-verifies-too-many-indices.html

    r98407 r140851  
    1010<script>
    1111description('Tests that index validation for drawElements does not examine too many indices');
     12
     13if (window.internals)
     14    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    1215
    1316var context = create3DContext();
  • trunk/LayoutTests/fast/canvas/webgl/index-validation.html

    r116374 r140851  
    1313<script>
    1414description("Tests that index validation verifies the correct number of indices");
     15
     16if (window.internals)
     17    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    1518
    1619function sizeInBytes(type) {
  • trunk/LayoutTests/fast/canvas/webgl/invalid-passed-params.html

    r98407 r140851  
    1111<script>
    1212description("Test for invalid passed parameters");
     13
     14if (window.internals)
     15    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    1316
    1417var context = create3DContext();
  • trunk/LayoutTests/fast/canvas/webgl/null-object-behaviour.html

    r98407 r140851  
    1212var wtu = WebGLTestUtils;
    1313description("Tests calling WebGL APIs without providing the necessary objects");
     14
     15if (window.internals)
     16    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    1417
    1518var context = wtu.create3DContext();
  • trunk/LayoutTests/fast/canvas/webgl/object-deletion-behaviour.html

    r103272 r140851  
    1313<script>
    1414description("Tests deletion behavior for texture, renderbuffer, shader, and program");
     15
     16if (window.internals)
     17    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    1518
    1619var wtu = WebGLTestUtils;
  • trunk/LayoutTests/fast/canvas/webgl/program-test.html

    r98407 r140851  
    1717    debug("");
    1818    debug("Canvas.getContext");
     19
     20    if (window.internals)
     21        window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    1922
    2023    var gl = create3DContext(document.getElementById("canvas"));
  • trunk/LayoutTests/fast/canvas/webgl/read-pixels-pack-alignment.html

    r99258 r140851  
    3232<div id="console"></div>
    3333<script>
     34if (window.internals)
     35    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    3436
    3537// The below declarations need to be global for "shouldBe" to see them
  • trunk/LayoutTests/fast/canvas/webgl/read-pixels-test.html

    r97881 r140851  
    1414<script>
    1515description("Checks that ReadPixels works as expected.");
     16
     17if (window.internals)
     18    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    1619
    1720var wtu = WebGLTestUtils;
  • trunk/LayoutTests/fast/canvas/webgl/script-tests/texImageTest.js

    r98407 r140851  
    11description("Test of texImage2d and texSubImage2d");
     2
     3if (window.internals)
     4    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    25
    36var context = create3DContext();
  • trunk/LayoutTests/fast/canvas/webgl/shader-deleted-by-accessor.html

    r110650 r140851  
    1212
    1313description("Verifies that WebGLRenderingContext::getAttachedShaders doesn't crash when an accessor property is defined on Array.prototype.");
     14
     15if (window.internals)
     16    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    1417
    1518context = create3DContext();
  • trunk/LayoutTests/fast/canvas/webgl/shader-precision-format.html

    r128073 r140851  
    1717    window.initNonKhronosFramework(true);
    1818}
     19
     20if (window.internals)
     21    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    1922
    2023var wtu = WebGLTestUtils;
  • trunk/LayoutTests/fast/canvas/webgl/tex-input-validation.html

    r98407 r140851  
    1010
    1111<script>
     12if (window.internals)
     13    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
     14
    1215var wtu = WebGLTestUtils;
    1316var gl = null;
  • trunk/LayoutTests/fast/canvas/webgl/tex-sub-image-2d-bad-args.html

    r110485 r140851  
    1212<script>
    1313description('Tests texSubImage2D with bad arguments');
     14
     15if (window.internals)
     16    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    1417
    1518var wtu = WebGLTestUtils;
  • trunk/LayoutTests/fast/canvas/webgl/texture-complete.html

    r98407 r140851  
    4444    window.initNonKhronosFramework(false);
    4545  }
     46
     47  if (window.internals)
     48    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    4649
    4750  debug("Checks that a texture that is not -texture-complete- does not draw if"+
  • trunk/LayoutTests/fast/canvas/webgl/texture-npot.html

    r98407 r140851  
    3535</script>
    3636<script>
     37if (window.internals)
     38    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
     39
    3740var wtu = WebGLTestUtils;
    3841var canvas = document.getElementById("example");
  • trunk/LayoutTests/fast/canvas/webgl/type-conversion-test.html

    r98407 r140851  
    1212var wtu = WebGLTestUtils;
    1313description("Tests calling WebGL APIs with various types");
     14
     15if (window.internals)
     16    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    1417
    1518var context = wtu.create3DContext();
  • trunk/LayoutTests/fast/canvas/webgl/uniform-location-length-limits.html

    r130417 r140851  
    7575}
    7676
     77if (window.internals)
     78    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
     79
    7780var wtu = WebGLTestUtils;
    7881var gl = wtu.create3DContext(document.getElementById("example"));
  • trunk/LayoutTests/fast/canvas/webgl/uniform-location.html

    r98407 r140851  
    1010<script>
    1111description("Tests the WebGLUniformLocation API");
     12
     13if (window.internals)
     14    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    1215
    1316var contextA = create3DContext();
  • trunk/LayoutTests/fast/canvas/webgl/webgl-depth-texture.html

    r136990 r140851  
    3838debug("");
    3939
     40if (window.internals)
     41    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
     42
    4043var wtu = WebGLTestUtils;
    4144var canvas = document.getElementById("canvas");
  • trunk/LayoutTests/fast/canvas/webgl/webgl-specific.html

    r113634 r140851  
    1313
    1414<script>
     15if (window.internals)
     16    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
     17
    1518var wtu = WebGLTestUtils;
    1619description("Tests the a few differences between WebGL and GLES2");
  • trunk/LayoutTests/fast/canvas/webgl/webgl-texture-binding-preserved.html

    r131214 r140851  
    1717    testRunner.waitUntilDone();
    1818}
     19
     20if (window.internals)
     21    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    1922
    2023var canvas;
  • trunk/LayoutTests/inspector/profiler/webgl/webgl-profiler-api-changes.html

    r127236 r140851  
    201201        testRunner.waitUntilDone();
    202202    }
     203    if (window.internals)
     204        window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    203205    try {
    204206        test();
  • trunk/LayoutTests/inspector/profiler/webgl/webgl-profiler-get-error.html

    r139729 r140851  
    44    <script src="../canvas-profiler-test.js"></script>
    55<script>
     6if (window.internals)
     7    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
    68
    79/**
  • trunk/Source/WebCore/ChangeLog

    r140850 r140851  
     12013-01-25  Arnaud Renevier  <a.renevier@sisa.samsung.com>
     2
     3        Move WebGLErrorsToConsole page setting to window.internals.settings
     4        https://bugs.webkit.org/show_bug.cgi?id=107218
     5
     6        Reviewed by Kenneth Russell.
     7
     8        Define webGLErrorsToConsoleEnabled as true by default. Also,
     9        WebGLRenderingContext::m_synthesizedErrorsToConsole is true by default
     10        and can be disabled by settings.
     11
     12        Add a ConsoleDisplayPreference parameter to synthesizeGLError
     13        (defaults to DisplayInConsole). When called with DontDisplayInConsole,
     14        an error message will not be displayed (even if
     15        m_synthesizedErrorsToConsole is true).
     16
     17        Call synthesizeGLError with DontDisplayInConsole in case of synthetic
     18        context lost.
     19
     20        No new tests: covered by existing tests.
     21
     22        * html/canvas/WebGLRenderingContext.cpp:
     23        (WebCore):
     24        (WebCore::WebGLRenderingContext::WebGLRenderingContext):
     25        (WebCore::WebGLRenderingContext::setupFlags):
     26        (WebCore::WebGLRenderingContext::validateRenderingState):
     27        (WebCore::WebGLRenderingContext::loseContextImpl):
     28        (WebCore::WebGLRenderingContext::synthesizeGLError):
     29        * html/canvas/WebGLRenderingContext.h:
     30        * page/Settings.in:
     31
    1322013-01-25  Alec Flett  <alecflett@chromium.org>
    233
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp

    r140595 r140851  
    465465    , m_contextLostMode(SyntheticLostContext)
    466466    , m_attributes(attributes)
    467     , m_synthesizedErrorsToConsole(false)
     467    , m_synthesizedErrorsToConsole(true)
    468468    , m_numGLErrorsToConsoleAllowed(maxGLErrorsAllowedToConsole)
    469469{
     
    567567
    568568    Page* p = canvas()->document()->page();
    569     if (p && p->settings()->webGLErrorsToConsoleEnabled())
    570         m_synthesizedErrorsToConsole = true;
     569    if (p)
     570        m_synthesizedErrorsToConsole = p->settings()->webGLErrorsToConsoleEnabled();
    571571
    572572    m_isGLES2Compliant = m_context->isGLES2Compliant();
     
    45474547            break;
    45484548    }
    4549     synthesizeGLError(GraphicsContext3D::CONTEXT_LOST_WEBGL, "loseContext", "context lost");
     4549    ConsoleDisplayPreference display = (mode == RealLostContext) ? DisplayInConsole: DontDisplayInConsole;
     4550    synthesizeGLError(GraphicsContext3D::CONTEXT_LOST_WEBGL, "loseContext", "context lost", display);
    45504551
    45514552    // Don't allow restoration unless the context lost event has both been
     
    57875788} // namespace anonymous
    57885789
    5789 void WebGLRenderingContext::synthesizeGLError(GC3Denum error, const char* functionName, const char* description)
    5790 {
    5791     if (m_synthesizedErrorsToConsole) {
     5790void WebGLRenderingContext::synthesizeGLError(GC3Denum error, const char* functionName, const char* description, ConsoleDisplayPreference display)
     5791{
     5792    if (m_synthesizedErrorsToConsole && display == DisplayInConsole) {
    57925793      String str = String("WebGL: ") + GetErrorString(error) +  ": " + String(functionName) + ": " + String(description);
    57935794      printGLErrorToConsole(str);
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h

    r139142 r140851  
    712712    bool allowPrivilegedExtensions() const;
    713713
     714    enum ConsoleDisplayPreference {
     715        DisplayInConsole,
     716        DontDisplayInConsole
     717    };
     718
    714719    // Wrapper for GraphicsContext3D::synthesizeGLError that sends a message
    715720    // to the JavaScript console.
    716     void synthesizeGLError(GC3Denum, const char* functionName, const char* description);
     721    void synthesizeGLError(GC3Denum, const char* functionName, const char* description, ConsoleDisplayPreference = DisplayInConsole);
    717722
    718723    String ensureNotNull(const String&) const;
  • trunk/Source/WebCore/page/Settings.in

    r140044 r140851  
    9898experimentalNotificationsEnabled initial=false
    9999webGLEnabled initial=false
    100 webGLErrorsToConsoleEnabled initial=false
     100webGLErrorsToConsoleEnabled initial=true
    101101openGLMultisamplingEnabled initial=true
    102102privilegedWebGLExtensionsEnabled initial=false
Note: See TracChangeset for help on using the changeset viewer.