Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(833)

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp

Issue 2500433003: support 3d texture sub-source uploads from ImageData (Closed)
Patch Set: address comment + rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « DEPS ('k') | third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
index 7f0237550d6fe1a8e62abe9492834d8600182d88..cba67108c70c60df1fbfbd39d3ccc907ea706d5a 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
@@ -1315,7 +1315,7 @@ void WebGL2RenderingContextBase::texImage2D(GLenum target,
sourceImageRect.setLocation(IntPoint(m_unpackSkipPixels, m_unpackSkipRows));
sourceImageRect.setSize(IntSize(width, height));
texImageHelperImageData(TexImage2D, target, level, internalformat, 0, format,
- type, 1, 0, 0, 0, pixels, sourceImageRect);
+ type, 1, 0, 0, 0, pixels, sourceImageRect, 0);
}
void WebGL2RenderingContextBase::texImage2D(GLenum target,
@@ -1474,7 +1474,7 @@ void WebGL2RenderingContextBase::texSubImage2D(GLenum target,
sourceImageRect.setLocation(IntPoint(m_unpackSkipPixels, m_unpackSkipRows));
sourceImageRect.setSize(IntSize(width, height));
texImageHelperImageData(TexSubImage2D, target, level, 0, 0, format, type, 1,
- xoffset, yoffset, 0, pixels, sourceImageRect);
+ xoffset, yoffset, 0, pixels, sourceImageRect, 0);
}
void WebGL2RenderingContextBase::texSubImage2D(GLenum target,
@@ -1696,8 +1696,14 @@ void WebGL2RenderingContextBase::texImage3D(GLenum target,
GLint border,
GLenum format,
GLenum type,
- ImageData* imageData) {
- // TODO(zmo): To be implemented.
+ ImageData* pixels) {
+ DCHECK(pixels);
+ IntRect sourceImageRect;
+ sourceImageRect.setLocation(IntPoint(m_unpackSkipPixels, m_unpackSkipRows));
+ sourceImageRect.setSize(IntSize(width, height));
+ texImageHelperImageData(TexImage3D, target, level, internalformat, 0, format,
+ type, depth, 0, 0, 0, pixels, sourceImageRect,
+ m_unpackImageHeight);
}
void WebGL2RenderingContextBase::texImage3D(GLenum target,
@@ -1824,7 +1830,13 @@ void WebGL2RenderingContextBase::texSubImage3D(GLenum target,
GLenum format,
GLenum type,
ImageData* pixels) {
- // TODO(zmo): To be implemented.
+ DCHECK(pixels);
+ IntRect sourceImageRect;
+ sourceImageRect.setLocation(IntPoint(m_unpackSkipPixels, m_unpackSkipRows));
+ sourceImageRect.setSize(IntSize(width, height));
+ texImageHelperImageData(TexSubImage3D, target, level, 0, 0, format, type,
+ depth, xoffset, yoffset, zoffset, pixels,
+ sourceImageRect, m_unpackImageHeight);
}
void WebGL2RenderingContextBase::texSubImage3D(GLenum target,
@@ -1902,19 +1914,6 @@ void WebGL2RenderingContextBase::texSubImage3D(GLenum target,
GLint zoffset,
GLenum format,
GLenum type,
- ImageData* pixels) {
- texImageHelperImageData(TexSubImage3D, target, level, 0, 0, format, type, 1,
- xoffset, yoffset, zoffset, pixels,
- getImageDataSize(pixels));
-}
-
-void WebGL2RenderingContextBase::texSubImage3D(GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLint zoffset,
- GLenum format,
- GLenum type,
HTMLCanvasElement* canvas,
ExceptionState& exceptionState) {
texImageHelperHTMLCanvasElement(TexSubImage3D, target, level, 0, format, type,
« no previous file with comments | « DEPS ('k') | third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698