<!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 -&gt; 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  &lt;dino@apple.com&gt;
+
+        [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  &lt;mihnea@adobe.com&gt;
</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 &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</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 &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-
-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>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;meta charset=&quot;utf-8&quot;&gt;
-&lt;title&gt;WebGL OES_texture_half_float not yet implemented Conformance Tests&lt;/title&gt;
-&lt;script src=&quot;resources/desktop-gl-constants.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;resources/webgl-test.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;resources/webgl-test-utils.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;canvas id=&quot;texcanvas&quot; width=&quot;1&quot; height=&quot;2&quot;&gt;&lt;/canvas&gt;
-&lt;script&gt;
-description(&quot;Testing not yet supported texture uploads&quot;);
-debug(&quot;&quot;);
-
-if (window.initNonKhronosFramework) {
-    window.initNonKhronosFramework(true);
-}
-
-if (window.internals)
-    window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
-
-var wtu = WebGLTestUtils;
-var canvas = document.getElementById(&quot;canvas&quot;);
-var gl = wtu.create3DContext(canvas);
-var successfullyParsed = false;
-
-if (!gl) {
-    testFailed(&quot;WebGL context does not exists&quot;);
-} else {
-    testPassed(&quot;WebGL context exists&quot;);
-
-    if(!gl.getExtension(&quot;OES_texture_half_float&quot;)) {
-        testPassed(&quot;No OES_texture_half_float support. This is legal&quot;);
-    } else {
-        testPassed(&quot;Successfully enabled OES_texture_half_float extension&quot;);
-        
-        var canvas2d = document.getElementById(&quot;texcanvas&quot;);
-        var context2d = canvas2d.getContext(&quot;2d&quot;);
-
-        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, &quot;texture parameter setup should succeed&quot;);
-    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, &quot;Uploading to half float texture is not yet supported&quot;);
-
-    // 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, &quot;Uploading null ArrayBufferView to half float texture should succeed&quot;);
-    gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.HALF_FLOAT_OES, image);
-    glErrorShouldBe(gl, gl.INVALID_OPERATION, &quot;Uploading to half float texture using texSubImage2D is not supported yet&quot;);
-}
-
-function runImageDataUnsupportedTest(canvas2d, context2d)
-{
-    debug(&quot;&quot;);
-    debug(&quot;Verify whether uploading ImageData via texImage2D/texSubImage2D is supported&quot;);
-    
-    // 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(&quot;&quot;);
-    debug(&quot;Verify whether uploading HTMLImageElement via texImage2D/texSubImage2D is supported&quot;);
-
-    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(&quot;img&quot;);
-    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 = &quot;#ff0000&quot;;
-    ctx.fillRect(0, 0, width, halfHeight);
-    ctx.fillStyle = &quot;#00ff00&quot;;
-    ctx.fillRect(0, halfHeight, width, height - halfHeight);
-}
-
-function runHTMLCanvasElementUnsupportedTest(canvas2d, context2d)
-{
-    debug(&quot;&quot;);
-    debug(&quot;Verify whether uploading HTMLCanvasElement via texImage2D/texSubImage2D is supported&quot;);
-    
-    context2d.width = 1;
-    context2d.height = 2;
-    setCanvasToRedGreen(context2d);
-
-    runTextureUploadTest(canvas2d);
-}
-
-function runHTMLVideoElementUnsupportedTest(canvas2d, context2d)
-{
-    debug(&quot;&quot;);
-    debug(&quot;Verify whether uploading HTMLVideoElement via texImage2D/texSubImage2D is supported&quot;);
-
-    var info = { src: &quot;resources/red-green.mp4&quot;, type: 'video/mp4; codecs=&quot;avc1.42E01E, mp4a.40.2&quot;'};
-    var video = document.createElement(&quot;video&quot;);
-    if (!video.canPlayType) {
-        testFailed(&quot;video.canPlayType required method is missing&quot;);
-        return;
-    }
-    document.body.appendChild(video);
-    video.addEventListener(
-        &quot;playing&quot;, 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(&quot;&quot;);
-
-&lt;/script&gt;
-&lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
-
</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 &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+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>+&lt;!--
+
+/*
+** 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
+** &quot;Materials&quot;), 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 &quot;AS IS&quot;, 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.
+*/
+
+--&gt;
+
+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;resources/desktop-gl-constants.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/webgl-test.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/webgl-test-utils.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/tex-image-and-sub-image-2d-with-canvas.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+&quot;use strict&quot;;
+function testPrologue(gl) {
+    var ext = null;
+
+    if (!(ext = gl.getExtension(&quot;OES_texture_half_float&quot;))) {
+        testPassed(&quot;No OES_texture_half_float support -- this is legal&quot;);
+        return false;
+    }
+
+    // Required by the test harness.
+    gl.HALF_FLOAT_OES = ext.HALF_FLOAT_OES;
+    testPassed(&quot;Successfully enabled OES_texture_half_float extension&quot;);
+    return true;
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload='generateTest(&quot;RGBA&quot;, &quot;HALF_FLOAT_OES&quot;, testPrologue)()'&gt;
+&lt;canvas id=&quot;example&quot; width=&quot;32&quot; height=&quot;32&quot;&gt;&lt;/canvas&gt;
+&lt;div id=&quot;description&quot;&gt;&lt;/div&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</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 &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+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>+&lt;!--
+
+/*
+** 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
+** &quot;Materials&quot;), 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 &quot;AS IS&quot;, 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.
+*/
+
+--&gt;
+
+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;resources/desktop-gl-constants.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/webgl-test.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/webgl-test-utils.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/tex-image-and-sub-image-2d-with-image.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+&quot;use strict&quot;;
+function testPrologue(gl) {
+    var ext = null;
+
+    if (!(ext = gl.getExtension(&quot;OES_texture_half_float&quot;))) {
+        testPassed(&quot;No OES_texture_half_float support -- this is legal&quot;);
+        return false;
+    }
+
+    // Required by the test harness.
+    gl.HALF_FLOAT_OES = ext.HALF_FLOAT_OES;
+
+    testPassed(&quot;Successfully enabled OES_texture_half_float extension&quot;);
+    return true;
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload='generateTest(&quot;RGBA&quot;, &quot;HALF_FLOAT_OES&quot;, &quot;.&quot;, testPrologue)()'&gt;
+&lt;canvas id=&quot;example&quot; width=&quot;32&quot; height=&quot;32&quot;&gt;&lt;/canvas&gt;
+&lt;div id=&quot;description&quot;&gt;&lt;/div&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</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 &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+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>+&lt;!--
+
+/*
+** 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
+** &quot;Materials&quot;), 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 &quot;AS IS&quot;, 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.
+*/
+
+--&gt;
+
+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;resources/desktop-gl-constants.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/webgl-test.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/webgl-test-utils.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/tex-image-and-sub-image-2d-with-video.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+&quot;use strict&quot;;
+function testPrologue(gl) {
+    var ext = null;
+
+    if (!(ext = gl.getExtension(&quot;OES_texture_half_float&quot;))) {
+        testPassed(&quot;No OES_texture_half_float support -- this is legal&quot;);
+        return false;
+    }
+
+    // Required by the test harness.
+    gl.HALF_FLOAT_OES = ext.HALF_FLOAT_OES;
+
+    testPassed(&quot;Successfully enabled OES_texture_half_float extension&quot;);
+    return true;
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload='generateTest(&quot;RGBA&quot;, &quot;HALF_FLOAT_OES&quot;, testPrologue)()'&gt;
+&lt;canvas id=&quot;example&quot; width=&quot;32&quot; height=&quot;32&quot;&gt;&lt;/canvas&gt;
+&lt;div id=&quot;description&quot;&gt;&lt;/div&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+&lt;video width=&quot;640&quot; height=&quot;228&quot; id=&quot;vid&quot; controls&gt;
+  &lt;source src=&quot;resources/red-green.mp4&quot;  type='video/mp4; codecs=&quot;avc1.42E01E, mp4a.40.2&quot;' /&gt;
+  &lt;source src=&quot;resources/red-green.webmvp8.webm&quot; type='video/webm; codecs=&quot;vp8, vorbis&quot;' /&gt;
+  &lt;source src=&quot;resources/red-green.theora.ogv&quot;  type='video/ogg; codecs=&quot;theora, vorbis&quot;' /&gt;
+&lt;/video&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</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>+&lt;!--
+
+/*
+** 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
+** &quot;Materials&quot;), 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 &quot;AS IS&quot;, 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.
+*/
+
+--&gt;
+
</ins><span class="cx"> &lt;!DOCTYPE html&gt;
</span><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><span class="lines">@@ -30,7 +57,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> &lt;/script&gt;
</span><del>-&lt;!-- Shaders for testing half floating-point render targets --&gt;
</del><ins>+&lt;!-- Shaders for testing half-floating-point render targets --&gt;
</ins><span class="cx"> &lt;script id=&quot;positionVertexShader&quot; type=&quot;x-shader/x-vertex&quot;&gt;
</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"> &lt;/script&gt;
</span><span class="cx"> &lt;script&gt;
</span><ins>+&quot;use strict&quot;
</ins><span class="cx"> description(&quot;This test verifies the functionality of OES_texture_half_float with null/non-null ArrayBufferView&quot;);
</span><ins>+
</ins><span class="cx"> debug(&quot;&quot;);
</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(&quot;canvas&quot;);
</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(&quot;WebGL context does not exists&quot;);
</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(&quot;OES_texture_half_float&quot;)) {
</del><ins>+    if (!(ext = gl.getExtension(&quot;OES_texture_half_float&quot;))) {
</ins><span class="cx">         testPassed(&quot;No OES_texture_half_float support. This is legal&quot;);
</span><span class="cx">     } else {
</span><span class="cx">         testPassed(&quot;Successfully enabled OES_texture_half_float extension&quot;);
</span><span class="lines">@@ -73,12 +101,12 @@
</span><span class="cx">         for (var i = 0; i &lt; 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 &lt; 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 &lt; float32Data.length; ii++) {
</span><span class="lines">@@ -98,7 +126,7 @@
</span><span class="cx">             for (var ii = 0; ii &lt;  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(&quot;Testing texture creation with extension &quot; + (extensionEnabled ? &quot;enabled&quot; : &quot;disabled&quot;) +
</span><span class="cx">           &quot;, format &quot; + getFormatName(format) + &quot;, and data &quot; + (data ? &quot;non-null&quot; : &quot;null&quot;) +
</span><del>-          &quot;. Expect &quot; + (expectSuccess ? &quot;Success&quot; : &quot;Failure&quot;));   
</del><ins>+          &quot;. Expect &quot; + (expectSuccess ? &quot;Success&quot; : &quot;Failure&quot;));
</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, &quot;Half floating point texture must be diallowed if OES_texture_half_float isn't enabled&quot;);
</del><ins>+        glErrorShouldBe(gl, gl.INVALID_ENUM, &quot;Half floating point texture must be disallowed if OES_texture_half_float isn't enabled&quot;);
</ins><span class="cx">         return;
</span><span class="cx">     } else if (data) {
</span><del>-        glErrorShouldBe(gl, gl.INVALID_OPERATION, &quot;Half floating point texture allocation must be diallowed when ArrayBufferView is not-null&quot;);
</del><ins>+        glErrorShouldBe(gl, gl.INVALID_OPERATION, &quot;Half floating point texture allocation must be disallowed when ArrayBufferView is not-null&quot;);
</ins><span class="cx">         return;
</span><span class="cx">     } else {
</span><span class="cx">         glErrorShouldBe(gl, gl.NO_ERROR, &quot;Half floating point texture allocation should succeed if OES_texture_half_float is enabled&quot;);
</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, &quot;Half floating point texture allocation should succeed if OES_texture_half_float is enabled&quot;);
</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  &lt;dino@apple.com&gt;
+
+        [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 -&gt; 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  &lt;dabates@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix the Apple Windows build after &lt;http://trac.webkit.org/changeset/160113&gt;
</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 &amp;&amp; type == GraphicsContext3D::HALF_FLOAT_OES) {
-        synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, functionName, &quot;Operation not supported yet&quot;);
-        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,
+// &quot;Fast Half Float Conversions&quot; 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 &lt; 256; ++i){
+        e = i - 127;
+        if (e &lt; -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 &lt; -14) { // Small numbers map to denorms
+            basetable[i | 0x000] = (0x0400&gt;&gt;(-e-14));
+            basetable[i | 0x100] = (0x0400&gt;&gt;(-e-14)) | 0x8000;
+            shifttable[i | 0x000] = -e-1;
+            shifttable[i | 0x100] = -e-1;
+        }
+        else if (e &lt;= 15){ // Normal numbers just lose precision
+            basetable[i | 0x000] = ((e+15)&lt;&lt;10);
+            basetable[i| 0x100] = ((e+15)&lt;&lt;10) | 0x8000;
+            shifttable[i|0x000] = 13;
+            shifttable[i|0x100] = 13;
+        }
+        else if (e&lt;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&lt;unsigned *&gt;(&amp;f));
+    unsigned signexp = (temp &gt;&gt; 23) &amp; 0x1ff;
+    return baseTable[signexp] + ((temp &amp; 0x007fffff) &gt;&gt; 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&lt;&gt; ALWAYS_INLINE void pack&lt;GraphicsContext3D::DataFormatRGBA16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t&gt;(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i &lt; 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&lt;&gt; ALWAYS_INLINE void pack&lt;GraphicsContext3D::DataFormatRGBA16F, GraphicsContext3D::AlphaDoPremultiply, float, uint16_t&gt;(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i &lt; 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&lt;&gt; ALWAYS_INLINE void pack&lt;GraphicsContext3D::DataFormatRGBA16F, GraphicsContext3D::AlphaDoUnmultiply, float, uint16_t&gt;(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i &lt; 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&lt;&gt; ALWAYS_INLINE void pack&lt;GraphicsContext3D::DataFormatRGB16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t&gt;(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i &lt; pixelsPerRow; ++i) {
+        destination[0] = convertFloatToHalfFloat(source[0]);
+        destination[1] = convertFloatToHalfFloat(source[1]);
+        destination[2] = convertFloatToHalfFloat(source[2]);
+        source += 4;
+        destination += 3;
+    }
+}
+
+template&lt;&gt; ALWAYS_INLINE void pack&lt;GraphicsContext3D::DataFormatRGB16F, GraphicsContext3D::AlphaDoPremultiply, float, uint16_t&gt;(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i &lt; 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&lt;&gt; ALWAYS_INLINE void pack&lt;GraphicsContext3D::DataFormatRGB16F, GraphicsContext3D::AlphaDoUnmultiply, float, uint16_t&gt;(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i &lt; 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&lt;&gt; ALWAYS_INLINE void pack&lt;GraphicsContext3D::DataFormatRA16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t&gt;(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i &lt; pixelsPerRow; ++i) {
+        destination[0] = convertFloatToHalfFloat(source[0]);
+        destination[1] = convertFloatToHalfFloat(source[3]);
+        source += 4;
+        destination += 2;
+    }
+}
+
+template&lt;&gt; ALWAYS_INLINE void pack&lt;GraphicsContext3D::DataFormatRA16F, GraphicsContext3D::AlphaDoPremultiply, float, uint16_t&gt;(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i &lt; pixelsPerRow; ++i) {
+        float scaleFactor = source[3];
+        destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
+        destination[1] = convertFloatToHalfFloat(source[3]);
+        source += 4;
+        destination += 2;
+    }
+}
+
+template&lt;&gt; ALWAYS_INLINE void pack&lt;GraphicsContext3D::DataFormatRA16F, GraphicsContext3D::AlphaDoUnmultiply, float, uint16_t&gt;(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i &lt; 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&lt;&gt; ALWAYS_INLINE void pack&lt;GraphicsContext3D::DataFormatR16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t&gt;(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i &lt; pixelsPerRow; ++i) {
+        destination[0] = convertFloatToHalfFloat(source[0]);
+        source += 4;
+        destination += 1;
+    }
+}
+
+template&lt;&gt; ALWAYS_INLINE void pack&lt;GraphicsContext3D::DataFormatR16F, GraphicsContext3D::AlphaDoPremultiply, float, uint16_t&gt;(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i &lt; pixelsPerRow; ++i) {
+        float scaleFactor = source[3];
+        destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
+        source += 4;
+        destination += 1;
+    }
+}
+
+template&lt;&gt; ALWAYS_INLINE void pack&lt;GraphicsContext3D::DataFormatR16F, GraphicsContext3D::AlphaDoUnmultiply, float, uint16_t&gt;(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i &lt; pixelsPerRow; ++i) {
+        float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
+        destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
+        source += 4;
+        destination += 1;
+    }
+}
+
+template&lt;&gt; ALWAYS_INLINE void pack&lt;GraphicsContext3D::DataFormatA16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t&gt;(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i &lt; 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&lt;int Format&gt;
</span><ins>+struct IsHalfFloatFormat {
+    static const bool Value =
+        Format == GraphicsContext3D::DataFormatRGBA16F
+        || Format == GraphicsContext3D::DataFormatRGB16F
+        || Format == GraphicsContext3D::DataFormatRA16F
+        || Format == GraphicsContext3D::DataFormatR16F
+        || Format == GraphicsContext3D::DataFormatA16F;
+};
+
+template&lt;int Format&gt;
</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&lt;int Format, bool IsFloat = IsFloatFormat&lt;Format&gt;::Value, bool Is16bpp = Is16bppFormat&lt;Format&gt;::Value&gt;
</del><ins>+template&lt;int Format, bool IsFloat = IsFloatFormat&lt;Format&gt;::Value, bool IsHalfFloat = IsHalfFloatFormat&lt;Format&gt;::Value, bool Is16bpp = Is16bppFormat&lt;Format&gt;::Value&gt;
</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&lt;int Format&gt;
</span><del>-struct DataTypeForFormat&lt;Format, true, false&gt; {
</del><ins>+struct DataTypeForFormat&lt;Format, true, false, false&gt; {
</ins><span class="cx">     typedef float Type;
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template&lt;int Format&gt;
</span><del>-struct DataTypeForFormat&lt;Format, false, true&gt; {
</del><ins>+struct DataTypeForFormat&lt;Format, false, true, false&gt; {
</ins><span class="cx">     typedef uint16_t Type;
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template&lt;int Format&gt;
</span><ins>+struct DataTypeForFormat&lt;Format, false, false, true&gt; {
+    typedef uint16_t Type;
+};
+
+template&lt;int Format&gt;
</ins><span class="cx"> struct IntermediateFormat {
</span><del>-    static const int Value = IsFloatFormat&lt;Format&gt;::Value ? GraphicsContext3D::DataFormatRGBA32F : GraphicsContext3D::DataFormatRGBA8;
</del><ins>+    static const int Value = (IsFloatFormat&lt;Format&gt;::Value || IsHalfFloatFormat&lt;Format&gt;::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&lt;IntermediateSrcFormat&gt;::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 &amp;&amp; !IsFloatFormat&lt;DstFormat&gt;::Value) || SrcFormat == GraphicsContext3D::DataFormatRGBA32F;
</del><ins>+    const bool trivialUnpack = (SrcFormat == GraphicsContext3D::DataFormatRGBA8 &amp;&amp; !IsFloatFormat&lt;DstFormat&gt;::Value &amp;&amp; !IsHalfFloatFormat&lt;DstFormat&gt;::Value) || SrcFormat == GraphicsContext3D::DataFormatRGBA32F;
</ins><span class="cx">     const bool trivialPack = (DstFormat == GraphicsContext3D::DataFormatRGBA8 || DstFormat == GraphicsContext3D::DataFormatRGBA32F) &amp;&amp; alphaOp == GraphicsContext3D::AlphaDoNothing &amp;&amp; m_dstStride &gt; 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>