<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[160119] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/160119">160119</a></dd>
<dt>Author</dt> <dd>dino@apple.com</dd>
<dt>Date</dt> <dd>2013-12-04 13:25:50 -0800 (Wed, 04 Dec 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>Source/WebCore: [WebGL] Support for texImage2D of type HALF_FLOAT_OES
https://bugs.webkit.org/show_bug.cgi?id=110936
Reviewed by Brent Fulgham.
Add support for the HALF_FLOAT_OES texture format from texImage2D
and texSubImage2D.
A lot of this patch comes from the original patch on the bug
by Nayan Kumar, and the Blink commit:
https://codereview.chromium.org/13842017
Tests: fast/canvas/webgl/oes-texture-half-float-with-canvas.html
fast/canvas/webgl/oes-texture-half-float-with-image.html
fast/canvas/webgl/oes-texture-half-float-with-video.html
* html/canvas/OESTextureHalfFloat.idl: New HALF_FLOAT_OES constant value.
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::validateTexFunc): Remove the code that
would bail if half-float values were used.
* platform/graphics/GraphicsContext3D.cpp:
- Return appropriate DataFormats for half floating point types.
- Copy the float -> half-float code from Blink
- New pack functions for half floats
* platform/graphics/GraphicsContext3D.h: New format types.
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::texSubImage2D): Use GL_HALF_FLOAT_ARB if we're passed
a HALF_FLOAT_OES.
LayoutTests: [WebGL] Support for texImage2D/texSubImage2D of type HALF_FLOAT_OES
https://bugs.webkit.org/show_bug.cgi?id=110936
Reviewed by Brent Fulgham.
New tests for half-float textures.
* fast/canvas/webgl/oes-texture-half-float-expected.txt:
* fast/canvas/webgl/oes-texture-half-float-not-supported-expected.txt: Removed.
* fast/canvas/webgl/oes-texture-half-float-not-supported.html: Removed.
* fast/canvas/webgl/oes-texture-half-float-with-canvas-expected.txt: Added.
* fast/canvas/webgl/oes-texture-half-float-with-canvas.html: Added.
* fast/canvas/webgl/oes-texture-half-float-with-image-expected.txt: Added.
* fast/canvas/webgl/oes-texture-half-float-with-image.html: Added.
* fast/canvas/webgl/oes-texture-half-float-with-video-expected.txt: Added.
* fast/canvas/webgl/oes-texture-half-float-with-video.html: Added.
* fast/canvas/webgl/oes-texture-half-float.html:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcanvaswebgloestexturehalffloatexpectedtxt">trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcanvaswebgloestexturehalffloathtml">trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasOESTextureHalfFloatidl">trunk/Source/WebCore/html/canvas/OESTextureHalfFloat.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContextcpp">trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsContext3Dcpp">trunk/Source/WebCore/platform/graphics/GraphicsContext3D.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsContext3Dh">trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsopenglGraphicsContext3DOpenGLCommoncpp">trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcanvaswebgloestexturehalffloatwithcanvasexpectedtxt">trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-canvas-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcanvaswebgloestexturehalffloatwithcanvashtml">trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-canvas.html</a></li>
<li><a href="#trunkLayoutTestsfastcanvaswebgloestexturehalffloatwithimageexpectedtxt">trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-image-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcanvaswebgloestexturehalffloatwithimagehtml">trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-image.html</a></li>
<li><a href="#trunkLayoutTestsfastcanvaswebgloestexturehalffloatwithvideoexpectedtxt">trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-video-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcanvaswebgloestexturehalffloatwithvideohtml">trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-video.html</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcanvaswebgloestexturehalffloatnotsupportedexpectedtxt">trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-not-supported-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcanvaswebgloestexturehalffloatnotsupportedhtml">trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-not-supported.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (160118 => 160119)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2013-12-04 21:21:07 UTC (rev 160118)
+++ trunk/LayoutTests/ChangeLog        2013-12-04 21:25:50 UTC (rev 160119)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2013-12-03 Dean Jackson <dino@apple.com>
+
+ [WebGL] Support for texImage2D/texSubImage2D of type HALF_FLOAT_OES
+ https://bugs.webkit.org/show_bug.cgi?id=110936
+
+ Reviewed by Brent Fulgham.
+
+ New tests for half-float textures.
+
+ * fast/canvas/webgl/oes-texture-half-float-expected.txt:
+ * fast/canvas/webgl/oes-texture-half-float-not-supported-expected.txt: Removed.
+ * fast/canvas/webgl/oes-texture-half-float-not-supported.html: Removed.
+ * fast/canvas/webgl/oes-texture-half-float-with-canvas-expected.txt: Added.
+ * fast/canvas/webgl/oes-texture-half-float-with-canvas.html: Added.
+ * fast/canvas/webgl/oes-texture-half-float-with-image-expected.txt: Added.
+ * fast/canvas/webgl/oes-texture-half-float-with-image.html: Added.
+ * fast/canvas/webgl/oes-texture-half-float-with-video-expected.txt: Added.
+ * fast/canvas/webgl/oes-texture-half-float-with-video.html: Added.
+ * fast/canvas/webgl/oes-texture-half-float.html:
+
</ins><span class="cx"> 2013-12-04 Mihnea Ovidenie <mihnea@adobe.com>
</span><span class="cx">
</span><span class="cx"> [CSSRegions] Test dynamic change of position for out-of-flow transformed element
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvaswebgloestexturehalffloatexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-expected.txt (160118 => 160119)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-expected.txt        2013-12-04 21:21:07 UTC (rev 160118)
+++ trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-expected.txt        2013-12-04 21:25:50 UTC (rev 160119)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+CONSOLE MESSAGE: WebGL: INVALID_ENUM: texImage2D: invalid texture type
+CONSOLE MESSAGE: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
+CONSOLE MESSAGE: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
+CONSOLE MESSAGE: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
+CONSOLE MESSAGE: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
+CONSOLE MESSAGE: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
+CONSOLE MESSAGE: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
+CONSOLE MESSAGE: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
+CONSOLE MESSAGE: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
+CONSOLE MESSAGE: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
+CONSOLE MESSAGE: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
+CONSOLE MESSAGE: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
+CONSOLE MESSAGE: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
+CONSOLE MESSAGE: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
+CONSOLE MESSAGE: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
+CONSOLE MESSAGE: WebGL: INVALID_OPERATION: texImage2D: type HALF_FLOAT_OES but ArrayBufferView is not NULL
</ins><span class="cx"> This test verifies the functionality of OES_texture_half_float with null/non-null ArrayBufferView
</span><span class="cx">
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="lines">@@ -6,7 +22,7 @@
</span><span class="cx"> PASS WebGL context exists
</span><span class="cx"> Testing texture creation with extension disabled, format RGBA, and data null. Expect Failure
</span><span class="cx"> PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
</span><del>-PASS getError was expected value: INVALID_ENUM : Half floating point texture must be diallowed if OES_texture_half_float isn't enabled
</del><ins>+PASS getError was expected value: INVALID_ENUM : Half floating point texture must be disallowed if OES_texture_half_float isn't enabled
</ins><span class="cx"> PASS Successfully enabled OES_texture_half_float extension
</span><span class="cx"> Testing texture creation with extension enabled, format RGBA, and data null. Expect Success
</span><span class="cx"> PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
</span><span class="lines">@@ -25,49 +41,49 @@
</span><span class="cx"> PASS getError was expected value: NO_ERROR : Half floating point texture allocation should succeed if OES_texture_half_float is enabled
</span><span class="cx"> Testing texture creation with extension enabled, format RGBA, and data non-null. Expect Failure
</span><span class="cx"> PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
</span><del>-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be diallowed when ArrayBufferView is not-null
</del><ins>+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
</ins><span class="cx"> Testing texture creation with extension enabled, format RGBA, and data non-null. Expect Failure
</span><span class="cx"> PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
</span><del>-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be diallowed when ArrayBufferView is not-null
</del><ins>+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
</ins><span class="cx"> Testing texture creation with extension enabled, format RGBA, and data non-null. Expect Failure
</span><span class="cx"> PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
</span><del>-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be diallowed when ArrayBufferView is not-null
</del><ins>+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
</ins><span class="cx"> Testing texture creation with extension enabled, format RGB, and data non-null. Expect Failure
</span><span class="cx"> PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
</span><del>-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be diallowed when ArrayBufferView is not-null
</del><ins>+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
</ins><span class="cx"> Testing texture creation with extension enabled, format RGB, and data non-null. Expect Failure
</span><span class="cx"> PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
</span><del>-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be diallowed when ArrayBufferView is not-null
</del><ins>+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
</ins><span class="cx"> Testing texture creation with extension enabled, format RGB, and data non-null. Expect Failure
</span><span class="cx"> PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
</span><del>-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be diallowed when ArrayBufferView is not-null
</del><ins>+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
</ins><span class="cx"> Testing texture creation with extension enabled, format LUMINANCE, and data non-null. Expect Failure
</span><span class="cx"> PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
</span><del>-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be diallowed when ArrayBufferView is not-null
</del><ins>+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
</ins><span class="cx"> Testing texture creation with extension enabled, format LUMINANCE, and data non-null. Expect Failure
</span><span class="cx"> PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
</span><del>-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be diallowed when ArrayBufferView is not-null
</del><ins>+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
</ins><span class="cx"> Testing texture creation with extension enabled, format LUMINANCE, and data non-null. Expect Failure
</span><span class="cx"> PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
</span><del>-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be diallowed when ArrayBufferView is not-null
</del><ins>+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
</ins><span class="cx"> Testing texture creation with extension enabled, format ALPHA, and data non-null. Expect Failure
</span><span class="cx"> PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
</span><del>-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be diallowed when ArrayBufferView is not-null
</del><ins>+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
</ins><span class="cx"> Testing texture creation with extension enabled, format ALPHA, and data non-null. Expect Failure
</span><span class="cx"> PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
</span><del>-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be diallowed when ArrayBufferView is not-null
</del><ins>+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
</ins><span class="cx"> Testing texture creation with extension enabled, format ALPHA, and data non-null. Expect Failure
</span><span class="cx"> PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
</span><del>-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be diallowed when ArrayBufferView is not-null
</del><ins>+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
</ins><span class="cx"> Testing texture creation with extension enabled, format LUMINANCE_ALPHA, and data non-null. Expect Failure
</span><span class="cx"> PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
</span><del>-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be diallowed when ArrayBufferView is not-null
</del><ins>+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
</ins><span class="cx"> Testing texture creation with extension enabled, format LUMINANCE_ALPHA, and data non-null. Expect Failure
</span><span class="cx"> PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
</span><del>-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be diallowed when ArrayBufferView is not-null
</del><ins>+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
</ins><span class="cx"> Testing texture creation with extension enabled, format LUMINANCE_ALPHA, and data non-null. Expect Failure
</span><span class="cx"> PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
</span><del>-PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be diallowed when ArrayBufferView is not-null
</del><ins>+PASS getError was expected value: INVALID_OPERATION : Half floating point texture allocation must be disallowed when ArrayBufferView is not-null
</ins><span class="cx">
</span><span class="cx"> Testing half floating point render target
</span><span class="cx"> PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvaswebgloestexturehalffloatnotsupportedexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-not-supported-expected.txt (160118 => 160119)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-not-supported-expected.txt        2013-12-04 21:21:07 UTC (rev 160118)
+++ trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-not-supported-expected.txt        2013-12-04 21:25:50 UTC (rev 160119)
</span><span class="lines">@@ -1,40 +0,0 @@
</span><del>-Testing not yet supported texture uploads
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-
-PASS WebGL context exists
-PASS Successfully enabled OES_texture_half_float extension
-
-Verify whether uploading ImageData via texImage2D/texSubImage2D is supported
-PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
-PASS getError was expected value: INVALID_OPERATION : Uploading to half float texture is not yet supported
-PASS getError was expected value: NO_ERROR : Uploading null ArrayBufferView to half float texture should succeed
-PASS getError was expected value: INVALID_OPERATION : Uploading to half float texture using texSubImage2D is not supported yet
-
-Verify whether uploading HTMLImageElement via texImage2D/texSubImage2D is supported
-
-Verify whether uploading HTMLCanvasElement via texImage2D/texSubImage2D is supported
-PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
-PASS getError was expected value: INVALID_OPERATION : Uploading to half float texture is not yet supported
-PASS getError was expected value: NO_ERROR : Uploading null ArrayBufferView to half float texture should succeed
-PASS getError was expected value: INVALID_OPERATION : Uploading to half float texture using texSubImage2D is not supported yet
-
-Verify whether uploading HTMLVideoElement via texImage2D/texSubImage2D is supported
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
-PASS getError was expected value: INVALID_OPERATION : Uploading to half float texture is not yet supported
-PASS getError was expected value: NO_ERROR : Uploading null ArrayBufferView to half float texture should succeed
-PASS getError was expected value: INVALID_OPERATION : Uploading to half float texture using texSubImage2D is not supported yet
-PASS getError was expected value: NO_ERROR : texture parameter setup should succeed
-PASS getError was expected value: INVALID_OPERATION : Uploading to half float texture is not yet supported
-PASS getError was expected value: NO_ERROR : Uploading null ArrayBufferView to half float texture should succeed
-PASS getError was expected value: INVALID_OPERATION : Uploading to half float texture using texSubImage2D is not supported yet
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestsfastcanvaswebgloestexturehalffloatnotsupportedhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-not-supported.html (160118 => 160119)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-not-supported.html        2013-12-04 21:21:07 UTC (rev 160118)
+++ trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-not-supported.html        2013-12-04 21:25:50 UTC (rev 160119)
</span><span class="lines">@@ -1,169 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<title>WebGL OES_texture_half_float not yet implemented Conformance Tests</title>
-<script src="resources/desktop-gl-constants.js" type="text/javascript"></script>
-<script src="../../../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="texcanvas" width="1" height="2"></canvas>
-<script>
-description("Testing not yet supported texture uploads");
-debug("");
-
-if (window.initNonKhronosFramework) {
- window.initNonKhronosFramework(true);
-}
-
-if (window.internals)
- window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
-
-var wtu = WebGLTestUtils;
-var canvas = document.getElementById("canvas");
-var gl = wtu.create3DContext(canvas);
-var successfullyParsed = false;
-
-if (!gl) {
- testFailed("WebGL context does not exists");
-} else {
- testPassed("WebGL context exists");
-
- if(!gl.getExtension("OES_texture_half_float")) {
- testPassed("No OES_texture_half_float support. This is legal");
- } else {
- testPassed("Successfully enabled OES_texture_half_float extension");
-
- var canvas2d = document.getElementById("texcanvas");
- var context2d = canvas2d.getContext("2d");
-
- runImageDataUnsupportedTest(canvas2d, context2d);
- runHTMLImageElementUnsupportedTest(canvas2d, context2d);
- runHTMLCanvasElementUnsupportedTest(canvas2d, context2d);
- runHTMLVideoElementUnsupportedTest(canvas2d, context2d);
- }
-}
-
-function allocateTexture()
-{
- var texture = gl.createTexture();
- gl.bindTexture(gl.TEXTURE_2D, texture);
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
- glErrorShouldBe(gl, gl.NO_ERROR, "texture parameter setup should succeed");
- return texture;
-}
-
-function runTextureUploadTest(image)
-{
- var texture = allocateTexture();
- gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.HALF_FLOAT_OES, image);
- glErrorShouldBe(gl, gl.INVALID_OPERATION, "Uploading to half float texture is not yet supported");
-
- // Check if uploading ImageData via texSubImage2D is supported
- gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 2, 0, gl.RGBA, gl.HALF_FLOAT_OES, null);
- glErrorShouldBe(gl, gl.NO_ERROR, "Uploading null ArrayBufferView to half float texture should succeed");
- gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.HALF_FLOAT_OES, image);
- glErrorShouldBe(gl, gl.INVALID_OPERATION, "Uploading to half float texture using texSubImage2D is not supported yet");
-}
-
-function runImageDataUnsupportedTest(canvas2d, context2d)
-{
- debug("");
- debug("Verify whether uploading ImageData via texImage2D/texSubImage2D is supported");
-
- // Check if uploading ImageData via texImage2D is supported
- var imageData = context2d.createImageData(1, 2);
- var data = imageData.data;
- data[0] = 255;
- data[1] = 0;
- data[2] = 0;
- data[3] = 255;
- data[4] = 0;
- data[5] = 255;
- data[6] = 0;
- data[7] = 0;
-
- runTextureUploadTest(imageData);
-}
-
-function runHTMLImageElementUnsupportedTest(canvas2d, context2d)
-{
- debug("");
- debug("Verify whether uploading HTMLImageElement via texImage2D/texSubImage2D is supported");
-
- var imageData = context2d.createImageData(1, 2);
- var data = imageData.data;
- data[0] = 255;
- data[1] = 0;
- data[2] = 0;
- data[3] = 255;
- data[4] = 0;
- data[5] = 255;
- data[6] = 0;
- data[7] = 0;
- context2d.putImageData(imageData, 0, 0);
-
- var newImage = document.createElement("img");
- newImage.onload = function() {
- runTextureUploadTest(newImage);
- }
- newImage.src = canvas2d.toDataURL();
-}
-
-function setCanvasToRedGreen(ctx) {
- var width = ctx.canvas.width;
- var height = ctx.canvas.height;
- var halfHeight = Math.floor(height / 2);
- ctx.fillStyle = "#ff0000";
- ctx.fillRect(0, 0, width, halfHeight);
- ctx.fillStyle = "#00ff00";
- ctx.fillRect(0, halfHeight, width, height - halfHeight);
-}
-
-function runHTMLCanvasElementUnsupportedTest(canvas2d, context2d)
-{
- debug("");
- debug("Verify whether uploading HTMLCanvasElement via texImage2D/texSubImage2D is supported");
-
- context2d.width = 1;
- context2d.height = 2;
- setCanvasToRedGreen(context2d);
-
- runTextureUploadTest(canvas2d);
-}
-
-function runHTMLVideoElementUnsupportedTest(canvas2d, context2d)
-{
- debug("");
- debug("Verify whether uploading HTMLVideoElement via texImage2D/texSubImage2D is supported");
-
- var info = { src: "resources/red-green.mp4", type: 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"'};
- var video = document.createElement("video");
- if (!video.canPlayType) {
- testFailed("video.canPlayType required method is missing");
- return;
- }
- document.body.appendChild(video);
- video.addEventListener(
- "playing", function() { runTextureUploadTest(video); finishTest(); }, true);
- video.type = info.type;
- video.src = info.src;
- video.loop = true;
- video.width = 1;
- video.height = 2;
- video.play();
-
-}
-
-debug("");
-
-</script>
-<script src="../../../resources/js-test-post.js"></script>
-</body>
-</html>
-
</del></span></pre></div>
<a id="trunkLayoutTestsfastcanvaswebgloestexturehalffloatwithcanvasexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-canvas-expected.txt (0 => 160119)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-canvas-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-canvas-expected.txt        2013-12-04 21:25:50 UTC (rev 160119)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+Verify texImage2D and texSubImage2D code paths taking canvas elements (RGBA/HALF_FLOAT_OES)
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+PASS Successfully enabled OES_texture_half_float extension
+Testing texImage2D with flipY=true
+Checking lower left corner
+PASS shouldBe 0,255,0
+Checking upper left corner
+PASS shouldBe 255,0,0
+Testing texImage2D with flipY=false
+Checking lower left corner
+PASS shouldBe 255,0,0
+Checking upper left corner
+PASS shouldBe 0,255,0
+Testing texSubImage2D with flipY=true
+Checking lower left corner
+PASS shouldBe 0,255,0
+Checking upper left corner
+PASS shouldBe 255,0,0
+Testing texSubImage2D with flipY=false
+Checking lower left corner
+PASS shouldBe 255,0,0
+Checking upper left corner
+PASS shouldBe 0,255,0
+PASS getError was expected value: NO_ERROR : should be no errors
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-canvas-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsfastcanvaswebgloestexturehalffloatwithcanvashtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-canvas.html (0 => 160119)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-canvas.html         (rev 0)
+++ trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-canvas.html        2013-12-04 21:25:50 UTC (rev 160119)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+<!--
+
+/*
+** Copyright (c) 2013 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="resources/desktop-gl-constants.js" type="text/javascript"></script>
+<script src="../../../resources/js-test-pre.js"></script>
+<script src="resources/webgl-test.js"></script>
+<script src="resources/webgl-test-utils.js"></script>
+<script src="resources/tex-image-and-sub-image-2d-with-canvas.js"></script>
+<script>
+"use strict";
+function testPrologue(gl) {
+ var ext = null;
+
+ if (!(ext = gl.getExtension("OES_texture_half_float"))) {
+ testPassed("No OES_texture_half_float support -- this is legal");
+ return false;
+ }
+
+ // Required by the test harness.
+ gl.HALF_FLOAT_OES = ext.HALF_FLOAT_OES;
+ testPassed("Successfully enabled OES_texture_half_float extension");
+ return true;
+}
+</script>
+</head>
+<body onload='generateTest("RGBA", "HALF_FLOAT_OES", testPrologue)()'>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+</html>
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-canvas.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsfastcanvaswebgloestexturehalffloatwithimageexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-image-expected.txt (0 => 160119)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-image-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-image-expected.txt        2013-12-04 21:25:50 UTC (rev 160119)
</span><span class="lines">@@ -0,0 +1,70 @@
</span><ins>+Verify texImage2D and texSubImage2D code paths taking image elements (RGBA/HALF_FLOAT_OES)
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+PASS Successfully enabled OES_texture_half_float extension
+Testing texImage2D with flipY=true
+Checking lower left corner
+PASS shouldBe 0,255,0
+Checking upper left corner
+PASS shouldBe 255,0,0
+Testing texImage2D with flipY=false
+Checking lower left corner
+PASS shouldBe 255,0,0
+Checking upper left corner
+PASS shouldBe 0,255,0
+Testing texSubImage2D with flipY=true
+Checking lower left corner
+PASS shouldBe 0,255,0
+Checking upper left corner
+PASS shouldBe 255,0,0
+Testing texSubImage2D with flipY=false
+Checking lower left corner
+PASS shouldBe 255,0,0
+Checking upper left corner
+PASS shouldBe 0,255,0
+Testing texImage2D with flipY=true
+Checking lower left corner
+PASS shouldBe 0,255,0
+Checking upper left corner
+PASS shouldBe 255,0,0
+Testing texImage2D with flipY=false
+Checking lower left corner
+PASS shouldBe 255,0,0
+Checking upper left corner
+PASS shouldBe 0,255,0
+Testing texSubImage2D with flipY=true
+Checking lower left corner
+PASS shouldBe 0,255,0
+Checking upper left corner
+PASS shouldBe 255,0,0
+Testing texSubImage2D with flipY=false
+Checking lower left corner
+PASS shouldBe 255,0,0
+Checking upper left corner
+PASS shouldBe 0,255,0
+Testing texImage2D with flipY=true
+Checking lower left corner
+PASS shouldBe 0,255,0
+Checking upper left corner
+PASS shouldBe 255,0,0
+Testing texImage2D with flipY=false
+Checking lower left corner
+PASS shouldBe 255,0,0
+Checking upper left corner
+PASS shouldBe 0,255,0
+Testing texSubImage2D with flipY=true
+Checking lower left corner
+PASS shouldBe 0,255,0
+Checking upper left corner
+PASS shouldBe 255,0,0
+Testing texSubImage2D with flipY=false
+Checking lower left corner
+PASS shouldBe 255,0,0
+Checking upper left corner
+PASS shouldBe 0,255,0
+PASS getError was expected value: NO_ERROR : should be no errors
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-image-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsfastcanvaswebgloestexturehalffloatwithimagehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-image.html (0 => 160119)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-image.html         (rev 0)
+++ trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-image.html        2013-12-04 21:25:50 UTC (rev 160119)
</span><span class="lines">@@ -0,0 +1,60 @@
</span><ins>+<!--
+
+/*
+** Copyright (c) 2013 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="resources/desktop-gl-constants.js" type="text/javascript"></script>
+<script src="../../../resources/js-test-pre.js"></script>
+<script src="resources/webgl-test.js"></script>
+<script src="resources/webgl-test-utils.js"></script>
+<script src="resources/tex-image-and-sub-image-2d-with-image.js"></script>
+<script>
+"use strict";
+function testPrologue(gl) {
+ var ext = null;
+
+ if (!(ext = gl.getExtension("OES_texture_half_float"))) {
+ testPassed("No OES_texture_half_float support -- this is legal");
+ return false;
+ }
+
+ // Required by the test harness.
+ gl.HALF_FLOAT_OES = ext.HALF_FLOAT_OES;
+
+ testPassed("Successfully enabled OES_texture_half_float extension");
+ return true;
+}
+</script>
+</head>
+<body onload='generateTest("RGBA", "HALF_FLOAT_OES", ".", testPrologue)()'>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+</html>
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-image.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsfastcanvaswebgloestexturehalffloatwithvideoexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-video-expected.txt (0 => 160119)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-video-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-video-expected.txt        2013-12-04 21:25:50 UTC (rev 160119)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+Verify texImage2D and texSubImage2D code paths taking video elements (RGBA/HALF_FLOAT_OES)
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+PASS Successfully enabled OES_texture_half_float extension
+Testing texImage2D with flipY=true
+Checking lower left corner
+PASS shouldBe 0,255,0
+Checking upper left corner
+PASS shouldBe 255,0,0
+Testing texImage2D with flipY=false
+Checking lower left corner
+PASS shouldBe 255,0,0
+Checking upper left corner
+PASS shouldBe 0,255,0
+Testing texSubImage2D with flipY=true
+Checking lower left corner
+PASS shouldBe 0,255,0
+Checking upper left corner
+PASS shouldBe 255,0,0
+Testing texSubImage2D with flipY=false
+Checking lower left corner
+PASS shouldBe 255,0,0
+Checking upper left corner
+PASS shouldBe 0,255,0
+PASS getError was expected value: NO_ERROR : should be no errors
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-video-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsfastcanvaswebgloestexturehalffloatwithvideohtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-video.html (0 => 160119)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-video.html         (rev 0)
+++ trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-video.html        2013-12-04 21:25:50 UTC (rev 160119)
</span><span class="lines">@@ -0,0 +1,65 @@
</span><ins>+<!--
+
+/*
+** Copyright (c) 2013 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="resources/desktop-gl-constants.js" type="text/javascript"></script>
+<script src="../../../resources/js-test-pre.js"></script>
+<script src="resources/webgl-test.js"></script>
+<script src="resources/webgl-test-utils.js"></script>
+<script src="resources/tex-image-and-sub-image-2d-with-video.js"></script>
+<script>
+"use strict";
+function testPrologue(gl) {
+ var ext = null;
+
+ if (!(ext = gl.getExtension("OES_texture_half_float"))) {
+ testPassed("No OES_texture_half_float support -- this is legal");
+ return false;
+ }
+
+ // Required by the test harness.
+ gl.HALF_FLOAT_OES = ext.HALF_FLOAT_OES;
+
+ testPassed("Successfully enabled OES_texture_half_float extension");
+ return true;
+}
+</script>
+</head>
+<body onload='generateTest("RGBA", "HALF_FLOAT_OES", testPrologue)()'>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<video width="640" height="228" id="vid" controls>
+ <source src="resources/red-green.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
+ <source src="resources/red-green.webmvp8.webm" type='video/webm; codecs="vp8, vorbis"' />
+ <source src="resources/red-green.theora.ogv" type='video/ogg; codecs="theora, vorbis"' />
+</video>
+</body>
+</html>
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float-with-video.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsfastcanvaswebgloestexturehalffloathtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float.html (160118 => 160119)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float.html        2013-12-04 21:21:07 UTC (rev 160118)
+++ trunk/LayoutTests/fast/canvas/webgl/oes-texture-half-float.html        2013-12-04 21:25:50 UTC (rev 160119)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+<!--
+
+/*
+** Copyright (c) 2013 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+-->
+
</ins><span class="cx"> <!DOCTYPE html>
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="lines">@@ -30,7 +57,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> </script>
</span><del>-<!-- Shaders for testing half floating-point render targets -->
</del><ins>+<!-- Shaders for testing half-floating-point render targets -->
</ins><span class="cx"> <script id="positionVertexShader" type="x-shader/x-vertex">
</span><span class="cx"> attribute vec4 vPosition;
</span><span class="cx"> void main()
</span><span class="lines">@@ -45,15 +72,16 @@
</span><span class="cx"> }
</span><span class="cx"> </script>
</span><span class="cx"> <script>
</span><ins>+"use strict"
</ins><span class="cx"> description("This test verifies the functionality of OES_texture_half_float with null/non-null ArrayBufferView");
</span><ins>+
</ins><span class="cx"> debug("");
</span><del>-
-if (window.internals)
- window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
-
</del><span class="cx"> var wtu = WebGLTestUtils;
</span><span class="cx"> var canvas = document.getElementById("canvas");
</span><span class="cx"> var gl = wtu.create3DContext(canvas);
</span><ins>+// This constant must be defined in order to run the texture creation test without the extension enabled.
+var halfFloatOESEnum = 0x8D61;
+var ext = null;
</ins><span class="cx">
</span><span class="cx"> if (!gl) {
</span><span class="cx"> testFailed("WebGL context does not exists");
</span><span class="lines">@@ -63,7 +91,7 @@
</span><span class="cx"> // Verify that allocation of texture fails if extension is not enabled
</span><span class="cx"> runTextureCreationTest(false);
</span><span class="cx">
</span><del>- if(!gl.getExtension("OES_texture_half_float")) {
</del><ins>+ if (!(ext = gl.getExtension("OES_texture_half_float"))) {
</ins><span class="cx"> testPassed("No OES_texture_half_float support. This is legal");
</span><span class="cx"> } else {
</span><span class="cx"> testPassed("Successfully enabled OES_texture_half_float extension");
</span><span class="lines">@@ -73,12 +101,12 @@
</span><span class="cx"> for (var i = 0; i < formats.length; i++) {
</span><span class="cx"> runTextureCreationTest(true, formats[i], null);
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> // Texture creation should fail when passed with non-null ArrayBufferView
</span><span class="cx"> for (var i = 0; i < formats.length; i++) {
</span><span class="cx"> var width = 2;
</span><span class="cx"> var height = 2;
</span><del>-
</del><ins>+
</ins><span class="cx"> // Float32Array
</span><span class="cx"> var float32Data = new Float32Array(width * height * getNumberOfChannels(formats[i]));
</span><span class="cx"> for (var ii = 0; ii < float32Data.length; ii++) {
</span><span class="lines">@@ -98,7 +126,7 @@
</span><span class="cx"> for (var ii = 0; ii < uint16Data.length; ii++) {
</span><span class="cx"> uint16Data[ii] = 1000;
</span><span class="cx"> }
</span><del>- runTextureCreationTest(true, formats[i], uint16Data);
</del><ins>+ runTextureCreationTest(true, formats[i], uint16Data);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Check if attaching texture as FBO target succeeds (Not mandatory)
</span><span class="lines">@@ -151,22 +179,22 @@
</span><span class="cx"> var format = opt_format || gl.RGBA;
</span><span class="cx"> var data = opt_data || null;
</span><span class="cx"> var expectSuccess = true;
</span><del>-
</del><ins>+
</ins><span class="cx"> if (!extensionEnabled || data)
</span><span class="cx"> expectSuccess = false;
</span><span class="cx"> debug("Testing texture creation with extension " + (extensionEnabled ? "enabled" : "disabled") +
</span><span class="cx"> ", format " + getFormatName(format) + ", and data " + (data ? "non-null" : "null") +
</span><del>- ". Expect " + (expectSuccess ? "Success" : "Failure"));
</del><ins>+ ". Expect " + (expectSuccess ? "Success" : "Failure"));
</ins><span class="cx">
</span><span class="cx"> var texture = allocateTexture();
</span><span class="cx"> var width = 2;
</span><span class="cx"> var height = 2;
</span><del>- gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, 0, format, gl.HALF_FLOAT_OES, data);
</del><ins>+ gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, 0, format, halfFloatOESEnum, data);
</ins><span class="cx"> if(!extensionEnabled) {
</span><del>- glErrorShouldBe(gl, gl.INVALID_ENUM, "Half floating point texture must be diallowed if OES_texture_half_float isn't enabled");
</del><ins>+ glErrorShouldBe(gl, gl.INVALID_ENUM, "Half floating point texture must be disallowed if OES_texture_half_float isn't enabled");
</ins><span class="cx"> return;
</span><span class="cx"> } else if (data) {
</span><del>- glErrorShouldBe(gl, gl.INVALID_OPERATION, "Half floating point texture allocation must be diallowed when ArrayBufferView is not-null");
</del><ins>+ glErrorShouldBe(gl, gl.INVALID_OPERATION, "Half floating point texture allocation must be disallowed when ArrayBufferView is not-null");
</ins><span class="cx"> return;
</span><span class="cx"> } else {
</span><span class="cx"> glErrorShouldBe(gl, gl.NO_ERROR, "Half floating point texture allocation should succeed if OES_texture_half_float is enabled");
</span><span class="lines">@@ -186,8 +214,8 @@
</span><span class="cx"> var texture = allocateTexture();
</span><span class="cx"> var width = 2;
</span><span class="cx"> var height = 2;
</span><del>-
- gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.HALF_FLOAT_OES, null);
</del><ins>+
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, ext.HALF_FLOAT_OES, null);
</ins><span class="cx"> glErrorShouldBe(gl, gl.NO_ERROR, "Half floating point texture allocation should succeed if OES_texture_half_float is enabled");
</span><span class="cx">
</span><span class="cx"> // Try to use this texture as render target
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (160118 => 160119)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-12-04 21:21:07 UTC (rev 160118)
+++ trunk/Source/WebCore/ChangeLog        2013-12-04 21:25:50 UTC (rev 160119)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2013-12-03 Dean Jackson <dino@apple.com>
+
+ [WebGL] Support for texImage2D of type HALF_FLOAT_OES
+ https://bugs.webkit.org/show_bug.cgi?id=110936
+
+ Reviewed by Brent Fulgham.
+
+ Add support for the HALF_FLOAT_OES texture format from texImage2D
+ and texSubImage2D.
+
+ A lot of this patch comes from the original patch on the bug
+ by Nayan Kumar, and the Blink commit:
+ https://codereview.chromium.org/13842017
+
+ Tests: fast/canvas/webgl/oes-texture-half-float-with-canvas.html
+ fast/canvas/webgl/oes-texture-half-float-with-image.html
+ fast/canvas/webgl/oes-texture-half-float-with-video.html
+
+ * html/canvas/OESTextureHalfFloat.idl: New HALF_FLOAT_OES constant value.
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::validateTexFunc): Remove the code that
+ would bail if half-float values were used.
+ * platform/graphics/GraphicsContext3D.cpp:
+ - Return appropriate DataFormats for half floating point types.
+ - Copy the float -> half-float code from Blink
+ - New pack functions for half floats
+ * platform/graphics/GraphicsContext3D.h: New format types.
+ * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
+ (WebCore::GraphicsContext3D::texSubImage2D): Use GL_HALF_FLOAT_ARB if we're passed
+ a HALF_FLOAT_OES.
+
</ins><span class="cx"> 2013-12-04 Daniel Bates <dabates@apple.com>
</span><span class="cx">
</span><span class="cx"> Fix the Apple Windows build after <http://trac.webkit.org/changeset/160113>
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasOESTextureHalfFloatidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/OESTextureHalfFloat.idl (160118 => 160119)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/OESTextureHalfFloat.idl        2013-12-04 21:21:07 UTC (rev 160118)
+++ trunk/Source/WebCore/html/canvas/OESTextureHalfFloat.idl        2013-12-04 21:25:50 UTC (rev 160119)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx"> * Copyright (C) 2013 Motorola Mobility LLC. All rights reserved.
</span><ins>+ * Copyright (C) 2013 Apple, Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -28,4 +29,5 @@
</span><span class="cx"> Conditional=WEBGL,
</span><span class="cx"> GenerateIsReachable=ImplWebGLRenderingContext,
</span><span class="cx"> ] interface OESTextureHalfFloat {
</span><ins>+ const GLenum HALF_FLOAT_OES = 0x8D61;
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp (160118 => 160119)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp        2013-12-04 21:21:07 UTC (rev 160118)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp        2013-12-04 21:25:50 UTC (rev 160119)
</span><span class="lines">@@ -3733,13 +3733,6 @@
</span><span class="cx">
</span><span class="cx"> bool WebGLRenderingContext::validateTexFunc(const char* functionName, TexFuncValidationFunctionType functionType, TexFuncValidationSourceType sourceType, GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, GC3Dint xoffset, GC3Dint yoffset)
</span><span class="cx"> {
</span><del>- // FIXME: Uploading {ImageData, HTMLImageElement, HTMLCanvasElement, HTMLVideoElement} to half floating point texture is not supported yet.
- // See https://bugs.webkit.org/show_bug.cgi?id=110936.
- if (sourceType != SourceArrayBufferView && type == GraphicsContext3D::HALF_FLOAT_OES) {
- synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, functionName, "Operation not supported yet");
- return false;
- }
-
</del><span class="cx"> if (!validateTexFuncParameters(functionName, functionType, target, level, internalformat, width, height, border, format, type))
</span><span class="cx"> return false;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsContext3Dcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext3D.cpp (160118 => 160119)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsContext3D.cpp        2013-12-04 21:21:07 UTC (rev 160118)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext3D.cpp        2013-12-04 21:25:50 UTC (rev 160119)
</span><span class="lines">@@ -81,6 +81,27 @@
</span><span class="cx"> case GraphicsContext3D::UNSIGNED_SHORT_5_6_5:
</span><span class="cx"> dstFormat = GraphicsContext3D::DataFormatRGB565;
</span><span class="cx"> break;
</span><ins>+ case GraphicsContext3D::HALF_FLOAT_OES: // OES_texture_half_float
+ switch (destinationFormat) {
+ case GraphicsContext3D::RGB:
+ dstFormat = GraphicsContext3D::DataFormatRGB16F;
+ break;
+ case GraphicsContext3D::RGBA:
+ dstFormat = GraphicsContext3D::DataFormatRGBA16F;
+ break;
+ case GraphicsContext3D::ALPHA:
+ dstFormat = GraphicsContext3D::DataFormatA16F;
+ break;
+ case GraphicsContext3D::LUMINANCE:
+ dstFormat = GraphicsContext3D::DataFormatR16F;
+ break;
+ case GraphicsContext3D::LUMINANCE_ALPHA:
+ dstFormat = GraphicsContext3D::DataFormatRA16F;
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+ break;
</ins><span class="cx"> case GraphicsContext3D::FLOAT: // OES_texture_float
</span><span class="cx"> switch (destinationFormat) {
</span><span class="cx"> case GraphicsContext3D::RGB:
</span><span class="lines">@@ -310,6 +331,129 @@
</span><span class="cx">
</span><span class="cx"> namespace {
</span><span class="cx">
</span><ins>+// Following Float to Half-Float converion code is from the implementation of ftp://www.fox-toolkit.org/pub/fasthalffloatconversion.pdf,
+// "Fast Half Float Conversions" by Jeroen van der Zijp, November 2008 (Revised September 2010).
+// Specially, the basetable[512] and shifttable[512] are generated as follows:
+/*
+unsigned short basetable[512];
+unsigned char shifttable[512];
+
+void generatetables(){
+ unsigned int i;
+ int e;
+ for (i = 0; i < 256; ++i){
+ e = i - 127;
+ if (e < -24){ // Very small numbers map to zero
+ basetable[i | 0x000] = 0x0000;
+ basetable[i | 0x100] = 0x8000;
+ shifttable[i | 0x000] = 24;
+ shifttable[i | 0x100] = 24;
+ }
+ else if (e < -14) { // Small numbers map to denorms
+ basetable[i | 0x000] = (0x0400>>(-e-14));
+ basetable[i | 0x100] = (0x0400>>(-e-14)) | 0x8000;
+ shifttable[i | 0x000] = -e-1;
+ shifttable[i | 0x100] = -e-1;
+ }
+ else if (e <= 15){ // Normal numbers just lose precision
+ basetable[i | 0x000] = ((e+15)<<10);
+ basetable[i| 0x100] = ((e+15)<<10) | 0x8000;
+ shifttable[i|0x000] = 13;
+ shifttable[i|0x100] = 13;
+ }
+ else if (e<128){ // Large numbers map to Infinity
+ basetable[i|0x000] = 0x7C00;
+ basetable[i|0x100] = 0xFC00;
+ shifttable[i|0x000] = 24;
+ shifttable[i|0x100] = 24;
+ }
+ else { // Infinity and NaN's stay Infinity and NaN's
+ basetable[i|0x000] = 0x7C00;
+ basetable[i|0x100] = 0xFC00;
+ shifttable[i|0x000] = 13;
+ shifttable[i|0x100] = 13;
+ }
+ }
+}
+*/
+
+unsigned short baseTable[512] = {
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+0, 0, 0, 0, 0, 0, 0, 1, 2, 4, 8, 16, 32, 64, 128, 256,
+512, 1024, 2048, 3072, 4096, 5120, 6144, 7168, 8192, 9216, 10240, 11264, 12288, 13312, 14336, 15360,
+16384, 17408, 18432, 19456, 20480, 21504, 22528, 23552, 24576, 25600, 26624, 27648, 28672, 29696, 30720, 31744,
+31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744,
+31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744,
+31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744,
+31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744,
+31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744,
+31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744,
+31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744, 31744,
+32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768,
+32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768,
+32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768,
+32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768,
+32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768,
+32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768,
+32768, 32768, 32768, 32768, 32768, 32768, 32768, 32769, 32770, 32772, 32776, 32784, 32800, 32832, 32896, 33024,
+33280, 33792, 34816, 35840, 36864, 37888, 38912, 39936, 40960, 41984, 43008, 44032, 45056, 46080, 47104, 48128,
+49152, 50176, 51200, 52224, 53248, 54272, 55296, 56320, 57344, 58368, 59392, 60416, 61440, 62464, 63488, 64512,
+64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512,
+64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512,
+64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512,
+64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512,
+64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512,
+64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512,
+64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512, 64512
+};
+
+unsigned char shiftTable[512] = {
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15,
+14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 13,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15,
+14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 13
+};
+
+unsigned short convertFloatToHalfFloat(float f)
+{
+ unsigned temp = *(reinterpret_cast<unsigned *>(&f));
+ unsigned signexp = (temp >> 23) & 0x1ff;
+ return baseTable[signexp] + ((temp & 0x007fffff) >> shiftTable[signexp]);
+}
+
</ins><span class="cx"> /* BEGIN CODE SHARED WITH MOZILLA FIREFOX */
</span><span class="cx">
</span><span class="cx"> // The following packing and unpacking routines are expressed in terms of function templates and inline functions to achieve generality and speedup.
</span><span class="lines">@@ -1067,17 +1211,163 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGBA16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+ for (unsigned i = 0; i < pixelsPerRow; ++i) {
+ destination[0] = convertFloatToHalfFloat(source[0]);
+ destination[1] = convertFloatToHalfFloat(source[1]);
+ destination[2] = convertFloatToHalfFloat(source[2]);
+ destination[3] = convertFloatToHalfFloat(source[3]);
+ source += 4;
+ destination += 4;
+ }
+}
+
+template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGBA16F, GraphicsContext3D::AlphaDoPremultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+ for (unsigned i = 0; i < pixelsPerRow; ++i) {
+ float scaleFactor = source[3];
+ destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
+ destination[1] = convertFloatToHalfFloat(source[1] * scaleFactor);
+ destination[2] = convertFloatToHalfFloat(source[2] * scaleFactor);
+ destination[3] = convertFloatToHalfFloat(source[3]);
+ source += 4;
+ destination += 4;
+ }
+}
+
+template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGBA16F, GraphicsContext3D::AlphaDoUnmultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+ for (unsigned i = 0; i < pixelsPerRow; ++i) {
+ float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
+ destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
+ destination[1] = convertFloatToHalfFloat(source[1] * scaleFactor);
+ destination[2] = convertFloatToHalfFloat(source[2] * scaleFactor);
+ destination[3] = convertFloatToHalfFloat(source[3]);
+ source += 4;
+ destination += 4;
+ }
+}
+
+template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGB16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+ for (unsigned i = 0; i < pixelsPerRow; ++i) {
+ destination[0] = convertFloatToHalfFloat(source[0]);
+ destination[1] = convertFloatToHalfFloat(source[1]);
+ destination[2] = convertFloatToHalfFloat(source[2]);
+ source += 4;
+ destination += 3;
+ }
+}
+
+template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGB16F, GraphicsContext3D::AlphaDoPremultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+ for (unsigned i = 0; i < pixelsPerRow; ++i) {
+ float scaleFactor = source[3];
+ destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
+ destination[1] = convertFloatToHalfFloat(source[1] * scaleFactor);
+ destination[2] = convertFloatToHalfFloat(source[2] * scaleFactor);
+ source += 4;
+ destination += 3;
+ }
+}
+
+template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGB16F, GraphicsContext3D::AlphaDoUnmultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+ for (unsigned i = 0; i < pixelsPerRow; ++i) {
+ float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
+ destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
+ destination[1] = convertFloatToHalfFloat(source[1] * scaleFactor);
+ destination[2] = convertFloatToHalfFloat(source[2] * scaleFactor);
+ source += 4;
+ destination += 3;
+ }
+}
+
+template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRA16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+ for (unsigned i = 0; i < pixelsPerRow; ++i) {
+ destination[0] = convertFloatToHalfFloat(source[0]);
+ destination[1] = convertFloatToHalfFloat(source[3]);
+ source += 4;
+ destination += 2;
+ }
+}
+
+template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRA16F, GraphicsContext3D::AlphaDoPremultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+ for (unsigned i = 0; i < pixelsPerRow; ++i) {
+ float scaleFactor = source[3];
+ destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
+ destination[1] = convertFloatToHalfFloat(source[3]);
+ source += 4;
+ destination += 2;
+ }
+}
+
+template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRA16F, GraphicsContext3D::AlphaDoUnmultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+ for (unsigned i = 0; i < pixelsPerRow; ++i) {
+ float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
+ destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
+ destination[1] = convertFloatToHalfFloat(source[3]);
+ source += 4;
+ destination += 2;
+ }
+}
+
+template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatR16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+ for (unsigned i = 0; i < pixelsPerRow; ++i) {
+ destination[0] = convertFloatToHalfFloat(source[0]);
+ source += 4;
+ destination += 1;
+ }
+}
+
+template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatR16F, GraphicsContext3D::AlphaDoPremultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+ for (unsigned i = 0; i < pixelsPerRow; ++i) {
+ float scaleFactor = source[3];
+ destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
+ source += 4;
+ destination += 1;
+ }
+}
+
+template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatR16F, GraphicsContext3D::AlphaDoUnmultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+ for (unsigned i = 0; i < pixelsPerRow; ++i) {
+ float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
+ destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
+ source += 4;
+ destination += 1;
+ }
+}
+
+template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatA16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+ for (unsigned i = 0; i < pixelsPerRow; ++i) {
+ destination[0] = convertFloatToHalfFloat(source[3]);
+ source += 4;
+ destination += 1;
+ }
+}
+
</ins><span class="cx"> ALWAYS_INLINE bool HasAlpha(int format)
</span><span class="cx"> {
</span><span class="cx"> return format == GraphicsContext3D::DataFormatA8
</span><ins>+ || format == GraphicsContext3D::DataFormatA16F
</ins><span class="cx"> || format == GraphicsContext3D::DataFormatA32F
</span><span class="cx"> || format == GraphicsContext3D::DataFormatRA8
</span><span class="cx"> || format == GraphicsContext3D::DataFormatAR8
</span><ins>+ || format == GraphicsContext3D::DataFormatRA16F
</ins><span class="cx"> || format == GraphicsContext3D::DataFormatRA32F
</span><span class="cx"> || format == GraphicsContext3D::DataFormatRGBA8
</span><span class="cx"> || format == GraphicsContext3D::DataFormatBGRA8
</span><span class="cx"> || format == GraphicsContext3D::DataFormatARGB8
</span><span class="cx"> || format == GraphicsContext3D::DataFormatABGR8
</span><ins>+ || format == GraphicsContext3D::DataFormatRGBA16F
</ins><span class="cx"> || format == GraphicsContext3D::DataFormatRGBA32F
</span><span class="cx"> || format == GraphicsContext3D::DataFormatRGBA4444
</span><span class="cx"> || format == GraphicsContext3D::DataFormatRGBA5551;
</span><span class="lines">@@ -1086,8 +1376,10 @@
</span><span class="cx"> ALWAYS_INLINE bool HasColor(int format)
</span><span class="cx"> {
</span><span class="cx"> return format == GraphicsContext3D::DataFormatRGBA8
</span><ins>+ || format == GraphicsContext3D::DataFormatRGBA16F
</ins><span class="cx"> || format == GraphicsContext3D::DataFormatRGBA32F
</span><span class="cx"> || format == GraphicsContext3D::DataFormatRGB8
</span><ins>+ || format == GraphicsContext3D::DataFormatRGB16F
</ins><span class="cx"> || format == GraphicsContext3D::DataFormatRGB32F
</span><span class="cx"> || format == GraphicsContext3D::DataFormatBGR8
</span><span class="cx"> || format == GraphicsContext3D::DataFormatBGRA8
</span><span class="lines">@@ -1097,8 +1389,10 @@
</span><span class="cx"> || format == GraphicsContext3D::DataFormatRGBA4444
</span><span class="cx"> || format == GraphicsContext3D::DataFormatRGB565
</span><span class="cx"> || format == GraphicsContext3D::DataFormatR8
</span><ins>+ || format == GraphicsContext3D::DataFormatR16F
</ins><span class="cx"> || format == GraphicsContext3D::DataFormatR32F
</span><span class="cx"> || format == GraphicsContext3D::DataFormatRA8
</span><ins>+ || format == GraphicsContext3D::DataFormatRA16F
</ins><span class="cx"> || format == GraphicsContext3D::DataFormatRA32F
</span><span class="cx"> || format == GraphicsContext3D::DataFormatAR8;
</span><span class="cx"> }
</span><span class="lines">@@ -1114,6 +1408,16 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> template<int Format>
</span><ins>+struct IsHalfFloatFormat {
+ static const bool Value =
+ Format == GraphicsContext3D::DataFormatRGBA16F
+ || Format == GraphicsContext3D::DataFormatRGB16F
+ || Format == GraphicsContext3D::DataFormatRA16F
+ || Format == GraphicsContext3D::DataFormatR16F
+ || Format == GraphicsContext3D::DataFormatA16F;
+};
+
+template<int Format>
</ins><span class="cx"> struct Is16bppFormat {
</span><span class="cx"> static const bool Value =
</span><span class="cx"> Format == GraphicsContext3D::DataFormatRGBA5551
</span><span class="lines">@@ -1121,24 +1425,29 @@
</span><span class="cx"> || Format == GraphicsContext3D::DataFormatRGB565;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template<int Format, bool IsFloat = IsFloatFormat<Format>::Value, bool Is16bpp = Is16bppFormat<Format>::Value>
</del><ins>+template<int Format, bool IsFloat = IsFloatFormat<Format>::Value, bool IsHalfFloat = IsHalfFloatFormat<Format>::Value, bool Is16bpp = Is16bppFormat<Format>::Value>
</ins><span class="cx"> struct DataTypeForFormat {
</span><span class="cx"> typedef uint8_t Type;
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> template<int Format>
</span><del>-struct DataTypeForFormat<Format, true, false> {
</del><ins>+struct DataTypeForFormat<Format, true, false, false> {
</ins><span class="cx"> typedef float Type;
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> template<int Format>
</span><del>-struct DataTypeForFormat<Format, false, true> {
</del><ins>+struct DataTypeForFormat<Format, false, true, false> {
</ins><span class="cx"> typedef uint16_t Type;
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> template<int Format>
</span><ins>+struct DataTypeForFormat<Format, false, false, true> {
+ typedef uint16_t Type;
+};
+
+template<int Format>
</ins><span class="cx"> struct IntermediateFormat {
</span><del>- static const int Value = IsFloatFormat<Format>::Value ? GraphicsContext3D::DataFormatRGBA32F : GraphicsContext3D::DataFormatRGBA8;
</del><ins>+ static const int Value = (IsFloatFormat<Format>::Value || IsHalfFloatFormat<Format>::Value) ? GraphicsContext3D::DataFormatRGBA32F : GraphicsContext3D::DataFormatRGBA8;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> ALWAYS_INLINE unsigned TexelBytesForFormat(GraphicsContext3D::DataFormat format)
</span><span class="lines">@@ -1152,6 +1461,8 @@
</span><span class="cx"> case GraphicsContext3D::DataFormatRGBA5551:
</span><span class="cx"> case GraphicsContext3D::DataFormatRGBA4444:
</span><span class="cx"> case GraphicsContext3D::DataFormatRGB565:
</span><ins>+ case GraphicsContext3D::DataFormatA16F:
+ case GraphicsContext3D::DataFormatR16F:
</ins><span class="cx"> return 2;
</span><span class="cx"> case GraphicsContext3D::DataFormatRGB8:
</span><span class="cx"> case GraphicsContext3D::DataFormatBGR8:
</span><span class="lines">@@ -1162,8 +1473,12 @@
</span><span class="cx"> case GraphicsContext3D::DataFormatBGRA8:
</span><span class="cx"> case GraphicsContext3D::DataFormatR32F:
</span><span class="cx"> case GraphicsContext3D::DataFormatA32F:
</span><ins>+ case GraphicsContext3D::DataFormatRA16F:
</ins><span class="cx"> return 4;
</span><ins>+ case GraphicsContext3D::DataFormatRGB16F:
+ return 6;
</ins><span class="cx"> case GraphicsContext3D::DataFormatRA32F:
</span><ins>+ case GraphicsContext3D::DataFormatRGBA16F:
</ins><span class="cx"> return 8;
</span><span class="cx"> case GraphicsContext3D::DataFormatRGB32F:
</span><span class="cx"> return 12;
</span><span class="lines">@@ -1250,17 +1565,22 @@
</span><span class="cx">
</span><span class="cx"> switch (dstFormat) {
</span><span class="cx"> FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatR8)
</span><ins>+ FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatR16F)
+ FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatR32F)
</ins><span class="cx"> FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatA8)
</span><del>- FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatR32F)
</del><ins>+ FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatA16F)
</ins><span class="cx"> FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatA32F)
</span><span class="cx"> FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRA8)
</span><ins>+ FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRA16F)
</ins><span class="cx"> FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRA32F)
</span><span class="cx"> FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGB8)
</span><span class="cx"> FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGB565)
</span><ins>+ FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGB16F)
</ins><span class="cx"> FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGB32F)
</span><span class="cx"> FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGBA8)
</span><span class="cx"> FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGBA5551)
</span><span class="cx"> FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGBA4444)
</span><ins>+ FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGBA16F)
</ins><span class="cx"> FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGBA32F)
</span><span class="cx"> default:
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="lines">@@ -1322,7 +1642,7 @@
</span><span class="cx"> typedef typename DataTypeForFormat<IntermediateSrcFormat>::Type IntermediateSrcType;
</span><span class="cx"> const ptrdiff_t srcStrideInElements = m_srcStride / sizeof(SrcType);
</span><span class="cx"> const ptrdiff_t dstStrideInElements = m_dstStride / sizeof(DstType);
</span><del>- const bool trivialUnpack = (SrcFormat == GraphicsContext3D::DataFormatRGBA8 && !IsFloatFormat<DstFormat>::Value) || SrcFormat == GraphicsContext3D::DataFormatRGBA32F;
</del><ins>+ const bool trivialUnpack = (SrcFormat == GraphicsContext3D::DataFormatRGBA8 && !IsFloatFormat<DstFormat>::Value && !IsHalfFloatFormat<DstFormat>::Value) || SrcFormat == GraphicsContext3D::DataFormatRGBA32F;
</ins><span class="cx"> const bool trivialPack = (DstFormat == GraphicsContext3D::DataFormatRGBA8 || DstFormat == GraphicsContext3D::DataFormatRGBA32F) && alphaOp == GraphicsContext3D::AlphaDoNothing && m_dstStride > 0;
</span><span class="cx"> ASSERT(!trivialUnpack || !trivialPack);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsContext3Dh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h (160118 => 160119)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h        2013-12-04 21:21:07 UTC (rev 160118)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h        2013-12-04 21:25:50 UTC (rev 160119)
</span><span class="lines">@@ -562,10 +562,12 @@
</span><span class="cx"> DataFormatRGBA8 = 0,
</span><span class="cx"> DataFormatRGBA16Little,
</span><span class="cx"> DataFormatRGBA16Big,
</span><ins>+ DataFormatRGBA16F,
</ins><span class="cx"> DataFormatRGBA32F,
</span><span class="cx"> DataFormatRGB8,
</span><span class="cx"> DataFormatRGB16Little,
</span><span class="cx"> DataFormatRGB16Big,
</span><ins>+ DataFormatRGB16F,
</ins><span class="cx"> DataFormatRGB32F,
</span><span class="cx"> DataFormatBGR8,
</span><span class="cx"> DataFormatBGRA8,
</span><span class="lines">@@ -581,10 +583,12 @@
</span><span class="cx"> DataFormatR8,
</span><span class="cx"> DataFormatR16Little,
</span><span class="cx"> DataFormatR16Big,
</span><ins>+ DataFormatR16F,
</ins><span class="cx"> DataFormatR32F,
</span><span class="cx"> DataFormatRA8,
</span><span class="cx"> DataFormatRA16Little,
</span><span class="cx"> DataFormatRA16Big,
</span><ins>+ DataFormatRA16F,
</ins><span class="cx"> DataFormatRA32F,
</span><span class="cx"> DataFormatAR8,
</span><span class="cx"> DataFormatAR16Little,
</span><span class="lines">@@ -592,6 +596,7 @@
</span><span class="cx"> DataFormatA8,
</span><span class="cx"> DataFormatA16Little,
</span><span class="cx"> DataFormatA16Big,
</span><ins>+ DataFormatA16F,
</ins><span class="cx"> DataFormatA32F,
</span><span class="cx"> DataFormatNumFormats
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsopenglGraphicsContext3DOpenGLCommoncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp (160118 => 160119)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp        2013-12-04 21:21:07 UTC (rev 160118)
+++ trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp        2013-12-04 21:25:50 UTC (rev 160119)
</span><span class="lines">@@ -1357,6 +1357,9 @@
</span><span class="cx"> {
</span><span class="cx"> makeContextCurrent();
</span><span class="cx">
</span><ins>+ if (type == HALF_FLOAT_OES)
+ type = GL_HALF_FLOAT_ARB;
+
</ins><span class="cx"> // FIXME: we will need to deal with PixelStore params when dealing with image buffers that differ from the subimage size.
</span><span class="cx"> ::glTexSubImage2D(target, level, xoff, yoff, width, height, format, type, pixels);
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>