Changeset 55419 in webkit


Ignore:
Timestamp:
Mar 2, 2010 11:33:54 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-03-02 Kenneth Russell <kbr@google.com>

Reviewed by Darin Fisher.

Add EnabledAtRuntime attribute to WebGLArray constructors
https://bugs.webkit.org/show_bug.cgi?id=35558

New functionality verified manually in Chromium; not possible to
write layout test. Ran WebGL tests in WebKit as well.

  • bindings/generic/RuntimeEnabledFeatures.cpp:
  • bindings/generic/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebGLEnabled): (WebCore::RuntimeEnabledFeatures::webGLRenderingContextEnabled): (WebCore::RuntimeEnabledFeatures::webGLArrayBufferEnabled): (WebCore::RuntimeEnabledFeatures::webGLByteArrayEnabled): (WebCore::RuntimeEnabledFeatures::webGLUnsignedByteArrayEnabled): (WebCore::RuntimeEnabledFeatures::webGLShortArrayEnabled): (WebCore::RuntimeEnabledFeatures::webGLUnsignedShortArrayEnabled): (WebCore::RuntimeEnabledFeatures::webGLIntArrayEnabled): (WebCore::RuntimeEnabledFeatures::webGLUnsignedIntArrayEnabled): (WebCore::RuntimeEnabledFeatures::webGLFloatArrayEnabled):
  • page/DOMWindow.idl:

2010-03-02 Kenneth Russell <kbr@google.com>

Reviewed by Darin Fisher.

