| 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 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1369 } | 1369 } |
| 1370 | 1370 |
| 1371 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1371 void WebGL2RenderingContextBase::texImage2D(GLenum target, |
| 1372 GLint level, | 1372 GLint level, |
| 1373 GLint internalformat, | 1373 GLint internalformat, |
| 1374 GLsizei width, | 1374 GLsizei width, |
| 1375 GLsizei height, | 1375 GLsizei height, |
| 1376 GLint border, | 1376 GLint border, |
| 1377 GLenum format, | 1377 GLenum format, |
| 1378 GLenum type, | 1378 GLenum type, |
| 1379 ImageBitmap* imageBitMap, | 1379 ImageBitmap* bitmap, |
| 1380 ExceptionState& exceptionState) { | 1380 ExceptionState& exceptionState) { |
| 1381 // TODO(zmo): To be implemented. | 1381 DCHECK(bitmap); |
| 1382 texImageHelperImageBitmap( |
| 1383 TexImage2D, target, level, internalformat, format, type, 0, 0, 0, bitmap, |
| 1384 getTextureSourceSubRectangle(width, height), 1, 0, exceptionState); |
| 1382 } | 1385 } |
| 1383 | 1386 |
| 1384 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1387 void WebGL2RenderingContextBase::texImage2D(GLenum target, |
| 1385 GLint level, | 1388 GLint level, |
| 1386 GLint internalformat, | 1389 GLint internalformat, |
| 1387 GLenum format, | 1390 GLenum format, |
| 1388 GLenum type, | 1391 GLenum type, |
| 1389 ImageData* imageData) { | 1392 ImageData* imageData) { |
| 1390 WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, | 1393 WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, |
| 1391 type, imageData); | 1394 type, imageData); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1527 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, | 1530 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, |
| 1528 GLint level, | 1531 GLint level, |
| 1529 GLint xoffset, | 1532 GLint xoffset, |
| 1530 GLint yoffset, | 1533 GLint yoffset, |
| 1531 GLsizei width, | 1534 GLsizei width, |
| 1532 GLsizei height, | 1535 GLsizei height, |
| 1533 GLenum format, | 1536 GLenum format, |
| 1534 GLenum type, | 1537 GLenum type, |
| 1535 ImageBitmap* bitmap, | 1538 ImageBitmap* bitmap, |
| 1536 ExceptionState& exceptionState) { | 1539 ExceptionState& exceptionState) { |
| 1537 // TODO(zmo): To be implemented. | 1540 DCHECK(bitmap); |
| 1541 texImageHelperImageBitmap(TexSubImage2D, target, level, 0, format, type, |
| 1542 xoffset, yoffset, 0, bitmap, |
| 1543 getTextureSourceSubRectangle(width, height), 1, 0, |
| 1544 exceptionState); |
| 1538 } | 1545 } |
| 1539 | 1546 |
| 1540 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, | 1547 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, |
| 1541 GLint level, | 1548 GLint level, |
| 1542 GLint xoffset, | 1549 GLint xoffset, |
| 1543 GLint yoffset, | 1550 GLint yoffset, |
| 1544 GLenum format, | 1551 GLenum format, |
| 1545 GLenum type, | 1552 GLenum type, |
| 1546 ImageData* pixels) { | 1553 ImageData* pixels) { |
| 1547 WebGLRenderingContextBase::texSubImage2D(target, level, xoffset, yoffset, | 1554 WebGLRenderingContextBase::texSubImage2D(target, level, xoffset, yoffset, |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1759 | 1766 |
| 1760 void WebGL2RenderingContextBase::texImage3D(GLenum target, | 1767 void WebGL2RenderingContextBase::texImage3D(GLenum target, |
| 1761 GLint level, | 1768 GLint level, |
| 1762 GLint internalformat, | 1769 GLint internalformat, |
| 1763 GLsizei width, | 1770 GLsizei width, |
| 1764 GLsizei height, | 1771 GLsizei height, |
| 1765 GLsizei depth, | 1772 GLsizei depth, |
| 1766 GLint border, | 1773 GLint border, |
| 1767 GLenum format, | 1774 GLenum format, |
| 1768 GLenum type, | 1775 GLenum type, |
| 1769 ImageBitmap* imageBitMap, | 1776 ImageBitmap* bitmap, |
| 1770 ExceptionState& exceptionState) { | 1777 ExceptionState& exceptionState) { |
| 1771 // TODO(zmo): To be implemented. | 1778 texImageHelperImageBitmap(TexImage3D, target, level, internalformat, format, |
| 1779 type, 0, 0, 0, bitmap, |
| 1780 getTextureSourceSubRectangle(width, height), depth, |
| 1781 m_unpackImageHeight, exceptionState); |
| 1772 } | 1782 } |
| 1773 | 1783 |
| 1774 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, | 1784 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, |
| 1775 GLint level, | 1785 GLint level, |
| 1776 GLint xoffset, | 1786 GLint xoffset, |
| 1777 GLint yoffset, | 1787 GLint yoffset, |
| 1778 GLint zoffset, | 1788 GLint zoffset, |
| 1779 GLsizei width, | 1789 GLsizei width, |
| 1780 GLsizei height, | 1790 GLsizei height, |
| 1781 GLsizei depth, | 1791 GLsizei depth, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1825 GLint xoffset, | 1835 GLint xoffset, |
| 1826 GLint yoffset, | 1836 GLint yoffset, |
| 1827 GLint zoffset, | 1837 GLint zoffset, |
| 1828 GLsizei width, | 1838 GLsizei width, |
| 1829 GLsizei height, | 1839 GLsizei height, |
| 1830 GLsizei depth, | 1840 GLsizei depth, |
| 1831 GLenum format, | 1841 GLenum format, |
| 1832 GLenum type, | 1842 GLenum type, |
| 1833 ImageData* pixels) { | 1843 ImageData* pixels) { |
| 1834 DCHECK(pixels); | 1844 DCHECK(pixels); |
| 1835 IntRect sourceImageRect; | |
| 1836 sourceImageRect.setLocation(IntPoint(m_unpackSkipPixels, m_unpackSkipRows)); | |
| 1837 sourceImageRect.setSize(IntSize(width, height)); | |
| 1838 texImageHelperImageData(TexSubImage3D, target, level, 0, 0, format, type, | 1845 texImageHelperImageData(TexSubImage3D, target, level, 0, 0, format, type, |
| 1839 depth, xoffset, yoffset, zoffset, pixels, | 1846 depth, xoffset, yoffset, zoffset, pixels, |
| 1840 sourceImageRect, m_unpackImageHeight); | 1847 getTextureSourceSubRectangle(width, height), |
| 1848 m_unpackImageHeight); |
| 1841 } | 1849 } |
| 1842 | 1850 |
| 1843 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, | 1851 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, |
| 1844 GLint level, | 1852 GLint level, |
| 1845 GLint xoffset, | 1853 GLint xoffset, |
| 1846 GLint yoffset, | 1854 GLint yoffset, |
| 1847 GLint zoffset, | 1855 GLint zoffset, |
| 1848 GLsizei width, | 1856 GLsizei width, |
| 1849 GLsizei height, | 1857 GLsizei height, |
| 1850 GLsizei depth, | 1858 GLsizei depth, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1899 GLint xoffset, | 1907 GLint xoffset, |
| 1900 GLint yoffset, | 1908 GLint yoffset, |
| 1901 GLint zoffset, | 1909 GLint zoffset, |
| 1902 GLsizei width, | 1910 GLsizei width, |
| 1903 GLsizei height, | 1911 GLsizei height, |
| 1904 GLsizei depth, | 1912 GLsizei depth, |
| 1905 GLenum format, | 1913 GLenum format, |
| 1906 GLenum type, | 1914 GLenum type, |
| 1907 ImageBitmap* bitmap, | 1915 ImageBitmap* bitmap, |
| 1908 ExceptionState& exceptionState) { | 1916 ExceptionState& exceptionState) { |
| 1909 // TODO(zmo): To be implemented. | |
| 1910 } | |
| 1911 | |
| 1912 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, | |
| 1913 GLint level, | |
| 1914 GLint xoffset, | |
| 1915 GLint yoffset, | |
| 1916 GLint zoffset, | |
| 1917 GLenum format, | |
| 1918 GLenum type, | |
| 1919 ImageBitmap* bitmap, | |
| 1920 ExceptionState& exceptionState) { | |
| 1921 texImageHelperImageBitmap(TexSubImage3D, target, level, 0, format, type, | 1917 texImageHelperImageBitmap(TexSubImage3D, target, level, 0, format, type, |
| 1922 xoffset, yoffset, zoffset, bitmap, exceptionState); | 1918 xoffset, yoffset, zoffset, bitmap, |
| 1919 getTextureSourceSubRectangle(width, height), depth, |
| 1920 m_unpackImageHeight, exceptionState); |
| 1923 } | 1921 } |
| 1924 | 1922 |
| 1925 void WebGL2RenderingContextBase::copyTexSubImage3D(GLenum target, | 1923 void WebGL2RenderingContextBase::copyTexSubImage3D(GLenum target, |
| 1926 GLint level, | 1924 GLint level, |
| 1927 GLint xoffset, | 1925 GLint xoffset, |
| 1928 GLint yoffset, | 1926 GLint yoffset, |
| 1929 GLint zoffset, | 1927 GLint zoffset, |
| 1930 GLint x, | 1928 GLint x, |
| 1931 GLint y, | 1929 GLint y, |
| 1932 GLsizei width, | 1930 GLsizei width, |
| (...skipping 3009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4942 | 4940 |
| 4943 void WebGL2RenderingContextBase:: | 4941 void WebGL2RenderingContextBase:: |
| 4944 DrawingBufferClientRestorePixelUnpackBufferBinding() { | 4942 DrawingBufferClientRestorePixelUnpackBufferBinding() { |
| 4945 if (!contextGL()) | 4943 if (!contextGL()) |
| 4946 return; | 4944 return; |
| 4947 contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, | 4945 contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, |
| 4948 objectOrZero(m_boundPixelUnpackBuffer.get())); | 4946 objectOrZero(m_boundPixelUnpackBuffer.get())); |
| 4949 } | 4947 } |
| 4950 | 4948 |
| 4951 } // namespace blink | 4949 } // namespace blink |
| OLD | NEW |