| 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 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1302 } | 1302 } |
| 1303 | 1303 |
| 1304 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1304 void WebGL2RenderingContextBase::texImage2D(GLenum target, |
| 1305 GLint level, | 1305 GLint level, |
| 1306 GLint internalformat, | 1306 GLint internalformat, |
| 1307 GLsizei width, | 1307 GLsizei width, |
| 1308 GLsizei height, | 1308 GLsizei height, |
| 1309 GLint border, | 1309 GLint border, |
| 1310 GLenum format, | 1310 GLenum format, |
| 1311 GLenum type, | 1311 GLenum type, |
| 1312 ImageData* imageData) { | 1312 ImageData* pixels) { |
| 1313 // TODO(zmo): To be implemented. | 1313 DCHECK(pixels); |
| 1314 IntRect sourceImageRect; |
| 1315 sourceImageRect.setLocation(IntPoint(m_unpackSkipPixels, m_unpackSkipRows)); |
| 1316 sourceImageRect.setSize(IntSize(width, height)); |
| 1317 texImageHelperImageData(TexImage2D, target, level, internalformat, 0, format, |
| 1318 type, 1, 0, 0, 0, pixels, sourceImageRect); |
| 1314 } | 1319 } |
| 1315 | 1320 |
| 1316 void WebGL2RenderingContextBase::texImage2D(GLenum target, | 1321 void WebGL2RenderingContextBase::texImage2D(GLenum target, |
| 1317 GLint level, | 1322 GLint level, |
| 1318 GLint internalformat, | 1323 GLint internalformat, |
| 1319 GLsizei width, | 1324 GLsizei width, |
| 1320 GLsizei height, | 1325 GLsizei height, |
| 1321 GLint border, | 1326 GLint border, |
| 1322 GLenum format, | 1327 GLenum format, |
| 1323 GLenum type, | 1328 GLenum type, |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1457 | 1462 |
| 1458 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, | 1463 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, |
| 1459 GLint level, | 1464 GLint level, |
| 1460 GLint xoffset, | 1465 GLint xoffset, |
| 1461 GLint yoffset, | 1466 GLint yoffset, |
| 1462 GLsizei width, | 1467 GLsizei width, |
| 1463 GLsizei height, | 1468 GLsizei height, |
| 1464 GLenum format, | 1469 GLenum format, |
| 1465 GLenum type, | 1470 GLenum type, |
| 1466 ImageData* pixels) { | 1471 ImageData* pixels) { |
| 1467 // TODO(zmo): To be implemented. | 1472 DCHECK(pixels); |
| 1473 IntRect sourceImageRect; |
| 1474 sourceImageRect.setLocation(IntPoint(m_unpackSkipPixels, m_unpackSkipRows)); |
| 1475 sourceImageRect.setSize(IntSize(width, height)); |
| 1476 texImageHelperImageData(TexSubImage2D, target, level, 0, 0, format, type, 1, |
| 1477 xoffset, yoffset, 0, pixels, sourceImageRect); |
| 1468 } | 1478 } |
| 1469 | 1479 |
| 1470 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, | 1480 void WebGL2RenderingContextBase::texSubImage2D(GLenum target, |
| 1471 GLint level, | 1481 GLint level, |
| 1472 GLint xoffset, | 1482 GLint xoffset, |
| 1473 GLint yoffset, | 1483 GLint yoffset, |
| 1474 GLsizei width, | 1484 GLsizei width, |
| 1475 GLsizei height, | 1485 GLsizei height, |
| 1476 GLenum format, | 1486 GLenum format, |
| 1477 GLenum type, | 1487 GLenum type, |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1887 | 1897 |
| 1888 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, | 1898 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, |
| 1889 GLint level, | 1899 GLint level, |
| 1890 GLint xoffset, | 1900 GLint xoffset, |
| 1891 GLint yoffset, | 1901 GLint yoffset, |
| 1892 GLint zoffset, | 1902 GLint zoffset, |
| 1893 GLenum format, | 1903 GLenum format, |
| 1894 GLenum type, | 1904 GLenum type, |
| 1895 ImageData* pixels) { | 1905 ImageData* pixels) { |
| 1896 texImageHelperImageData(TexSubImage3D, target, level, 0, 0, format, type, 1, | 1906 texImageHelperImageData(TexSubImage3D, target, level, 0, 0, format, type, 1, |
| 1897 xoffset, yoffset, zoffset, pixels); | 1907 xoffset, yoffset, zoffset, pixels, |
| 1908 getImageDataSize(pixels)); |
| 1898 } | 1909 } |
| 1899 | 1910 |
| 1900 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, | 1911 void WebGL2RenderingContextBase::texSubImage3D(GLenum target, |
| 1901 GLint level, | 1912 GLint level, |
| 1902 GLint xoffset, | 1913 GLint xoffset, |
| 1903 GLint yoffset, | 1914 GLint yoffset, |
| 1904 GLint zoffset, | 1915 GLint zoffset, |
| 1905 GLenum format, | 1916 GLenum format, |
| 1906 GLenum type, | 1917 GLenum type, |
| 1907 HTMLCanvasElement* canvas, | 1918 HTMLCanvasElement* canvas, |
| (...skipping 3046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4954 | 4965 |
| 4955 void WebGL2RenderingContextBase:: | 4966 void WebGL2RenderingContextBase:: |
| 4956 DrawingBufferClientRestorePixelUnpackBufferBinding() { | 4967 DrawingBufferClientRestorePixelUnpackBufferBinding() { |
| 4957 if (!contextGL()) | 4968 if (!contextGL()) |
| 4958 return; | 4969 return; |
| 4959 contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, | 4970 contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, |
| 4960 objectOrZero(m_boundPixelUnpackBuffer.get())); | 4971 objectOrZero(m_boundPixelUnpackBuffer.get())); |
| 4961 } | 4972 } |
| 4962 | 4973 |
| 4963 } // namespace blink | 4974 } // namespace blink |
| OLD | NEW |