+2012-04-02 Zhenyao Mo <zmo@google.com>
+
+ Implement WebGLShaderPrecisionFormat
+ https://bugs.webkit.org/show_bug.cgi?id=75925
+
+ Reviewed by Kenneth Russell.
+
+ * fast/canvas/webgl/instanceof-test-expected.txt: Add new WebGLShaderPrecisionFormat failure.
+ * fast/canvas/webgl/instanceof-test.html:
+ * fast/canvas/webgl/shader-precision-format-expected.txt: Added.
+ * fast/canvas/webgl/shader-precision-format.html: Added.
+ * fast/dom/Window/script-tests/window-property-descriptors.js: Add new type WebGLShaderPrecisionFormat.
+ * fast/dom/Window/window-properties.html: Ditto.
+ * fast/dom/script-tests/prototype-inheritance-2.js: Ditto.
+ (constructorNamesForWindow):
+ * fast/dom/script-tests/prototype-inheritance.js: Ditto.
+ * fast/js/script-tests/global-constructors.js: Ditto.
+
2012-04-03 Zalan Bujtas <zbujtas@gmail.com>
Add test case for 3 level nested iframes with frame flattening on.
+WebGL instanceof test.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
Tests that instanceof works on WebGL objects.
PASS gl instanceof WebGLRenderingContext is true
PASS new WebGLShader threw an error
PASS new WebGLTexture threw an error
PASS new WebGLUniformLocation threw an error
+PASS new WebGLShaderPrecisionFormat threw an error
PASS successfullyParsed is true
TEST COMPLETE
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"\r
- "http://www.w3.org/TR/html4/loose.dtd">\r
-<html>\r
-<head>\r
-<title>WebGL instanceof test.</title>\r
-<script src="../../js/resources/js-test-pre.js"></script>\r
-<script src="resources/webgl-test.js"> </script>\r
-<script src="resources/webgl-test-utils.js"> </script>\r
-</head>\r
-<body>\r
-<canvas id="canvas" width="2" height="2" style="width: 40px; height: 40px;"></canvas>\r
-<script id="vshader" type="x-shader/x-vertex">\r
-attribute vec4 vPosition;\r
-varying vec2 texCoord;\r
-void main()\r
-{\r
- gl_Position = vPosition;\r
-}\r
-</script>\r
-\r
-<script id="fshader" type="x-shader/x-fragment">\r
-#ifdef GL_ES\r
-precision mediump float;\r
-#endif\r
-uniform vec4 color;\r
-void main()\r
-{\r
- gl_FragColor = color;\r
-}\r
-</script>\r
-<script>\r
-var wtu = WebGLTestUtils;\r
-debug("Tests that instanceof works on WebGL objects.");\r
-debug("");\r
-var gl = create3DContext(document.getElementById("canvas"));\r
-shouldBeTrue('gl instanceof WebGLRenderingContext');\r
-shouldBeTrue('gl.createBuffer() instanceof WebGLBuffer');\r
-shouldBeTrue('gl.createFramebuffer() instanceof WebGLFramebuffer');\r
-shouldBeTrue('gl.createProgram() instanceof WebGLProgram');\r
-shouldBeTrue('gl.createRenderbuffer() instanceof WebGLRenderbuffer');\r
-shouldBeTrue('gl.createShader(gl.VERTEX_SHADER) instanceof WebGLShader');\r
-shouldBeTrue('gl.createTexture() instanceof WebGLTexture');\r
-\r
-var program = wtu.setupProgram(\r
- gl,\r
- [wtu.loadShaderFromScript(gl, 'vshader', gl.VERTEX_SHADER),\r
- wtu.loadShaderFromScript(gl, 'fshader', gl.FRAGMENT_SHADER)],\r
- ['vPosition'], [0]);\r
-\r
-shouldBeTrue('gl.getUniformLocation(program, "color") instanceof WebGLUniformLocation');\r
-shouldBeTrue('gl.getActiveAttrib(program, 0) instanceof WebGLActiveInfo');\r
-shouldBeTrue('gl.getActiveUniform(program, 0) instanceof WebGLActiveInfo');\r
-\r
-debug("");\r
-debug("Tests that those WebGL objects can not be constructed through new operator");\r
-debug("");\r
-\r
-function shouldThrowWithNew(objectType, objectName)\r
-{\r
- try {\r
- new objectType;\r
- testFailed('new ' + objectName + ' did not throw');\r
- } catch (e) {\r
- testPassed('new ' + objectName + ' threw an error');\r
- }\r
-}\r
-\r
-shouldThrowWithNew(WebGLRenderingContext, 'WebGLRenderingContext');\r
-shouldThrowWithNew(WebGLActiveInfo, 'WebGLActiveInfo');\r
-shouldThrowWithNew(WebGLBuffer, 'WebGLBuffer');\r
-shouldThrowWithNew(WebGLFramebuffer, 'WebGLFramebuffer');\r
-shouldThrowWithNew(WebGLProgram, 'WebGLProgram');\r
-shouldThrowWithNew(WebGLRenderbuffer, 'WebGLRenderbuffer');\r
-shouldThrowWithNew(WebGLShader, 'WebGLShader');\r
-shouldThrowWithNew(WebGLTexture, 'WebGLTexture');\r
-shouldThrowWithNew(WebGLUniformLocation, 'WebGLUniformLocation');\r
-\r
-</script>\r
-</body>\r
-<script src="../../js/resources/js-test-post.js"></script>\r
-\r
-<script>\r
-</script>\r
-\r
-</body>\r
-</html>\r
-\r
-\r
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL instanceof test.</title>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css"/>
+<script src="../../js/resources/js-test-pre.js"></script>
+<script src="resources/webgl-test.js"> </script>
+<script src="resources/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="canvas" width="2" height="2" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+varying vec2 texCoord;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+uniform vec4 color;
+void main()
+{
+ gl_FragColor = color;
+}
+</script>
+<script>
+var wtu = WebGLTestUtils;
+description(document.title);
+debug("Tests that instanceof works on WebGL objects.");
+debug("");
+var gl = create3DContext(document.getElementById("canvas"));
+shouldBeTrue('gl instanceof WebGLRenderingContext');
+shouldBeTrue('gl.createBuffer() instanceof WebGLBuffer');
+shouldBeTrue('gl.createFramebuffer() instanceof WebGLFramebuffer');
+shouldBeTrue('gl.createProgram() instanceof WebGLProgram');
+shouldBeTrue('gl.createRenderbuffer() instanceof WebGLRenderbuffer');
+shouldBeTrue('gl.createShader(gl.VERTEX_SHADER) instanceof WebGLShader');
+shouldBeTrue('gl.createTexture() instanceof WebGLTexture');
+
+var program = wtu.setupProgram(
+ gl,
+ [wtu.loadShaderFromScript(gl, 'vshader', gl.VERTEX_SHADER),
+ wtu.loadShaderFromScript(gl, 'fshader', gl.FRAGMENT_SHADER)],
+ ['vPosition'], [0]);
+
+shouldBeTrue('gl.getUniformLocation(program, "color") instanceof WebGLUniformLocation');
+shouldBeTrue('gl.getActiveAttrib(program, 0) instanceof WebGLActiveInfo');
+shouldBeTrue('gl.getActiveUniform(program, 0) instanceof WebGLActiveInfo');
+
+debug("");
+debug("Tests that those WebGL objects can not be constructed through new operator");
+debug("");
+
+function shouldThrowWithNew(objectType, objectName)
+{
+ try {
+ new objectType;
+ testFailed('new ' + objectName + ' did not throw');
+ } catch (e) {
+ testPassed('new ' + objectName + ' threw an error');
+ }
+}
+
+shouldThrowWithNew(window.WebGLRenderingContext, 'WebGLRenderingContext');
+shouldThrowWithNew(window.WebGLActiveInfo, 'WebGLActiveInfo');
+shouldThrowWithNew(window.WebGLBuffer, 'WebGLBuffer');
+shouldThrowWithNew(window.WebGLFramebuffer, 'WebGLFramebuffer');
+shouldThrowWithNew(window.WebGLProgram, 'WebGLProgram');
+shouldThrowWithNew(window.WebGLRenderbuffer, 'WebGLRenderbuffer');
+shouldThrowWithNew(window.WebGLShader, 'WebGLShader');
+shouldThrowWithNew(window.WebGLTexture, 'WebGLTexture');
+shouldThrowWithNew(window.WebGLUniformLocation, 'WebGLUniformLocation');
+shouldThrowWithNew(window.WebGLShaderPrecisionFormat, 'WebGLShaderPrecisionFormat');
+
+successfullyParsed = true;
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+
+</body>
+</html>
+
+
--- /dev/null
+WebGL shader precision format test.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+Tests that WebGLShaderPrecisionFormat class and getShaderPrecisionFormat work.
+
+
+Test that getShaderPrecisionFormat returns a WebGLShaderPrecisionFormat object.
+
+PASS gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT) instanceof WebGLShaderPrecisionFormat is true
+PASS gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT) instanceof WebGLShaderPrecisionFormat is true
+PASS gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT) instanceof WebGLShaderPrecisionFormat is true
+PASS gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_INT) instanceof WebGLShaderPrecisionFormat is true
+PASS gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_INT) instanceof WebGLShaderPrecisionFormat is true
+PASS gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_INT) instanceof WebGLShaderPrecisionFormat is true
+PASS gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_FLOAT) instanceof WebGLShaderPrecisionFormat is true
+PASS gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT) instanceof WebGLShaderPrecisionFormat is true
+PASS gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT) instanceof WebGLShaderPrecisionFormat is true
+PASS gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT) instanceof WebGLShaderPrecisionFormat is true
+PASS gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_INT) instanceof WebGLShaderPrecisionFormat is true
+PASS gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT) instanceof WebGLShaderPrecisionFormat is true
+
+Test that getShaderPrecisionFormat throws an error with invalid parameters.
+
+PASS gl.getShaderPrecisionFormat(gl.HIGH_INT, gl.VERTEX_SHADER) generated expected GL error: INVALID_ENUM.
+
+Test that getShaderPrecisionFormat returns the same thing every call.
+
+PASS shaderPrecisionFormat.rangeMin == shaderPrecisionFormat2.rangeMin is true
+PASS shaderPrecisionFormat.rangeMax == shaderPrecisionFormat2.rangeMax is true
+PASS shaderPrecisionFormat.precision == shaderPrecisionFormat2.precision is true
+
--- /dev/null
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL shader precision format test.</title>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css"/>
+<script src="../../js/resources/js-test-pre.js"></script>
+<script src="resources/webgl-test.js"> </script>
+<script src="resources/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="canvas" width="2" height="2" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+var wtu = WebGLTestUtils;
+description(document.title);
+debug("Tests that WebGLShaderPrecisionFormat class and getShaderPrecisionFormat work.");
+debug("");
+var gl = create3DContext(document.getElementById("canvas"));
+
+function verifyShaderPrecisionFormat(shadertype, precisiontype) {
+ shouldBeTrue('gl.getShaderPrecisionFormat(' + shadertype + ', ' +
+ precisiontype + ') instanceof WebGLShaderPrecisionFormat');
+}
+
+debug("");
+debug("Test that getShaderPrecisionFormat returns a WebGLShaderPrecisionFormat object.");
+debug("");
+
+verifyShaderPrecisionFormat('gl.VERTEX_SHADER', 'gl.LOW_FLOAT');
+verifyShaderPrecisionFormat('gl.VERTEX_SHADER', 'gl.MEDIUM_FLOAT');
+verifyShaderPrecisionFormat('gl.VERTEX_SHADER', 'gl.HIGH_FLOAT');
+verifyShaderPrecisionFormat('gl.VERTEX_SHADER', 'gl.LOW_INT');
+verifyShaderPrecisionFormat('gl.VERTEX_SHADER', 'gl.MEDIUM_INT');
+verifyShaderPrecisionFormat('gl.VERTEX_SHADER', 'gl.HIGH_INT');
+verifyShaderPrecisionFormat('gl.FRAGMENT_SHADER', 'gl.LOW_FLOAT');
+verifyShaderPrecisionFormat('gl.FRAGMENT_SHADER', 'gl.MEDIUM_FLOAT');
+verifyShaderPrecisionFormat('gl.FRAGMENT_SHADER', 'gl.HIGH_FLOAT');
+verifyShaderPrecisionFormat('gl.FRAGMENT_SHADER', 'gl.LOW_INT');
+verifyShaderPrecisionFormat('gl.FRAGMENT_SHADER', 'gl.MEDIUM_INT');
+verifyShaderPrecisionFormat('gl.FRAGMENT_SHADER', 'gl.HIGH_INT');
+
+debug("");
+debug("Test that getShaderPrecisionFormat throws an error with invalid parameters.");
+debug("");
+
+shouldGenerateGLError(gl, gl.INVALID_ENUM, 'gl.getShaderPrecisionFormat(gl.HIGH_INT, gl.VERTEX_SHADER)');
+
+debug("");
+debug("Test that getShaderPrecisionFormat returns the same thing every call.");
+debug("");
+
+var shaderPrecisionFormat = gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT);
+var shaderPrecisionFormat2 = gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT);
+shouldBeTrue('shaderPrecisionFormat.rangeMin == shaderPrecisionFormat2.rangeMin');
+shouldBeTrue('shaderPrecisionFormat.rangeMax == shaderPrecisionFormat2.rangeMax');
+shouldBeTrue('shaderPrecisionFormat.precision == shaderPrecisionFormat2.precision');
+
+finishTest();
+</script>
+
+</body>
+</html>
+
+
"WebGLRenderbuffer" : 1,
"WebGLRenderingContext" : 1,
"WebGLShader" : 1,
+ "WebGLShaderPrecisionFormat" : 1,
"WebGLTexture" : 1,
"WebGLUniformLocation" : 1,
"WebKitBlobBuilder" : 1,
"window.WebGLRenderbuffer" : 1,
"window.WebGLRenderingContext" : 1,
"window.WebGLShader" : 1,
+ "window.WebGLShaderPrecisionFormat" : 1,
"window.WebGLTexture" : 1,
"window.WebGLUniformLocation" : 1,
"window.WebKitBlobBuilder" : 1,
type == "WebGLProgramConstructor" ||
type == "WebGLRenderbufferConstructor" ||
type == "WebGLShaderConstructor" ||
+ type == "WebGLShaderPrecisionFormatConstructor" ||
type == "WebGLTextureConstructor" ||
type == "WebGLUniformLocationConstructor" ||
type == "ArrayBufferConstructor" ||
"webkitNotifications",
"webkitAudioPannerNode",
"performance",
- "WebGLRenderingContext", "WebGLActiveInfo", "WebGLBuffer", "WebGLFramebuffer", "WebGLProgram", "WebGLRenderbuffer", "WebGLShader", "WebGLTexture", "WebGLUniformLocation",
+ "WebGLRenderingContext", "WebGLActiveInfo", "WebGLBuffer", "WebGLFramebuffer", "WebGLProgram", "WebGLRenderbuffer", "WebGLShader", "WebGLShaderPrecisionFormat", "WebGLTexture", "WebGLUniformLocation",
"ArrayBuffer",
"DataView", "Int8Array", "Uint8Array", "Int16Array", "Uint16Array", "Int32Array", "Uint32Array", "Float32Array", "Float64Array",
"FileError", "FileReader", "WebKitBlobBuilder", "webkitRequestFileSystem",
name == "WebGLProgram" ||
name == "WebGLRenderbuffer" ||
name == "WebGLShader" ||
+ name == "WebGLShaderPrecisionFormat" ||
name == "WebGLTexture" ||
name == "WebGLUniformLocation" ||
name == "ArrayBuffer" ||
+2012-04-02 Zhenyao Mo <zmo@google.com>
+
+ Implement WebGLShaderPrecisionFormat
+ https://bugs.webkit.org/show_bug.cgi?id=75925
+
+ Reviewed by Kenneth Russell.
+
+ * chromium/public/WebGraphicsContext3D.h: Add getShaderPrecisionFormat().
+ (WebGraphicsContext3D):
+
2012-04-03 Adam Barth <abarth@webkit.org>
Attempt to fix the Windows component build by including these headers
virtual void getRenderbufferParameteriv(WGC3Denum target, WGC3Denum pname, WGC3Dint* value) = 0;
virtual void getShaderiv(WebGLId shader, WGC3Denum pname, WGC3Dint* value) = 0;
virtual WebString getShaderInfoLog(WebGLId shader) = 0;
-
- // TBD
- // void glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
-
+ virtual void getShaderPrecisionFormat(WGC3Denum shadertype, WGC3Denum precisiontype, WGC3Dint* range, WGC3Dint* precision) = 0;
virtual WebString getShaderSource(WebGLId shader) = 0;
virtual WebString getString(WGC3Denum name) = 0;
virtual void getTexParameterfv(WGC3Denum target, WGC3Denum pname, WGC3Dfloat* value) = 0;
html/canvas/WebGLRenderbuffer.cpp
html/canvas/WebGLRenderingContext.cpp
html/canvas/WebGLShader.cpp
+ html/canvas/WebGLShaderPrecisionFormat.cpp
html/canvas/WebGLSharedObject.cpp
html/canvas/WebGLTexture.cpp
html/canvas/WebGLUniformLocation.cpp
html/canvas/WebGLRenderbuffer.idl
html/canvas/WebGLRenderingContext.idl
html/canvas/WebGLShader.idl
+ html/canvas/WebGLShaderPrecisionFormat.idl
html/canvas/WebGLTexture.idl
html/canvas/WebGLUniformLocation.idl
html/canvas/WebGLVertexArrayObjectOES.idl
+2012-04-02 Zhenyao Mo <zmo@google.com>
+
+ Implement WebGLShaderPrecisionFormat
+ https://bugs.webkit.org/show_bug.cgi?id=75925
+
+ Reviewed by Kenneth Russell.
+
+ Test: fast/canvas/webgl/shader-precision-format.html
+
+ * CMakeLists.txt: Add new source files webglshaderprecisionformat.h/idl
+ * DerivedSources.make: Ditto.
+ * DerivedSources.pri: Ditto.
+ * GNUmakefile.list.am: Ditto.
+ * Target.pri: Ditto.
+ * WebCore.gypi: Ditto.
+ * WebCore.xcodeproj/project.pbxproj: Ditto.
+ * html/canvas/WebGLRenderingContext.cpp: Add getShaderPrecisionFormat.
+ (WebCore):
+ (WebCore::WebGLRenderingContext::getShaderPrecisionFormat):
+ * html/canvas/WebGLRenderingContext.h: Ditto.
+ (WebCore):
+ (WebGLRenderingContext):
+ * html/canvas/WebGLRenderingContext.idl: Ditto.
+ * html/canvas/WebGLShaderPrecisionFormat.h: Added.
+ (WebCore):
+ (WebGLShaderPrecisionFormat):
+ (WebCore::WebGLShaderPrecisionFormat::create):
+ (WebCore::WebGLShaderPrecisionFormat::rangeMin):
+ (WebCore::WebGLShaderPrecisionFormat::rangeMax):
+ (WebCore::WebGLShaderPrecisionFormat::precision):
+ (WebCore::WebGLShaderPrecisionFormat::WebGLShaderPrecisionFormat):
+ * html/canvas/WebGLShaderPrecisionFormat.idl: Added.
+ * page/DOMWindow.idl: Expose new type WebGLShaderPrecisionFormat for instanceof.
+ * platform/graphics/GraphicsContext3D.h: Add getShaderPrecisionFormat().
+ * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp: Ditto.
+ (WebCore::GraphicsContext3D::getShaderPrecisionFormat):
+ (WebCore):
+ * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp: Ditto.
+ (WebCore::GraphicsContext3D::getShaderPrecisionFormat):
+ (WebCore):
+ * platform/graphics/qt/GraphicsContext3DQt.cpp: Ditto.
+ (WebCore::GraphicsContext3D::getShaderPrecisionFormat):
+ (WebCore):
+
2012-04-03 Zalan Bujtas <zbujtas@gmail.com>
Frame flattening: Do not restart layout from parent frame, when the parent is clean.
$(WebCore)/html/canvas/WebGLRenderbuffer.idl \
$(WebCore)/html/canvas/WebGLRenderingContext.idl \
$(WebCore)/html/canvas/WebGLShader.idl \
+ $(WebCore)/html/canvas/WebGLShaderPrecisionFormat.idl \
$(WebCore)/html/canvas/WebGLTexture.idl \
$(WebCore)/html/canvas/WebGLUniformLocation.idl \
$(WebCore)/html/canvas/WebGLVertexArrayObjectOES.idl \
$$PWD/html/canvas/WebGLRenderbuffer.idl \
$$PWD/html/canvas/WebGLRenderingContext.idl \
$$PWD/html/canvas/WebGLShader.idl \
+ $$PWD/html/canvas/WebGLShaderPrecisionFormat.idl \
$$PWD/html/canvas/Int16Array.idl \
$$PWD/html/canvas/WebGLTexture.idl \
$$PWD/html/canvas/WebGLUniformLocation.idl \
DerivedSources/WebCore/JSWebGLRenderingContext.h \
DerivedSources/WebCore/JSWebGLShader.cpp \
DerivedSources/WebCore/JSWebGLShader.h \
+ DerivedSources/WebCore/JSWebGLShaderPrecisionFormat.cpp \
+ DerivedSources/WebCore/JSWebGLShaderPrecisionFormat.h \
DerivedSources/WebCore/JSWebGLTexture.cpp \
DerivedSources/WebCore/JSWebGLTexture.h \
DerivedSources/WebCore/JSWebGLUniformLocation.cpp \
$(WebCore)/html/canvas/WebGLRenderbuffer.idl \
$(WebCore)/html/canvas/WebGLRenderingContext.idl \
$(WebCore)/html/canvas/WebGLShader.idl \
+ $(WebCore)/html/canvas/WebGLShaderPrecisionFormat.idl \
$(WebCore)/html/canvas/WebGLTexture.idl \
$(WebCore)/html/canvas/WebGLUniformLocation.idl \
$(WebCore)/html/canvas/WebGLVertexArrayObjectOES.idl \
Source/WebCore/html/canvas/WebGLRenderingContext.h \
Source/WebCore/html/canvas/WebGLShader.cpp \
Source/WebCore/html/canvas/WebGLShader.h \
+ Source/WebCore/html/canvas/WebGLShaderPrecisionFormat.cpp \
+ Source/WebCore/html/canvas/WebGLShaderPrecisionFormat.h \
Source/WebCore/html/canvas/WebGLSharedObject.cpp \
Source/WebCore/html/canvas/WebGLSharedObject.h \
Source/WebCore/html/canvas/WebGLTexture.cpp \
html/canvas/WebGLRenderbuffer.h \
html/canvas/WebGLRenderingContext.h \
html/canvas/WebGLShader.h \
+ html/canvas/WebGLShaderPrecisionFormat.h \
html/canvas/WebGLSharedObject.h \
html/canvas/EXTTextureFilterAnisotropic.h \
html/canvas/OESStandardDerivatives.h \
html/canvas/WebGLRenderbuffer.cpp \
html/canvas/WebGLRenderingContext.cpp \
html/canvas/WebGLShader.cpp \
+ html/canvas/WebGLShaderPrecisionFormat.cpp \
html/canvas/WebGLSharedObject.cpp \
html/canvas/EXTTextureFilterAnisotropic.cpp \
html/canvas/OESStandardDerivatives.cpp \
'html/canvas/WebGLRenderbuffer.idl',
'html/canvas/WebGLRenderingContext.idl',
'html/canvas/WebGLShader.idl',
+ 'html/canvas/WebGLShaderPrecisionFormat.idl',
'html/canvas/WebGLTexture.idl',
'html/canvas/WebGLUniformLocation.idl',
'html/canvas/WebGLVertexArrayObjectOES.idl',
'html/canvas/WebGLRenderingContext.h',
'html/canvas/WebGLShader.cpp',
'html/canvas/WebGLShader.h',
+ 'html/canvas/WebGLShaderPrecisionFormat.cpp',
+ 'html/canvas/WebGLShaderPrecisionFormat.h',
'html/canvas/WebGLSharedObject.cpp',
'html/canvas/WebGLSharedObject.h',
'html/canvas/WebGLTexture.cpp',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSWebGLRenderingContext.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSWebGLShader.cpp',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSWebGLShader.h',
+ '<(PRODUCT_DIR)/DerivedSources/WebCore/JSWebGLShaderPrecisionFormat.cpp',
+ '<(PRODUCT_DIR)/DerivedSources/WebCore/JSWebGLShaderPrecisionFormat.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSWebGLTexture.cpp',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSWebGLTexture.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSWebGLUniformLocation.cpp',
9FFE3EA511B5A4390037874E /* JSMemoryInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9FFE3EA311B5A4390037874E /* JSMemoryInfo.cpp */; };
9FFE3EA611B5A4390037874E /* JSMemoryInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 9FFE3EA411B5A4390037874E /* JSMemoryInfo.h */; };
A00B721A11DE6428008AB9FF /* CheckedInt.h in Headers */ = {isa = PBXBuildFile; fileRef = A00B721911DE6427008AB9FF /* CheckedInt.h */; };
+ A07D3355152B630E001B6393 /* JSWebGLShaderPrecisionFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A07D3353152B630E001B6393 /* JSWebGLShaderPrecisionFormat.cpp */; };
+ A07D3356152B630E001B6393 /* JSWebGLShaderPrecisionFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = A07D3354152B630E001B6393 /* JSWebGLShaderPrecisionFormat.h */; };
+ A07D3358152B632D001B6393 /* WebGLShaderPrecisionFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = A07D3357152B632D001B6393 /* WebGLShaderPrecisionFormat.h */; };
+ A08CF154152B77B3009C5775 /* WebGLShaderPrecisionFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A08CF153152B77B3009C5775 /* WebGLShaderPrecisionFormat.cpp */; };
A0EE0DF5144F825500F80B0D /* WebGLDebugRendererInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0EE0DF1144F825500F80B0D /* WebGLDebugRendererInfo.cpp */; };
A0EE0DF6144F825500F80B0D /* WebGLDebugRendererInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = A0EE0DF2144F825500F80B0D /* WebGLDebugRendererInfo.h */; };
A0EE0DF7144F825500F80B0D /* WebGLDebugShaders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0EE0DF3144F825500F80B0D /* WebGLDebugShaders.cpp */; };
9FFE3EA311B5A4390037874E /* JSMemoryInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMemoryInfo.cpp; sourceTree = "<group>"; };
9FFE3EA411B5A4390037874E /* JSMemoryInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMemoryInfo.h; sourceTree = "<group>"; };
A00B721911DE6427008AB9FF /* CheckedInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CheckedInt.h; path = canvas/CheckedInt.h; sourceTree = "<group>"; };
+ A07D3353152B630E001B6393 /* JSWebGLShaderPrecisionFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLShaderPrecisionFormat.cpp; sourceTree = "<group>"; };
+ A07D3354152B630E001B6393 /* JSWebGLShaderPrecisionFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGLShaderPrecisionFormat.h; sourceTree = "<group>"; };
+ A07D3357152B632D001B6393 /* WebGLShaderPrecisionFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebGLShaderPrecisionFormat.h; path = canvas/WebGLShaderPrecisionFormat.h; sourceTree = "<group>"; };
+ A07D3359152B633E001B6393 /* WebGLShaderPrecisionFormat.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WebGLShaderPrecisionFormat.idl; path = canvas/WebGLShaderPrecisionFormat.idl; sourceTree = "<group>"; };
+ A08CF153152B77B3009C5775 /* WebGLShaderPrecisionFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebGLShaderPrecisionFormat.cpp; path = canvas/WebGLShaderPrecisionFormat.cpp; sourceTree = "<group>"; };
A0EE0DEF144F823200F80B0D /* WebGLDebugShaders.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WebGLDebugShaders.idl; path = canvas/WebGLDebugShaders.idl; sourceTree = "<group>"; };
A0EE0DF0144F824300F80B0D /* WebGLDebugRendererInfo.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WebGLDebugRendererInfo.idl; path = canvas/WebGLDebugRendererInfo.idl; sourceTree = "<group>"; };
A0EE0DF1144F825500F80B0D /* WebGLDebugRendererInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebGLDebugRendererInfo.cpp; path = canvas/WebGLDebugRendererInfo.cpp; sourceTree = "<group>"; };
49484FAE102CF01E00187DD3 /* canvas */ = {
isa = PBXGroup;
children = (
+ A08CF153152B77B3009C5775 /* WebGLShaderPrecisionFormat.cpp */,
+ A07D3359152B633E001B6393 /* WebGLShaderPrecisionFormat.idl */,
+ A07D3357152B632D001B6393 /* WebGLShaderPrecisionFormat.h */,
49EECDCC10503C2300099FAB /* ArrayBuffer.idl */,
49EECDC910503C2300099FAB /* ArrayBufferView.idl */,
6E4E91A710F7FB3100A2779C /* CanvasContextAttributes.cpp */,
49EED1411051969400099FAB /* JSWebGLRenderingContext.h */,
49C7B98F1042D2D30009D447 /* JSWebGLShader.cpp */,
49C7B9901042D2D30009D447 /* JSWebGLShader.h */,
+ A07D3353152B630E001B6393 /* JSWebGLShaderPrecisionFormat.cpp */,
+ A07D3354152B630E001B6393 /* JSWebGLShaderPrecisionFormat.h */,
49C7B9911042D2D30009D447 /* JSWebGLTexture.cpp */,
49C7B9921042D2D30009D447 /* JSWebGLTexture.h */,
0C45342510CDBBFA00869157 /* JSWebGLUniformLocation.cpp */,
93F199ED08245E59001E9ABC /* XSLTProcessor.h in Headers */,
E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
977E2E0F12F0FC9C00C13379 /* XSSAuditor.h in Headers */,
- FD581FAF1520F91F003A7A75 /* Oscillator.h in Headers */,
- FD581FB51520F93B003A7A75 /* WaveTable.h in Headers */,
- FDEA6243152102E200479DF0 /* JSOscillator.h in Headers */,
- FDEA6247152102FC00479DF0 /* JSWaveTable.h in Headers */,
+ FD581FAF1520F91F003A7A75 /* Oscillator.h in Headers */,
+ FD581FB51520F93B003A7A75 /* WaveTable.h in Headers */,
+ FDEA6243152102E200479DF0 /* JSOscillator.h in Headers */,
+ FDEA6247152102FC00479DF0 /* JSWaveTable.h in Headers */,
FD537353137B651800008DCE /* ZeroPole.h in Headers */,
1A3586E015264C450022A659 /* RenderMultiColumnFlowThread.h in Headers */,
E1B25107152A0BB00069B779 /* StylePropertyShorthand.h in Headers */,
+ A07D3356152B630E001B6393 /* JSWebGLShaderPrecisionFormat.h in Headers */,
+ A07D3358152B632D001B6393 /* WebGLShaderPrecisionFormat.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
1A3FF9C315265359002288A1 /* RenderNamedFlowThread.cpp in Sources */,
E1B25106152A0BAF0069B779 /* StylePropertyShorthand.cpp in Sources */,
71CC7A20152A0BFE009EEAF9 /* SVGAnimatedEnumeration.cpp in Sources */,
+ A07D3355152B630E001B6393 /* JSWebGLShaderPrecisionFormat.cpp in Sources */,
+ A08CF154152B77B3009C5775 /* WebGLShaderPrecisionFormat.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
#include "WebGLProgram.h"
#include "WebGLRenderbuffer.h"
#include "WebGLShader.h"
+#include "WebGLShaderPrecisionFormat.h"
#include "WebGLTexture.h"
#include "WebGLUniformLocation.h"
return ensureNotNull(m_context->getShaderInfoLog(objectOrZero(shader)));
}
+PassRefPtr<WebGLShaderPrecisionFormat> WebGLRenderingContext::getShaderPrecisionFormat(GC3Denum shaderType, GC3Denum precisionType, ExceptionCode& ec)
+{
+ UNUSED_PARAM(ec);
+ if (isContextLost())
+ return 0;
+ switch (shaderType) {
+ case GraphicsContext3D::VERTEX_SHADER:
+ case GraphicsContext3D::FRAGMENT_SHADER:
+ break;
+ default:
+ synthesizeGLError(GraphicsContext3D::INVALID_ENUM, "getShaderPrecisionFormat", "invalid shader type");
+ return 0;
+ }
+ switch (precisionType) {
+ case GraphicsContext3D::LOW_FLOAT:
+ case GraphicsContext3D::MEDIUM_FLOAT:
+ case GraphicsContext3D::HIGH_FLOAT:
+ case GraphicsContext3D::LOW_INT:
+ case GraphicsContext3D::MEDIUM_INT:
+ case GraphicsContext3D::HIGH_INT:
+ break;
+ default:
+ synthesizeGLError(GraphicsContext3D::INVALID_ENUM, "getShaderPrecisionFormat", "invalid precision type");
+ return 0;
+ }
+
+ GC3Dint range[2] = {0, 0};
+ GC3Dint precision = 0;
+ m_context->getShaderPrecisionFormat(shaderType, precisionType, range, &precision);
+ return WebGLShaderPrecisionFormat::create(range[0], range[1], precision);
+}
+
String WebGLRenderingContext::getShaderSource(WebGLShader* shader, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
class WebGLRenderbuffer;
class WebGLShader;
class WebGLSharedObject;
+class WebGLShaderPrecisionFormat;
class WebGLTexture;
class WebGLUniformLocation;
class WebGLVertexArrayObjectOES;
WebGLGetInfo getRenderbufferParameter(GC3Denum target, GC3Denum pname, ExceptionCode&);
WebGLGetInfo getShaderParameter(WebGLShader*, GC3Denum pname, ExceptionCode&);
String getShaderInfoLog(WebGLShader*, ExceptionCode&);
-
- // TBD
- // void glGetShaderPrecisionFormat (GC3Denum shadertype, GC3Denum precisiontype, GC3Dint* range, GC3Dint* precision);
-
+ PassRefPtr<WebGLShaderPrecisionFormat> getShaderPrecisionFormat(GC3Denum shaderType, GC3Denum precisionType, ExceptionCode&);
String getShaderSource(WebGLShader*, ExceptionCode&);
Vector<String> getSupportedExtensions();
WebGLGetInfo getTexParameter(GC3Denum target, GC3Denum pname, ExceptionCode&);
[StrictTypeChecking, TreatReturnedNullStringAs=Null] DOMString getShaderInfoLog(in WebGLShader shader) raises(DOMException);
- // TBD
- // void glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
+ [StrictTypeChecking] WebGLShaderPrecisionFormat getShaderPrecisionFormat(in unsigned long shadertype, in unsigned long precisiontype) raises(DOMException);
[StrictTypeChecking, TreatReturnedNullStringAs=Null] DOMString getShaderSource(in WebGLShader shader) raises(DOMException);
--- /dev/null
+/*
+ * Copyright (c) 2012, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(WEBGL)
+
+#include "WebGLShaderPrecisionFormat.h"
+
+namespace WebCore {
+
+// static
+PassRefPtr<WebGLShaderPrecisionFormat> WebGLShaderPrecisionFormat::create(GC3Dint rangeMin, GC3Dint rangeMax, GC3Dint precision)
+{
+ return adoptRef(new WebGLShaderPrecisionFormat(rangeMin, rangeMax, precision));
+}
+
+GC3Dint WebGLShaderPrecisionFormat::rangeMin() const
+{
+ return m_rangeMin;
+}
+
+GC3Dint WebGLShaderPrecisionFormat::rangeMax() const
+{
+ return m_rangeMax;
+}
+
+GC3Dint WebGLShaderPrecisionFormat::precision() const
+{
+ return m_precision;
+}
+
+WebGLShaderPrecisionFormat::WebGLShaderPrecisionFormat(GC3Dint rangeMin, GC3Dint rangeMax, GC3Dint precision)
+ : m_rangeMin(rangeMin)
+ , m_rangeMax(rangeMax)
+ , m_precision(precision)
+{
+}
+
+}
+
+#endif // ENABLE(WEBGL)
+
--- /dev/null
+/*
+ * Copyright (c) 2012, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebGLShaderPrecisionFormat_h
+#define WebGLShaderPrecisionFormat_h
+
+#include "GraphicsContext3D.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class WebGLShaderPrecisionFormat : public RefCounted<WebGLShaderPrecisionFormat> {
+public:
+ static PassRefPtr<WebGLShaderPrecisionFormat> create(GC3Dint rangeMin, GC3Dint rangeMax, GC3Dint precision);
+
+ GC3Dint rangeMin() const;
+ GC3Dint rangeMax() const;
+ GC3Dint precision() const;
+
+private:
+ WebGLShaderPrecisionFormat(GC3Dint rangeMin, GC3Dint rangeMax, GC3Dint precision);
+
+ GC3Dint m_rangeMin;
+ GC3Dint m_rangeMax;
+ GC3Dint m_precision;
+};
+
+}
+
+#endif // WebGLShaderPrecisionFormat_h
--- /dev/null
+/*
+ * Copyright (c) 2012, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module html {
+
+ interface [
+ Conditional=WEBGL,
+ ] WebGLShaderPrecisionFormat {
+ readonly attribute int rangeMin;
+ readonly attribute int rangeMax;
+ readonly attribute int precision;
+ };
+
+}
attribute [Conditional=WEBGL] WebGLRenderbufferConstructor WebGLRenderbuffer;
attribute [Conditional=WEBGL] WebGLRenderingContextConstructor WebGLRenderingContext;
attribute [Conditional=WEBGL] WebGLShaderConstructor WebGLShader;
+ attribute [Conditional=WEBGL] WebGLShaderPrecisionFormatConstructor WebGLShaderPrecisionFormat;
attribute [Conditional=WEBGL] WebGLTextureConstructor WebGLTexture;
attribute [Conditional=WEBGL] WebGLUniformLocationConstructor WebGLUniformLocation;
void getRenderbufferParameteriv(GC3Denum target, GC3Denum pname, GC3Dint* value);
void getShaderiv(Platform3DObject, GC3Denum pname, GC3Dint* value);
String getShaderInfoLog(Platform3DObject);
-
- // TBD
- // void glGetShaderPrecisionFormat (GC3Denum shadertype, GC3Denum precisiontype, GC3Dint* range, GC3Dint* precision);
-
+ void getShaderPrecisionFormat(GC3Denum shaderType, GC3Denum precisionType, GC3Dint* range, GC3Dint* precision);
String getShaderSource(Platform3DObject);
String getString(GC3Denum name);
void getTexParameterfv(GC3Denum target, GC3Denum pname, GC3Dfloat* value);
}
}
+void GraphicsContext3D::getShaderPrecisionFormat(GC3Denum shaderType, GC3Denum precisionType, GC3Dint* range, GC3Dint* precision)
+{
+ UNUSED_PARAM(shaderType);
+ ASSERT(range);
+ ASSERT(precision);
+
+ makeContextCurrent();
+
+ // These constants came from the Chromium port; we believe they originally
+ // came from making the actual API call on a representative desktop system.
+ switch (precisionType) {
+ case GraphicsContext3D::LOW_INT:
+ case GraphicsContext3D::MEDIUM_INT:
+ case GraphicsContext3D::HIGH_INT:
+ range[0] = -31;
+ range[1] = 31;
+ precision[0] = 0;
+ break;
+ case GraphicsContext3D::LOW_FLOAT:
+ case GraphicsContext3D::MEDIUM_FLOAT:
+ case GraphicsContext3D::HIGH_FLOAT:
+ range[0] = -62;
+ range[1] = 62;
+ precision[0] = -16;
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+}
+
bool GraphicsContext3D::texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, const void* pixels)
{
if (width && height && !pixels) {
::glGetIntegerv(pname, value);
}
+void GraphicsContext3D::getShaderPrecisionFormat(GC3Denum shaderType, GC3Denum precisionType, GC3Dint* range, GC3Dint* precision)
+{
+ ASSERT(range);
+ ASSERT(precision);
+
+ makeContextCurrent();
+ ::glGetShaderPrecisionFormat(shaderType, precisionType, range, precision);
+}
+
bool GraphicsContext3D::texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, const void* pixels)
{
if (width && height && !pixels) {
return result;
}
+void GraphicsContext3D::getShaderPrecisionFormat(GC3Denum shaderType, GC3Denum precisionType, GC3Dint* range, GC3Dint* precision)
+{
+ // FIXME: this should be retargeted at the real getShaderPrecisionFormat()
+ // call on true ES 2.0 hardware.
+ UNUSED_PARAM(shaderType);
+ ASSERT(range);
+ ASSERT(precision);
+
+ makeContextCurrent();
+
+ // These constants came from the Chromium port; we believe they originally
+ // came from making the actual API call on a representative desktop system.
+ switch (precisionType) {
+ case GraphicsContext3D::LOW_INT:
+ case GraphicsContext3D::MEDIUM_INT:
+ case GraphicsContext3D::HIGH_INT:
+ range[0] = -31;
+ range[1] = 31;
+ precision[0] = 0;
+ break;
+ case GraphicsContext3D::LOW_FLOAT:
+ case GraphicsContext3D::MEDIUM_FLOAT:
+ case GraphicsContext3D::HIGH_FLOAT:
+ range[0] = -62;
+ range[1] = 62;
+ precision[0] = -16;
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+}
+
String GraphicsContext3D::getShaderSource(Platform3DObject shader)
{
makeContextCurrent();
+2012-04-02 Zhenyao Mo <zmo@google.com>
+
+ Implement WebGLShaderPrecisionFormat
+ https://bugs.webkit.org/show_bug.cgi?id=75925
+
+ Reviewed by Kenneth Russell.
+
+ * src/GraphicsContext3DChromium.cpp: Add getShaderPrecisionFormat().
+ (WebCore):
+ * src/GraphicsContext3DPrivate.h: Ditto.
+ (GraphicsContext3DPrivate):
+ * tests/FakeWebGraphicsContext3D.h: Ditto.
+ (FakeWebGraphicsContext3D):
+
2012-04-03 Dirk Pranke <dpranke@chromium.org>
disable incremental linking for debug of webkit
return m_impl->getShaderInfoLog(shader);
}
+DELEGATE_TO_IMPL_4(getShaderPrecisionFormat, GC3Denum, GC3Denum, GC3Dint*, GC3Dint*)
+
String GraphicsContext3DPrivate::getShaderSource(Platform3DObject shader)
{
return m_impl->getShaderSource(shader);
DELEGATE_TO_INTERNAL_3(getRenderbufferParameteriv, GC3Denum, GC3Denum, GC3Dint*)
DELEGATE_TO_INTERNAL_3(getShaderiv, Platform3DObject, GC3Denum, GC3Dint*)
DELEGATE_TO_INTERNAL_1R(getShaderInfoLog, Platform3DObject, String)
+DELEGATE_TO_INTERNAL_4(getShaderPrecisionFormat, GC3Denum, GC3Denum, GC3Dint*, GC3Dint*)
DELEGATE_TO_INTERNAL_1R(getShaderSource, Platform3DObject, String)
DELEGATE_TO_INTERNAL_1R(getString, GC3Denum, String)
DELEGATE_TO_INTERNAL_3(getTexParameterfv, GC3Denum, GC3Denum, GC3Dfloat*)
void getRenderbufferParameteriv(GC3Denum target, GC3Denum pname, GC3Dint* value);
void getShaderiv(Platform3DObject, GC3Denum pname, GC3Dint* value);
String getShaderInfoLog(Platform3DObject);
+ void getShaderPrecisionFormat(GC3Denum shaderType, GC3Denum precisionType, GC3Dint* range, GC3Dint* precision);
String getShaderSource(Platform3DObject);
String getString(GC3Denum name);
}
virtual WebString getShaderInfoLog(WebGLId shader) { return WebString(); }
-
+ virtual void getShaderPrecisionFormat(WGC3Denum shadertype, WGC3Denum precisiontype, WGC3Dint* range, WGC3Dint* precision) { }
virtual WebString getShaderSource(WebGLId shader) { return WebString(); }
virtual WebString getString(WGC3Denum name) { return WebString(); }
virtual void getTexParameterfv(WGC3Denum target, WGC3Denum pname, WGC3Dfloat* value) { }