@@ -1173,6 +1173,7 @@ static void RewriteWebGLSLtoGLSL(char* p, int len) {
1173
1173
METHOD_ENTRY( stencilOpSeparate ),
1174
1174
METHOD_ENTRY( texImage2D ),
1175
1175
METHOD_ENTRY( texImage2DSkCanvasB ),
1176
+ METHOD_ENTRY( compressedTexImage2D ),
1176
1177
METHOD_ENTRY( texParameterf ),
1177
1178
METHOD_ENTRY( texParameteri ),
1178
1179
METHOD_ENTRY( texSubImage2D ),
@@ -2774,6 +2775,31 @@ static void getVertexAttribOffset(
2774
2775
static void texImage2DSkCanvasB(const v8::FunctionCallbackInfo<v8::Value>& args);
2775
2776
static void drawSkCanvas(const v8::FunctionCallbackInfo<v8::Value>& args);
2776
2777
2778
+ // void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat,
2779
+ // GLsizei width, GLsizei height, GLint border,
2780
+ // ArrayBufferView data)
2781
+ DEFINE_METHOD(compressedTexImage2D, 7)
2782
+ GLvoid* data = NULL;
2783
+ GLsizeiptr size = 0; // FIXME use size
2784
+
2785
+ if (!args[6]->IsNull()) {
2786
+ // TODO(deanm): Check size / format. For now just use it correctly.
2787
+ if (!GetTypedArrayBytes(args[6], &data, &size))
2788
+ return v8_utils::ThrowError(isolate, "Data must be a TypedArray.");
2789
+ }
2790
+
2791
+ // TODO(deanm): Support more than just the zero initialization case.
2792
+ glCompressedTexImage2D(args[0]->Uint32Value(), // target
2793
+ args[1]->Int32Value(), // level
2794
+ args[2]->Int32Value(), // internalFormat
2795
+ args[3]->Int32Value(), // width
2796
+ args[4]->Int32Value(), // height
2797
+ args[5]->Int32Value(), // border
2798
+ size, // size
2799
+ data); // data
2800
+ return args.GetReturnValue().SetUndefined();
2801
+ }
2802
+
2777
2803
// void texParameterf(GLenum target, GLenum pname, GLfloat param)
2778
2804
DEFINE_METHOD(texParameterf, 3)
2779
2805
glTexParameterf(args[0]->Uint32Value(),
0 commit comments