| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/webgl/WebGL2RenderingContextBase.h" | 5 #include "modules/webgl/WebGL2RenderingContextBase.h" |
| 6 | 6 |
| 7 #include "bindings/modules/v8/WebGLAny.h" | 7 #include "bindings/modules/v8/WebGLAny.h" |
| 8 #include "core/dom/DOMException.h" | 8 #include "core/dom/DOMException.h" |
| 9 #include "core/frame/ImageBitmap.h" | 9 #include "core/frame/ImageBitmap.h" |
| 10 #include "core/html/HTMLCanvasElement.h" | 10 #include "core/html/HTMLCanvasElement.h" |
| (...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1356 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1356 void WebGL2RenderingContextBase::texImage2D(GLenum target, |
| 1357 GLint level, | 1357 GLint level, |
| 1358 GLint internalformat, | 1358 GLint internalformat, |
| 1359 GLsizei width, | 1359 GLsizei width, |
| 1360 GLsizei height, | 1360 GLsizei height, |
| 1361 GLint border, | 1361 GLint border, |
| 1362 GLenum format, | 1362 GLenum format, |
| 1363 GLenum type, | 1363 GLenum type, |
| 1364 HTMLVideoElement* video, | 1364 HTMLVideoElement* video, |
| 1365 ExceptionState& exceptionState) { | 1365 ExceptionState& exceptionState) { |
| 1366 // TODO(zmo): To be implemented. | 1366 texImageHelperHTMLVideoElement( |
| 1367 TexImage2D, target, level, internalformat, format, type, 0, 0, 0, video, |
| 1368 getTextureSourceSubRectangle(width, height), 1, 0, exceptionState); |
| 1367 } | 1369 } |
| 1368 | 1370 |
| 1369 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1371 void WebGL2RenderingContextBase::texImage2D(GLenum target, |
| 1370 GLint level, | 1372 GLint level, |
| 1371 GLint internalformat, | 1373 GLint internalformat, |
| 1372 GLsizei width, | 1374 GLsizei width, |
| 1373 GLsizei height, | 1375 GLsizei height, |
| 1374 GLint border, | 1376 GLint border, |
| 1375 GLenum format, | 1377 GLenum format, |
| 1376 GLenum type, | 1378 GLenum type, |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1479 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, | 1481 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, |
| 1480 GLint level, | 1482 GLint level, |
| 1481 GLint xoffset, | 1483 GLint xoffset, |
| 1482 GLint yoffset, | 1484 GLint yoffset, |
| 1483 GLsizei width, | 1485 GLsizei width, |
| 1484 GLsizei height, | 1486 GLsizei height, |
| 1485 GLenum format, | 1487 GLenum format, |
| 1486 GLenum type, | 1488 GLenum type, |
| 1487 HTMLImageElement* image, | 1489 HTMLImageElement* image, |
| 1488 ExceptionState& exceptionState) { | 1490 ExceptionState& exceptionState) { |
| 1489 texImageHelperHTMLImageElement(TexSubImage2D, target, level, 0, format, type, | 1491 texImageHelperHTMLImageElement( |
| 1490 xoffset, yoffset, 0, image, | 1492 TexSubImage2D, target, level, 0, format, type, xoffset, yoffset, 0, image, |
| 1491 getTextureSourceSubRectangle(width, height), 1, | 1493 getTextureSourceSubRectangle(width, height), 1, 0, exceptionState); |
| 1492 m_unpackImageHeight, exceptionState); | |
| 1493 } | 1494 } |
| 1494 | 1495 |
| 1495 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, | 1496 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, |
| 1496 GLint level, | 1497 GLint level, |
| 1497 GLint xoffset, | 1498 GLint xoffset, |
| 1498 GLint yoffset, | 1499 GLint yoffset, |
| 1499 GLsizei width, | 1500 GLsizei width, |
| 1500 GLsizei height, | 1501 GLsizei height, |
| 1501 GLenum format, | 1502 GLenum format, |
| 1502 GLenum type, | 1503 GLenum type, |
| 1503 HTMLCanvasElement* canvas, | 1504 HTMLCanvasElement* canvas, |
| 1504 ExceptionState& exceptionState) { | 1505 ExceptionState& exceptionState) { |
| 1505 texImageHelperHTMLCanvasElement(TexSubImage2D, target, level, 0, format, type, | 1506 texImageHelperHTMLCanvasElement(TexSubImage2D, target, level, 0, format, type, |
| 1506 xoffset, yoffset, 0, canvas, | 1507 xoffset, yoffset, 0, canvas, |
| 1507 getTextureSourceSubRectangle(width, height), | 1508 getTextureSourceSubRectangle(width, height), |
| 1508 1, 0, exceptionState); | 1509 1, 0, exceptionState); |
| 1509 } | 1510 } |
| 1510 | 1511 |
| 1511 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, | 1512 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, |
| 1512 GLint level, | 1513 GLint level, |
| 1513 GLint xoffset, | 1514 GLint xoffset, |
| 1514 GLint yoffset, | 1515 GLint yoffset, |
| 1515 GLsizei width, | 1516 GLsizei width, |
| 1516 GLsizei height, | 1517 GLsizei height, |
| 1517 GLenum format, | 1518 GLenum format, |
| 1518 GLenum type, | 1519 GLenum type, |
| 1519 HTMLVideoElement* video, | 1520 HTMLVideoElement* video, |
| 1520 ExceptionState& exceptionState) { | 1521 ExceptionState& exceptionState) { |
| 1521 // TODO(zmo): To be implemented. | 1522 texImageHelperHTMLVideoElement( |
| 1523 TexSubImage2D, target, level, 0, format, type, xoffset, yoffset, 0, video, |
| 1524 getTextureSourceSubRectangle(width, height), 1, 0, exceptionState); |
| 1522 } | 1525 } |
| 1523 | 1526 |
| 1524 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, | 1527 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, |
| 1525 GLint level, | 1528 GLint level, |
| 1526 GLint xoffset, | 1529 GLint xoffset, |
| 1527 GLint yoffset, | 1530 GLint yoffset, |
| 1528 GLsizei width, | 1531 GLsizei width, |
| 1529 GLsizei height, | 1532 GLsizei height, |
| 1530 GLenum format, | 1533 GLenum format, |
| 1531 GLenum type, | 1534 GLenum type, |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1741 GLint level, | 1744 GLint level, |
| 1742 GLint internalformat, | 1745 GLint internalformat, |
| 1743 GLsizei width, | 1746 GLsizei width, |
| 1744 GLsizei height, | 1747 GLsizei height, |
| 1745 GLsizei depth, | 1748 GLsizei depth, |
| 1746 GLint border, | 1749 GLint border, |
| 1747 GLenum format, | 1750 GLenum format, |
| 1748 GLenum type, | 1751 GLenum type, |
| 1749 HTMLVideoElement* video, | 1752 HTMLVideoElement* video, |
| 1750 ExceptionState& exceptionState) { | 1753 ExceptionState& exceptionState) { |
| 1751 // TODO(zmo): To be implemented. | 1754 texImageHelperHTMLVideoElement(TexImage3D, target, level, internalformat, |
| 1755 format, type, 0, 0, 0, video, |
| 1756 getTextureSourceSubRectangle(width, height), |
| 1757 depth, m_unpackImageHeight, exceptionState); |
| 1752 } | 1758 } |
| 1753 | 1759 |
| 1754 void WebGL2RenderingContextBase::texImage3D(GLenum target, | 1760 void WebGL2RenderingContextBase::texImage3D(GLenum target, |
| 1755 GLint level, | 1761 GLint level, |
| 1756 GLint internalformat, | 1762 GLint internalformat, |
| 1757 GLsizei width, | 1763 GLsizei width, |
| 1758 GLsizei height, | 1764 GLsizei height, |
| 1759 GLsizei depth, | 1765 GLsizei depth, |
| 1760 GLint border, | 1766 GLint border, |
| 1761 GLenum format, | 1767 GLenum format, |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1875 GLint xoffset, | 1881 GLint xoffset, |
| 1876 GLint yoffset, | 1882 GLint yoffset, |
| 1877 GLint zoffset, | 1883 GLint zoffset, |
| 1878 GLsizei width, | 1884 GLsizei width, |
| 1879 GLsizei height, | 1885 GLsizei height, |
| 1880 GLsizei depth, | 1886 GLsizei depth, |
| 1881 GLenum format, | 1887 GLenum format, |
| 1882 GLenum type, | 1888 GLenum type, |
| 1883 HTMLVideoElement* video, | 1889 HTMLVideoElement* video, |
| 1884 ExceptionState& exceptionState) { | 1890 ExceptionState& exceptionState) { |
| 1885 // TODO(zmo): To be implemented. | 1891 texImageHelperHTMLVideoElement(TexSubImage3D, target, level, 0, format, type, |
| 1892 xoffset, yoffset, zoffset, video, |
| 1893 getTextureSourceSubRectangle(width, height), |
| 1894 depth, m_unpackImageHeight, exceptionState); |
| 1886 } | 1895 } |
| 1887 | 1896 |
| 1888 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, | 1897 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, |
| 1889 GLint level, | 1898 GLint level, |
| 1890 GLint xoffset, | 1899 GLint xoffset, |
| 1891 GLint yoffset, | 1900 GLint yoffset, |
| 1892 GLint zoffset, | 1901 GLint zoffset, |
| 1893 GLsizei width, | 1902 GLsizei width, |
| 1894 GLsizei height, | 1903 GLsizei height, |
| 1895 GLsizei depth, | 1904 GLsizei depth, |
| 1896 GLenum format, | 1905 GLenum format, |
| 1897 GLenum type, | 1906 GLenum type, |
| 1898 ImageBitmap* bitmap, | 1907 ImageBitmap* bitmap, |
| 1899 ExceptionState& exceptionState) { | 1908 ExceptionState& exceptionState) { |
| 1900 // TODO(zmo): To be implemented. | 1909 // TODO(zmo): To be implemented. |
| 1901 } | 1910 } |
| 1902 | 1911 |
| 1903 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, | 1912 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, |
| 1904 GLint level, | 1913 GLint level, |
| 1905 GLint xoffset, | 1914 GLint xoffset, |
| 1906 GLint yoffset, | 1915 GLint yoffset, |
| 1907 GLint zoffset, | 1916 GLint zoffset, |
| 1908 GLenum format, | 1917 GLenum format, |
| 1909 GLenum type, | 1918 GLenum type, |
| 1910 HTMLVideoElement* video, | |
| 1911 ExceptionState& exceptionState) { | |
| 1912 texImageHelperHTMLVideoElement(TexSubImage3D, target, level, 0, format, type, | |
| 1913 xoffset, yoffset, zoffset, video, | |
| 1914 exceptionState); | |
| 1915 } | |
| 1916 | |
| 1917 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, | |
| 1918 GLint level, | |
| 1919 GLint xoffset, | |
| 1920 GLint yoffset, | |
| 1921 GLint zoffset, | |
| 1922 GLenum format, | |
| 1923 GLenum type, | |
| 1924 ImageBitmap* bitmap, | 1919 ImageBitmap* bitmap, |
| 1925 ExceptionState& exceptionState) { | 1920 ExceptionState& exceptionState) { |
| 1926 texImageHelperImageBitmap(TexSubImage3D, target, level, 0, format, type, | 1921 texImageHelperImageBitmap(TexSubImage3D, target, level, 0, format, type, |
| 1927 xoffset, yoffset, zoffset, bitmap, exceptionState); | 1922 xoffset, yoffset, zoffset, bitmap, exceptionState); |
| 1928 } | 1923 } |
| 1929 | 1924 |
| 1930 void WebGL2RenderingContextBase::copyTexSubImage3D(GLenum target, | 1925 void WebGL2RenderingContextBase::copyTexSubImage3D(GLenum target, |
| 1931 GLint level, | 1926 GLint level, |
| 1932 GLint xoffset, | 1927 GLint xoffset, |
| 1933 GLint yoffset, | 1928 GLint yoffset, |
| (...skipping 3013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4947 | 4942 |
| 4948 void WebGL2RenderingContextBase:: | 4943 void WebGL2RenderingContextBase:: |
| 4949 DrawingBufferClientRestorePixelUnpackBufferBinding() { | 4944 DrawingBufferClientRestorePixelUnpackBufferBinding() { |
| 4950 if (!contextGL()) | 4945 if (!contextGL()) |
| 4951 return; | 4946 return; |
| 4952 contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, | 4947 contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, |
| 4953 objectOrZero(m_boundPixelUnpackBuffer.get())); | 4948 objectOrZero(m_boundPixelUnpackBuffer.get())); |
| 4954 } | 4949 } |
| 4955 | 4950 |
| 4956 } // namespace blink | 4951 } // namespace blink |
| OLD | NEW |