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

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

Issue 2489203002: support uploading sub-rectangles of ImageData (Closed)
Patch Set: 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 | « no previous file | third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h » ('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 0d7f2fd898e4884bc7e0eb14432299276595b68a..7f0237550d6fe1a8e62abe9492834d8600182d88 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
@@ -1309,8 +1309,13 @@ void WebGL2RenderingContextBase::texImage2D(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(TexImage2D, target, level, internalformat, 0, format,
+ type, 1, 0, 0, 0, pixels, sourceImageRect);
}
void WebGL2RenderingContextBase::texImage2D(GLenum target,
@@ -1464,7 +1469,12 @@ void WebGL2RenderingContextBase::texSubImage2D(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(TexSubImage2D, target, level, 0, 0, format, type, 1,
+ xoffset, yoffset, 0, pixels, sourceImageRect);
}
void WebGL2RenderingContextBase::texSubImage2D(GLenum target,
@@ -1894,7 +1904,8 @@ void WebGL2RenderingContextBase::texSubImage3D(GLenum target,
GLenum type,
ImageData* pixels) {
texImageHelperImageData(TexSubImage3D, target, level, 0, 0, format, type, 1,
- xoffset, yoffset, zoffset, pixels);
+ xoffset, yoffset, zoffset, pixels,
+ getImageDataSize(pixels));
}
void WebGL2RenderingContextBase::texSubImage3D(GLenum target,
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698