Commit baf6fd0b authored by cmarrin@apple.com's avatar cmarrin@apple.com

https://bugs.webkit.org/show_bug.cgi?id=29906

Turn on compile time switch for WebGL, but have runtime switch default to off

This also fixes LayoutTests which broke with the flag turned on, and
fixes a crash found in the LayoutTests.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49006 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d60960dc
2009-10-01 Chris Marrin <cmarrin@apple.com>
Reviewed by Oliver Hunt.
Turn on ENABLE_3D_CANVAS in TOT
https://bugs.webkit.org/show_bug.cgi?id=29906
Fixed layout tests which failed with flag on
* fast/canvas/webgl/gl-get-calls.html:
* fast/dom/Window/window-properties.html:
* fast/dom/script-tests/constructed-objects-prototypes.js:
(constructorPropertiesOnWindow):
* fast/dom/script-tests/prototype-inheritance-2.js:
(constructorNamesForWindow):
* fast/dom/script-tests/prototype-inheritance.js:
* fast/js/script-tests/global-constructors.js:
2009-10-01 Beth Dakin <bdakin@apple.com>
Reviewed by Dan Bernstein.
......
......@@ -10,91 +10,91 @@
<script>
if (window.layoutTestController)
layoutTestController.overridePreference("WebKitWebGLEnabled", "1");
description("This test ensures basic functionality of the underlying graphics library");
debug("");
debug("Canvas.getContext");
var context = document.getElementById("canvas").getContext("webkit-3d");
if (context)
testPassed("context exists");
else
testFailed("context does not exist");
if (!context)
testFailed("context does not exist");
else {
testPassed("context exists");
debug("");
debug("Context is correct type");
if (context instanceof CanvasRenderingContext3D)
testPassed("context is correct type");
else
testFailed("context is not correct type");
debug("");
debug("Context is correct type");
if (context instanceof CanvasRenderingContext3D)
testPassed("context is correct type");
else
testFailed("context is not correct type");
debug("");
debug("Context contains getError");
if ("getError" in context)
testPassed("context contains getError");
else
testFailed("context does not contains getError");
debug("");
debug("Check default values");
shouldBe('context.getInteger(context.ACTIVE_TEXTURE)', 'context.TEXTURE0');
shouldBe('context.getInteger(context.ALIASED_LINE_WIDTH_RANGE)', '1');
shouldBe('context.getInteger(context.ALIASED_POINT_SIZE_RANGE)', '1');
shouldBe('context.getInteger(context.ARRAY_BUFFER_BINDING)', '0');
shouldBe('context.getInteger(context.BLEND)', '0');
shouldBe('context.getInteger(context.BLEND_COLOR)', '0');
shouldBe('context.getInteger(context.BLEND_DST_ALPHA)', '0');
shouldBe('context.getInteger(context.BLEND_DST_RGB)', '0');
shouldBe('context.getInteger(context.BLEND_EQUATION_ALPHA)', 'context.FUNC_ADD');
shouldBe('context.getInteger(context.BLEND_EQUATION_RGB)', 'context.FUNC_ADD');
shouldBe('context.getInteger(context.BLEND_SRC_ALPHA)', '1');
shouldBe('context.getInteger(context.BLEND_SRC_RGB)', '1');
shouldBe('context.getInteger(context.COLOR_CLEAR_VALUE)', '0');
shouldBe('context.getInteger(context.COLOR_WRITEMASK)', '1');
shouldBe('context.getInteger(context.CULL_FACE)', '0');
shouldBe('context.getInteger(context.CULL_FACE_MODE)', 'context.BACK');
shouldBe('context.getInteger(context.CURRENT_PROGRAM)', '0');
shouldBe('context.getInteger(context.DEPTH_FUNC)', 'context.LESS');
shouldBe('context.getInteger(context.DEPTH_RANGE)', '0');
shouldBe('context.getInteger(context.DEPTH_TEST)', '0');
shouldBe('context.getInteger(context.DEPTH_WRITEMASK)', '1');
shouldBe('context.getInteger(context.DITHER)', '1');
shouldBe('context.getInteger(context.ELEMENT_ARRAY_BUFFER_BINDING)', '0');
shouldBe('context.getInteger(context.FRONT_FACE)', 'context.CCW');
shouldBe('context.getInteger(context.GENERATE_MIPMAP_HINT)', 'context.DONT_CARE');
shouldBe('context.getInteger(context.LINE_WIDTH)', '1');
shouldBe('context.getInteger(context.POLYGON_OFFSET_FACTOR)', '0');
shouldBe('context.getInteger(context.POLYGON_OFFSET_FILL)', '0');
shouldBe('context.getInteger(context.POLYGON_OFFSET_UNITS)', '0');
shouldBe('context.getInteger(context.RENDERBUFFER_BINDING_EXT)', '0');
shouldBe('context.getInteger(context.SAMPLE_COVERAGE_INVERT)', '0');
shouldBe('context.getInteger(context.SAMPLE_COVERAGE_VALUE)', '1');
shouldBe('context.getInteger(context.SCISSOR_BOX)', '0');
shouldBe('context.getInteger(context.SCISSOR_TEST)', '0');
shouldBe('context.getInteger(context.STENCIL_BACK_FAIL)', 'context.KEEP');
shouldBe('context.getInteger(context.STENCIL_BACK_FUNC)', 'context.ALWAYS');
shouldBe('context.getInteger(context.STENCIL_BACK_PASS_DEPTH_FAIL)', 'context.KEEP');
shouldBe('context.getInteger(context.STENCIL_BACK_PASS_DEPTH_PASS)', 'context.KEEP');
shouldBe('context.getInteger(context.STENCIL_BACK_REF)', '0');
shouldBe('context.getInteger(context.STENCIL_BACK_VALUE_MASK)', '-1');
shouldBe('context.getInteger(context.STENCIL_BACK_WRITEMASK)', '-1');
shouldBe('context.getInteger(context.STENCIL_BITS)', '0');
shouldBe('context.getInteger(context.STENCIL_CLEAR_VALUE)', '0');
shouldBe('context.getInteger(context.STENCIL_FAIL)', 'context.KEEP');
shouldBe('context.getInteger(context.STENCIL_FUNC)', 'context.ALWAYS');
shouldBe('context.getInteger(context.STENCIL_PASS_DEPTH_FAIL)', 'context.KEEP');
shouldBe('context.getInteger(context.STENCIL_PASS_DEPTH_PASS)', 'context.KEEP');
shouldBe('context.getInteger(context.STENCIL_REF)', '0');
shouldBe('context.getInteger(context.STENCIL_TEST)', '0');
shouldBe('context.getInteger(context.STENCIL_VALUE_MASK)', '-1');
shouldBe('context.getInteger(context.STENCIL_WRITEMASK)', '-1');
shouldBe('context.getInteger(context.TEXTURE_BINDING_2D)', '0');
shouldBe('context.getInteger(context.TEXTURE_BINDING_CUBE_MAP)', '0');
shouldBe('context.getInteger(context.VIEWPORT)', '0');
debug("");
debug("Context contains getError");
if ("getError" in context)
testPassed("context contains getError");
else
testFailed("context does not contains getError");
debug("");
debug("Check default values");
shouldBe('context.getInteger(context.ACTIVE_TEXTURE)', 'context.TEXTURE0');
shouldBe('context.getInteger(context.ALIASED_LINE_WIDTH_RANGE)', '1');
shouldBe('context.getInteger(context.ALIASED_POINT_SIZE_RANGE)', '1');
shouldBe('context.getInteger(context.ARRAY_BUFFER_BINDING)', '0');
shouldBe('context.getInteger(context.BLEND)', '0');
shouldBe('context.getInteger(context.BLEND_COLOR)', '0');
shouldBe('context.getInteger(context.BLEND_DST_ALPHA)', '0');
shouldBe('context.getInteger(context.BLEND_DST_RGB)', '0');
shouldBe('context.getInteger(context.BLEND_EQUATION_ALPHA)', 'context.FUNC_ADD');
shouldBe('context.getInteger(context.BLEND_EQUATION_RGB)', 'context.FUNC_ADD');
shouldBe('context.getInteger(context.BLEND_SRC_ALPHA)', '1');
shouldBe('context.getInteger(context.BLEND_SRC_RGB)', '1');
shouldBe('context.getInteger(context.COLOR_CLEAR_VALUE)', '0');
shouldBe('context.getInteger(context.COLOR_WRITEMASK)', '1');
shouldBe('context.getInteger(context.CULL_FACE)', '0');
shouldBe('context.getInteger(context.CULL_FACE_MODE)', 'context.BACK');
shouldBe('context.getInteger(context.CURRENT_PROGRAM)', '0');
shouldBe('context.getInteger(context.DEPTH_FUNC)', 'context.LESS');
shouldBe('context.getInteger(context.DEPTH_RANGE)', '0');
shouldBe('context.getInteger(context.DEPTH_TEST)', '0');
shouldBe('context.getInteger(context.DEPTH_WRITEMASK)', '1');
shouldBe('context.getInteger(context.DITHER)', '1');
shouldBe('context.getInteger(context.ELEMENT_ARRAY_BUFFER_BINDING)', '0');
shouldBe('context.getInteger(context.FRONT_FACE)', 'context.CCW');
shouldBe('context.getInteger(context.GENERATE_MIPMAP_HINT)', 'context.DONT_CARE');
shouldBe('context.getInteger(context.LINE_WIDTH)', '1');
shouldBe('context.getInteger(context.POLYGON_OFFSET_FACTOR)', '0');
shouldBe('context.getInteger(context.POLYGON_OFFSET_FILL)', '0');
shouldBe('context.getInteger(context.POLYGON_OFFSET_UNITS)', '0');
shouldBe('context.getInteger(context.RENDERBUFFER_BINDING_EXT)', '0');
shouldBe('context.getInteger(context.SAMPLE_COVERAGE_INVERT)', '0');
shouldBe('context.getInteger(context.SAMPLE_COVERAGE_VALUE)', '1');
shouldBe('context.getInteger(context.SCISSOR_BOX)', '0');
shouldBe('context.getInteger(context.SCISSOR_TEST)', '0');
shouldBe('context.getInteger(context.STENCIL_BACK_FAIL)', 'context.KEEP');
shouldBe('context.getInteger(context.STENCIL_BACK_FUNC)', 'context.ALWAYS');
shouldBe('context.getInteger(context.STENCIL_BACK_PASS_DEPTH_FAIL)', 'context.KEEP');
shouldBe('context.getInteger(context.STENCIL_BACK_PASS_DEPTH_PASS)', 'context.KEEP');
shouldBe('context.getInteger(context.STENCIL_BACK_REF)', '0');
shouldBe('context.getInteger(context.STENCIL_BACK_VALUE_MASK)', '-1');
shouldBe('context.getInteger(context.STENCIL_BACK_WRITEMASK)', '-1');
shouldBe('context.getInteger(context.STENCIL_BITS)', '0');
shouldBe('context.getInteger(context.STENCIL_CLEAR_VALUE)', '0');
shouldBe('context.getInteger(context.STENCIL_FAIL)', 'context.KEEP');
shouldBe('context.getInteger(context.STENCIL_FUNC)', 'context.ALWAYS');
shouldBe('context.getInteger(context.STENCIL_PASS_DEPTH_FAIL)', 'context.KEEP');
shouldBe('context.getInteger(context.STENCIL_PASS_DEPTH_PASS)', 'context.KEEP');
shouldBe('context.getInteger(context.STENCIL_REF)', '0');
shouldBe('context.getInteger(context.STENCIL_TEST)', '0');
shouldBe('context.getInteger(context.STENCIL_VALUE_MASK)', '-1');
shouldBe('context.getInteger(context.STENCIL_WRITEMASK)', '-1');
shouldBe('context.getInteger(context.TEXTURE_BINDING_2D)', '0');
shouldBe('context.getInteger(context.TEXTURE_BINDING_CUBE_MAP)', '0');
shouldBe('context.getInteger(context.VIEWPORT)', '0');
}
debug("");
successfullyParsed = true;
......
......@@ -61,7 +61,16 @@ var __skip__ = {
"window.objCPluginFunction" : 1,
"window.plainText" : 1,
"window.textInputController" : 1,
"window.CanvasRenderingContext3D" : 1 // We ignore CanvasRenderingContext3D and test it elsewhere, since it is not in all builds
// Ignore these properties because they do not exist in all implementations. They will be tested separately
"window.CanvasRenderingContext3D" : 1,
"window.CanvasArrayBuffer" : 1,
"window.CanvasByteArray" : 1,
"window.CanvasFloatArray" : 1,
"window.CanvasIntArray" : 1,
"window.CanvasShortArray" : 1,
"window.CanvasUnsignedByteArray" : 1,
"window.CanvasUnsignedIntArray" : 1,
"window.CanvasUnsignedShortArray" : 1
};
function logValue(valueName)
......
......@@ -26,6 +26,17 @@ function constructorPropertiesOnWindow(globalObject)
if (value == null)
continue;
var type = classNameForObject(value);
// Ignore these properties because they do not exist in all implementations. They will be tested separately
if (type == "CanvasRenderingContext3DConstructor" ||
type == "CanvasArrayBufferConstructor" ||
type =="CanvasByteArrayConstructor" ||
type =="CanvasFloatArrayConstructor" ||
type =="CanvasIntArrayConstructor" ||
type =="CanvasShortArrayConstructor" ||
type =="CanvasUnsignedByteArrayConstructor" ||
type =="CanvasUnsignedIntArrayConstructor" ||
type =="CanvasUnsignedShortArrayConstructor")
continue;
if (!type.match('Constructor$'))
continue;
constructorNames.push(property);
......
......@@ -56,7 +56,16 @@ function constructorNamesForWindow(globalObject)
if (value == null)
continue;
var type = classNameForObject(value);
if (type == "CanvasRenderingContext3DConstructor")
// Ignore these properties because they do not exist in all implementations. They will be tested separately
if (type == "CanvasRenderingContext3DConstructor" ||
type == "CanvasArrayBufferConstructor" ||
type == "CanvasByteArrayConstructor" ||
type =="CanvasFloatArrayConstructor" ||
type =="CanvasIntArrayConstructor" ||
type =="CanvasShortArrayConstructor" ||
type =="CanvasUnsignedByteArrayConstructor" ||
type =="CanvasUnsignedIntArrayConstructor" ||
type =="CanvasUnsignedShortArrayConstructor")
continue; // We ignore CanvasRenderingContext3D and test it elsewhere, since it is not in all builds
if (!type.match('Constructor$'))
continue;
......
......@@ -12,7 +12,9 @@ var skippedProperties = [
"objCController", "textInputController", "navigationController",
"eventSender", "objCPlugin", "objCPluginFunction",
"appleScriptController", "plainText", "accessibilityController",
"CanvasRenderingContext3D", // Ignore this property because it does not exist in all implementations. It will be tested separately
// Ignore these properties because they do not exist in all implementations. They will be tested separately
"CanvasRenderingContext3D", "CanvasArrayBuffer",
"CanvasByteArray", "CanvasFloatArray", "CanvasIntArray", "CanvasShortArray", "CanvasUnsignedByteArray", "CanvasUnsignedIntArray", "CanvasUnsignedShortArray",
];
var skippedPropertiesSet = {};
......
......@@ -15,6 +15,19 @@ constructorNames.sort();
for (var x in constructorNames) {
var name = constructorNames[x];
var expectedConstructorName = "'[object " + name + "Constructor]'";
// Ignore these properties because they do not exist in all implementations. They will be tested separately
if (name == "CanvasRenderingContext3D" ||
name == "CanvasArrayBuffer" ||
name =="CanvasByteArray" ||
name =="CanvasFloatArray" ||
name =="CanvasIntArray" ||
name =="CanvasShortArray" ||
name =="CanvasUnsignedByteArray" ||
name =="CanvasUnsignedIntArray" ||
name =="CanvasUnsignedShortArray")
continue;
if (name == "XMLDocument")
// Gecko exposes an "XMLDocument" constructor, but we just use Document for XML documents instead of a custom sub-type
expectedConstructorName = "'[object DocumentConstructor]'";
......
2009-10-01 Chris Marrin <cmarrin@apple.com>
Reviewed by Oliver Hunt.
Turn on ENABLE_3D_CANVAS in TOT
https://bugs.webkit.org/show_bug.cgi?id=29906
Fixed a bug found when running tests with flag on
* Configurations/FeatureDefines.xcconfig:
* WebCore.base.exp:
* bindings/js/JSCanvasArrayBufferConstructor.h:
(WebCore::construct):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):
* html/canvas/CanvasArray.cpp:
(WebCore::CanvasArray::CanvasArray):
* html/canvas/CanvasByteArray.cpp:
(WebCore::CanvasByteArray::create):
* html/canvas/CanvasFloatArray.cpp:
(WebCore::CanvasFloatArray::create):
* html/canvas/CanvasIntArray.cpp:
(WebCore::CanvasIntArray::create):
* html/canvas/CanvasShortArray.cpp:
(WebCore::CanvasShortArray::create):
* html/canvas/CanvasUnsignedByteArray.cpp:
(WebCore::CanvasUnsignedByteArray::create):
* html/canvas/CanvasUnsignedIntArray.cpp:
(WebCore::CanvasUnsignedIntArray::create):
* html/canvas/CanvasUnsignedShortArray.cpp:
(WebCore::CanvasUnsignedShortArray::create):
* page/Settings.cpp:
(WebCore::Settings::Settings):
(WebCore::Settings::setWebGLEnabled):
* page/Settings.h:
(WebCore::Settings::webGLEnabled):
2009-10-01 Beth Dakin <bdakin@apple.com>
Reviewed by Dan Bernstein.
......@@ -28,7 +28,7 @@
// Set any ENABLE_FEATURE_NAME macro to an empty string to disable that feature.
ENABLE_3D_CANVAS = ;
ENABLE_3D_CANVAS = ENABLE_3D_CANVAS;
ENABLE_3D_RENDERING = $(ENABLE_3D_RENDERING_$(MAC_OS_X_VERSION_MAJOR));
ENABLE_3D_RENDERING_1050 = ENABLE_3D_RENDERING;
......
......@@ -636,7 +636,7 @@ __ZN7WebCore8Settings25setShouldPrintBackgroundsEb
__ZN7WebCore8Settings25setUserStyleSheetLocationERKNS_4KURLE
__ZN7WebCore8Settings26setDefaultTextEncodingNameERKNS_6StringE
__ZN7WebCore8Settings26setNeedsSiteSpecificQuirksEb
__ZN7WebCore8Settings27setExperimentalWebGLEnabledEb
__ZN7WebCore8Settings15setWebGLEnabledEb
__ZN7WebCore8Settings27setFTPDirectoryTemplatePathERKNS_6StringE
__ZN7WebCore8Settings27setLoadsImagesAutomaticallyEb
__ZN7WebCore8Settings27setLocalStorageDatabasePathERKNS_6StringE
......
......@@ -47,8 +47,9 @@ namespace WebCore {
//
RefPtr<C> arrayObject;
// For the 0 args case, just create an object without a buffer
if (args.size() < 1)
return 0;
return C::create(0, 0, 0);
if (args.at(0).isObject()) {
RefPtr<CanvasArrayBuffer> buffer = toCanvasArrayBuffer(args.at(0));
......
......@@ -166,7 +166,7 @@ CanvasRenderingContext* HTMLCanvasElement::getContext(const String& type)
}
#if ENABLE(3D_CANVAS)
Settings* settings = document()->settings();
if (settings && settings->experimentalWebGLEnabled()) {
if (settings && settings->webGLEnabled()) {
if ((type == "webkit-3d") ||
(type == "GL")) {
if (m_context && !m_context->is3d())
......
......@@ -36,7 +36,7 @@ namespace WebCore {
: m_offset(offset)
, m_buffer(buffer)
{
m_baseAddress = static_cast<char*>(m_buffer->data()) + m_offset;
m_baseAddress = buffer ? (static_cast<char*>(m_buffer->data()) + m_offset) : 0;
}
CanvasArray::~CanvasArray()
......
......@@ -48,12 +48,13 @@ PassRefPtr<CanvasByteArray> CanvasByteArray::create(signed char* array, unsigned
PassRefPtr<CanvasByteArray> CanvasByteArray::create(PassRefPtr<CanvasArrayBuffer> buffer, int offset, unsigned length)
{
// Check to make sure we are talking about a valid region of
// the given CanvasArrayBuffer's storage.
if ((offset + (length * sizeof(signed char))) > buffer->byteLength()) {
return NULL;
if (buffer) {
// Check to make sure we are talking about a valid region of
// the given CanvasArrayBuffer's storage.
if ((offset + (length * sizeof(signed char))) > buffer->byteLength())
return NULL;
}
return adoptRef(new CanvasByteArray(buffer, offset, length));
}
......
......@@ -48,16 +48,15 @@ namespace WebCore {
PassRefPtr<CanvasFloatArray> CanvasFloatArray::create(PassRefPtr<CanvasArrayBuffer> buffer, int offset, unsigned length)
{
// Make sure the offset results in valid alignment.
if ((offset % sizeof(float)) != 0) {
if ((offset % sizeof(float)) != 0)
return NULL;
}
// Check to make sure we are talking about a valid region of
// the given CanvasArrayBuffer's storage.
if ((offset + (length * sizeof(float))) > buffer->byteLength()) {
return NULL;
if (buffer) {
// Check to make sure we are talking about a valid region of
// the given CanvasArrayBuffer's storage.
if ((offset + (length * sizeof(float))) > buffer->byteLength())
return NULL;
}
return adoptRef(new CanvasFloatArray(buffer, offset, length));
}
......
......@@ -51,16 +51,16 @@ namespace WebCore {
unsigned length)
{
// Make sure the offset results in valid alignment.
if ((offset % sizeof(int)) != 0) {
if ((offset % sizeof(int)) != 0)
return NULL;
}
// Check to make sure we are talking about a valid region of
// the given CanvasArrayBuffer's storage.
if ((offset + (length * sizeof(int))) > buffer->byteLength()) {
return NULL;
if (buffer) {
// Check to make sure we are talking about a valid region of
// the given CanvasArrayBuffer's storage.
if ((offset + (length * sizeof(int))) > buffer->byteLength())
return NULL;
}
return adoptRef(new CanvasIntArray(buffer, offset, length));
}
......
......@@ -51,14 +51,14 @@ namespace WebCore {
unsigned length)
{
// Make sure the offset results in valid alignment.
if ((offset % sizeof(short)) != 0) {
if ((offset % sizeof(short)) != 0)
return NULL;
}
// Check to make sure we are talking about a valid region of
// the given CanvasArrayBuffer's storage.
if ((offset + (length * sizeof(short))) > buffer->byteLength()) {
return NULL;
if (buffer) {
// Check to make sure we are talking about a valid region of
// the given CanvasArrayBuffer's storage.
if ((offset + (length * sizeof(short))) > buffer->byteLength())
return NULL;
}
return adoptRef(new CanvasShortArray(buffer, offset, length));
......
......@@ -50,10 +50,11 @@ namespace WebCore {
int offset,
unsigned length)
{
// Check to make sure we are talking about a valid region of
// the given CanvasArrayBuffer's storage.
if ((offset + (length * sizeof(unsigned char))) > buffer->byteLength()) {
return NULL;
if (buffer) {
// Check to make sure we are talking about a valid region of
// the given CanvasArrayBuffer's storage.
if ((offset + (length * sizeof(unsigned char))) > buffer->byteLength())
return NULL;
}
return adoptRef(new CanvasUnsignedByteArray(buffer, offset, length));
......
......@@ -55,10 +55,11 @@ namespace WebCore {
return NULL;
}
// Check to make sure we are talking about a valid region of
// the given CanvasArrayBuffer's storage.
if ((offset + (length * sizeof(unsigned int))) > buffer->byteLength()) {
return NULL;
if (buffer) {
// Check to make sure we are talking about a valid region of
// the given CanvasArrayBuffer's storage.
if ((offset + (length * sizeof(unsigned int))) > buffer->byteLength())
return NULL;
}
return adoptRef(new CanvasUnsignedIntArray(buffer, offset, length));
......
......@@ -55,10 +55,11 @@ namespace WebCore {
return NULL;
}
// Check to make sure we are talking about a valid region of
// the given CanvasArrayBuffer's storage.
if ((offset + (length * sizeof(unsigned short))) > buffer->byteLength()) {
return NULL;
if (buffer) {
// Check to make sure we are talking about a valid region of
// the given CanvasArrayBuffer's storage.
if ((offset + (length * sizeof(unsigned short))) > buffer->byteLength())
return NULL;
}
return adoptRef(new CanvasUnsignedShortArray(buffer, offset, length));
......
......@@ -117,7 +117,7 @@ Settings::Settings(Page* page)
, m_acceleratedCompositingEnabled(true)
, m_experimentalNotificationsEnabled(false)
, m_pluginHalterEnabled(false)
, m_experimentalWebGLEnabled(false)
, m_webGLEnabled(false)
#if ENABLE(WEB_SOCKETS)
, m_experimentalWebSocketsEnabled(false)
#endif
......@@ -532,9 +532,9 @@ void Settings::setShouldUseHighResolutionTimers(bool shouldUseHighResolutionTime
}
#endif
void Settings::setExperimentalWebGLEnabled(bool enabled)
void Settings::setWebGLEnabled(bool enabled)
{
m_experimentalWebGLEnabled = enabled;
m_webGLEnabled = enabled;
}
#if ENABLE(WEB_SOCKETS)
......
......@@ -267,10 +267,8 @@ namespace WebCore {
void setPluginAllowedRunTime(unsigned);
unsigned pluginAllowedRunTime() const { return m_pluginAllowedRunTime; }
// This run-time flag is only temporary while the WebGL
// specification is being developed.
void setExperimentalWebGLEnabled(bool);
bool experimentalWebGLEnabled() const { return m_experimentalWebGLEnabled; }
void setWebGLEnabled(bool);
bool webGLEnabled() const { return m_webGLEnabled; }
#if ENABLE(WEB_SOCKETS)
void setExperimentalWebSocketsEnabled(bool);
......@@ -344,7 +342,7 @@ namespace WebCore {
bool m_acceleratedCompositingEnabled : 1;
bool m_experimentalNotificationsEnabled : 1;
bool m_pluginHalterEnabled : 1;
bool m_experimentalWebGLEnabled : 1;
bool m_webGLEnabled : 1;
#if ENABLE(WEB_SOCKETS)
bool m_experimentalWebSocketsEnabled : 1;
......
2009-10-01 Chris Marrin <cmarrin@apple.com>
Reviewed by Oliver Hunt.
Turn on ENABLE_3D_CANVAS in TOT
https://bugs.webkit.org/show_bug.cgi?id=29906
* Configurations/FeatureDefines.xcconfig:
* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences webGLEnabled]):
(-[WebPreferences setWebGLEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChangedNotification:]):
2009-09-30 Sam Weinig <sam@webkit.org>
Reviewed by Dan Bernstein.
......
......@@ -28,7 +28,7 @@
// Set any ENABLE_FEATURE_NAME macro to an empty string to disable that feature.
ENABLE_3D_CANVAS = ;
ENABLE_3D_CANVAS = ENABLE_3D_CANVAS;
ENABLE_3D_RENDERING = $(ENABLE_3D_RENDERING_$(MAC_OS_X_VERSION_MAJOR));
ENABLE_3D_RENDERING_1050 = ENABLE_3D_RENDERING;
......
......@@ -86,6 +86,7 @@
#define WebKitZoomsTextOnlyPreferenceKey @"WebKitZoomsTextOnly"
#define WebKitXSSAuditorEnabledPreferenceKey @"WebKitXSSAuditorEnabled"
#define WebKitAcceleratedCompositingEnabledPreferenceKey @"WebKitAcceleratedCompositingEnabled"
#define WebKitWebGLEnabledPreferenceKey @"WebKitWebGLEnabled"
// These are private both because callers should be using the cover methods and because the
// cover methods themselves are private.
......
......@@ -352,6 +352,7 @@ static WebCacheModel cacheModelForMainBundle(void)
[NSNumber numberWithBool:YES], WebKitZoomsTextOnlyPreferenceKey,
[NSNumber numberWithBool:YES], WebKitXSSAuditorEnabledPreferenceKey,
[NSNumber numberWithBool:YES], WebKitAcceleratedCompositingEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitWebGLEnabledPreferenceKey,
nil];
// This value shouldn't ever change, which is assumed in the initialization of WebKitPDFDisplayModePreferenceKey above
......@@ -1160,6 +1161,16 @@ static NSString *classIBCreatorID = nil;
[self _setBoolValue:enabled forKey:WebKitAcceleratedCompositingEnabledPreferenceKey];
}
- (BOOL)webGLEnabled
{
return [self _boolValueForKey:WebKitWebGLEnabledPreferenceKey];
}
- (void)setWebGLEnabled:(BOOL)enabled
{
[self _setBoolValue:enabled forKey:WebKitWebGLEnabledPreferenceKey];
}
- (void)didRemoveFromWebView
{
ASSERT(_private->numWebViews);
......
......@@ -149,6 +149,9 @@ extern NSString *WebPreferencesRemovedNotification;
- (BOOL)acceleratedCompositingEnabled;
- (void)setAcceleratedCompositingEnabled:(BOOL)enabled;
- (BOOL)webGLEnabled;
- (void)setWebGLEnabled:(BOOL)enabled;
// Other private methods
- (void)_postPreferencesChangesNotification;
+ (WebPreferences *)_getInstanceForIdentifier:(NSString *)identifier;
......
......@@ -1313,9 +1313,7 @@ static bool fastDocumentTeardownEnabled()
settings->setXSSAuditorEnabled([preferences isXSSAuditorEnabled]);
settings->setEnforceCSSMIMETypeInStrictMode(!WKAppVersionCheckLessThan(@"com.apple.iWeb", -1, 2.1));
settings->setAcceleratedCompositingEnabled([preferences acceleratedCompositingEnabled]);
#if ENABLE(3D_CANVAS)
settings->setExperimentalWebGLEnabled(true);
#endif // ENABLE(3D_CANVAS)
settings->setWebGLEnabled([preferences webGLEnabled]);
}
static inline IMP getMethod(id o, SEL s)
......
2009-10-01 Chris Marrin <cmarrin@apple.com>
Reviewed by Oliver Hunt.
Turn on ENABLE_3D_CANVAS in TOT
</