Add EnabledAtRuntime attribute to WebGLArray constructors
https://bugs.webkit.org/show_bug.cgi?id=35558

  • public/WebRuntimeFeatures.h:
  • src/WebRuntimeFeatures.cpp: (WebKit::WebRuntimeFeatures::enableWebGL): (WebKit::WebRuntimeFeatures::isWebGLEnabled):
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r55417 r55419  
     12010-03-02  Kenneth Russell  <kbr@google.com>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Add EnabledAtRuntime attribute to WebGLArray constructors
     6        https://bugs.webkit.org/show_bug.cgi?id=35558
     7
     8        New functionality verified manually in Chromium; not possible to
     9        write layout test. Ran WebGL tests in WebKit as well.
     10
     11        * bindings/generic/RuntimeEnabledFeatures.cpp:
     12        * bindings/generic/RuntimeEnabledFeatures.h:
     13        (WebCore::RuntimeEnabledFeatures::setWebGLEnabled):
     14        (WebCore::RuntimeEnabledFeatures::webGLRenderingContextEnabled):
     15        (WebCore::RuntimeEnabledFeatures::webGLArrayBufferEnabled):
     16        (WebCore::RuntimeEnabledFeatures::webGLByteArrayEnabled):
     17        (WebCore::RuntimeEnabledFeatures::webGLUnsignedByteArrayEnabled):
     18        (WebCore::RuntimeEnabledFeatures::webGLShortArrayEnabled):
     19        (WebCore::RuntimeEnabledFeatures::webGLUnsignedShortArrayEnabled):
     20        (WebCore::RuntimeEnabledFeatures::webGLIntArrayEnabled):
     21        (WebCore::RuntimeEnabledFeatures::webGLUnsignedIntArrayEnabled):
     22        (WebCore::RuntimeEnabledFeatures::webGLFloatArrayEnabled):
     23        * page/DOMWindow.idl:
     24
    1252010-03-02  Nate Chapin  <japhet@chromium.org>
    226
  • trunk/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp

    r55140 r55419  
    4545bool RuntimeEnabledFeatures::isGeolocationEnabled = true;
    4646bool RuntimeEnabledFeatures::isIndexedDBEnabled = false;
     47bool RuntimeEnabledFeatures::isWebGLEnabled = false;
    4748
    4849#if ENABLE(VIDEO)
  • trunk/WebCore/bindings/generic/RuntimeEnabledFeatures.h

    r54593 r55419  
    7878#endif
    7979
     80#if ENABLE(3D_CANVAS)
     81    static void setWebGLEnabled(bool isEnabled) { isWebGLEnabled = isEnabled; }
     82    static bool webGLRenderingContextEnabled() { return isWebGLEnabled; }
     83    static bool webGLArrayBufferEnabled() { return isWebGLEnabled; }
     84    static bool webGLByteArrayEnabled() { return isWebGLEnabled; }
     85    static bool webGLUnsignedByteArrayEnabled() { return isWebGLEnabled; }
     86    static bool webGLShortArrayEnabled() { return isWebGLEnabled; }
     87    static bool webGLUnsignedShortArrayEnabled() { return isWebGLEnabled; }
     88    static bool webGLIntArrayEnabled() { return isWebGLEnabled; }
     89    static bool webGLUnsignedIntArrayEnabled() { return isWebGLEnabled; }
     90    static bool webGLFloatArrayEnabled() { return isWebGLEnabled; }
     91#endif
     92
    8093private:
    8194    // Never instantiate.
     
    88101    static bool isGeolocationEnabled;
    89102    static bool isIndexedDBEnabled;
     103    static bool isWebGLEnabled;
    90104};
    91105
  • trunk/WebCore/page/DOMWindow.idl

    r54676 r55419  
    443443        attribute CanvasRenderingContext2DConstructor CanvasRenderingContext2D;
    444444        attribute ImageDataConstructor ImageData;
    445         attribute [Conditional=3D_CANVAS] WebGLRenderingContextConstructor WebGLRenderingContext;
     445        attribute [Conditional=3D_CANVAS,EnabledAtRuntime] WebGLRenderingContextConstructor WebGLRenderingContext;
    446446        attribute TextMetricsConstructor TextMetrics;
    447447
    448         attribute [JSCCustomGetter,Conditional=3D_CANVAS] WebGLArrayBufferConstructor WebGLArrayBuffer; // Usable with new operator
    449         attribute [JSCCustomGetter,Conditional=3D_CANVAS] WebGLByteArrayConstructor WebGLByteArray; // Usable with new operator
    450         attribute [JSCCustomGetter,Conditional=3D_CANVAS] WebGLUnsignedByteArrayConstructor WebGLUnsignedByteArray; // Usable with new operator
    451         attribute [JSCCustomGetter,Conditional=3D_CANVAS] WebGLShortArrayConstructor WebGLShortArray; // Usable with new operator
    452         attribute [JSCCustomGetter,Conditional=3D_CANVAS] WebGLUnsignedShortArrayConstructor WebGLUnsignedShortArray; // Usable with new operator
    453         attribute [JSCCustomGetter,Conditional=3D_CANVAS] WebGLIntArrayConstructor WebGLIntArray; // Usable with new operator
    454         attribute [JSCCustomGetter,Conditional=3D_CANVAS] WebGLUnsignedIntArrayConstructor WebGLUnsignedIntArray; // Usable with new operator
    455         attribute [JSCCustomGetter,Conditional=3D_CANVAS] WebGLFloatArrayConstructor WebGLFloatArray; // Usable with new operator
     448        attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] WebGLArrayBufferConstructor WebGLArrayBuffer; // Usable with new operator
     449        attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] WebGLByteArrayConstructor WebGLByteArray; // Usable with new operator
     450        attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] WebGLUnsignedByteArrayConstructor WebGLUnsignedByteArray; // Usable with new operator
     451        attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] WebGLShortArrayConstructor WebGLShortArray; // Usable with new operator
     452        attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] WebGLUnsignedShortArrayConstructor WebGLUnsignedShortArray; // Usable with new operator
     453        attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] WebGLIntArrayConstructor WebGLIntArray; // Usable with new operator
     454        attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] WebGLUnsignedIntArrayConstructor WebGLUnsignedIntArray; // Usable with new operator
     455        attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] WebGLFloatArrayConstructor WebGLFloatArray; // Usable with new operator
    456456
    457457        attribute EventConstructor Event;
  • trunk/WebKit/chromium/ChangeLog

    r55413 r55419  
     12010-03-02  Kenneth Russell  <kbr@google.com>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Add EnabledAtRuntime attribute to WebGLArray constructors
     6        https://bugs.webkit.org/show_bug.cgi?id=35558
     7
     8        * public/WebRuntimeFeatures.h:
     9        * src/WebRuntimeFeatures.cpp:
     10        (WebKit::WebRuntimeFeatures::enableWebGL):
     11        (WebKit::WebRuntimeFeatures::isWebGLEnabled):
     12
    1132010-03-02  James Hawkins  <jhawkins@chromium.org>
    214
  • trunk/WebKit/chromium/public/WebRuntimeFeatures.h

    r54085 r55419  
    6969    WEBKIT_API static bool isIndexedDatabaseEnabled();
    7070
     71    WEBKIT_API static void enableWebGL(bool);
     72    WEBKIT_API static bool isWebGLEnabled();
     73
    7174private:
    7275    WebRuntimeFeatures();
  • trunk/WebKit/chromium/src/WebRuntimeFeatures.cpp

    r54593 r55419  
    185185}
    186186
     187void WebRuntimeFeatures::enableWebGL(bool enable)
     188{
     189#if ENABLE(3D_CANVAS)
     190    RuntimeEnabledFeatures::setWebGLEnabled(enable);
     191#endif
     192}
     193
     194bool WebRuntimeFeatures::isWebGLEnabled()
     195{
     196#if ENABLE(3D_CANVAS)
     197    return RuntimeEnabledFeatures::webGLRenderingContextEnabled();
     198#else
     199    return false;
     200#endif
     201}
     202
    187203} // namespace WebKit
Note: See TracChangeset for help on using the changeset viewer.