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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h

Issue 1573173002: Make WebGL's texImage2D and texSubImage2D handle cross-origin ImageBitmap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: layout test passed :) Created 4 years, 11 months 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 GLenum format, GLenum type, DOMArrayBufferView*); 296 GLenum format, GLenum type, DOMArrayBufferView*);
297 void texImage2D(GLenum target, GLint level, GLint internalformat, 297 void texImage2D(GLenum target, GLint level, GLint internalformat,
298 GLenum format, GLenum type, ImageData*); 298 GLenum format, GLenum type, ImageData*);
299 void texImage2D(GLenum target, GLint level, GLint internalformat, 299 void texImage2D(GLenum target, GLint level, GLint internalformat,
300 GLenum format, GLenum type, HTMLImageElement*, ExceptionState&); 300 GLenum format, GLenum type, HTMLImageElement*, ExceptionState&);
301 void texImage2D(GLenum target, GLint level, GLint internalformat, 301 void texImage2D(GLenum target, GLint level, GLint internalformat,
302 GLenum format, GLenum type, HTMLCanvasElement*, ExceptionState&); 302 GLenum format, GLenum type, HTMLCanvasElement*, ExceptionState&);
303 void texImage2D(GLenum target, GLint level, GLint internalformat, 303 void texImage2D(GLenum target, GLint level, GLint internalformat,
304 GLenum format, GLenum type, HTMLVideoElement*, ExceptionState&); 304 GLenum format, GLenum type, HTMLVideoElement*, ExceptionState&);
305 void texImage2D(GLenum target, GLint level, GLint internalformat, 305 void texImage2D(GLenum target, GLint level, GLint internalformat,
306 GLenum format, GLenum type, PassRefPtrWillBeRawPtr<ImageBitmap>); 306 GLenum format, GLenum type, PassRefPtrWillBeRawPtr<ImageBitmap>, Excepti onState&);
307 307
308 void texParameterf(GLenum target, GLenum pname, GLfloat param); 308 void texParameterf(GLenum target, GLenum pname, GLfloat param);
309 void texParameteri(GLenum target, GLenum pname, GLint param); 309 void texParameteri(GLenum target, GLenum pname, GLint param);
310 310
311 void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, 311 void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
312 GLsizei width, GLsizei height, 312 GLsizei width, GLsizei height,
313 GLenum format, GLenum type, DOMArrayBufferView*); 313 GLenum format, GLenum type, DOMArrayBufferView*);
314 void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, 314 void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
315 GLenum format, GLenum type, ImageData*); 315 GLenum format, GLenum type, ImageData*);
316 void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, 316 void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
317 GLenum format, GLenum type, HTMLImageElement*, ExceptionState&); 317 GLenum format, GLenum type, HTMLImageElement*, ExceptionState&);
318 void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, 318 void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
319 GLenum format, GLenum type, HTMLCanvasElement*, ExceptionState&); 319 GLenum format, GLenum type, HTMLCanvasElement*, ExceptionState&);
320 void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, 320 void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
321 GLenum format, GLenum type, HTMLVideoElement*, ExceptionState&); 321 GLenum format, GLenum type, HTMLVideoElement*, ExceptionState&);
322 void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, 322 void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
323 GLenum format, GLenum type, PassRefPtrWillBeRawPtr<ImageBitmap>); 323 GLenum format, GLenum type, PassRefPtrWillBeRawPtr<ImageBitmap>, Excepti onState&);
324 324
325 void uniform1f(const WebGLUniformLocation*, GLfloat x); 325 void uniform1f(const WebGLUniformLocation*, GLfloat x);
326 void uniform1fv(const WebGLUniformLocation*, const FlexibleFloat32ArrayView& ); 326 void uniform1fv(const WebGLUniformLocation*, const FlexibleFloat32ArrayView& );
327 void uniform1fv(const WebGLUniformLocation*, Vector<GLfloat>&); 327 void uniform1fv(const WebGLUniformLocation*, Vector<GLfloat>&);
328 void uniform1i(const WebGLUniformLocation*, GLint x); 328 void uniform1i(const WebGLUniformLocation*, GLint x);
329 void uniform1iv(const WebGLUniformLocation*, const FlexibleInt32ArrayView&); 329 void uniform1iv(const WebGLUniformLocation*, const FlexibleInt32ArrayView&);
330 void uniform1iv(const WebGLUniformLocation*, Vector<GLint>&); 330 void uniform1iv(const WebGLUniformLocation*, Vector<GLint>&);
331 void uniform2f(const WebGLUniformLocation*, GLfloat x, GLfloat y); 331 void uniform2f(const WebGLUniformLocation*, GLfloat x, GLfloat y);
332 void uniform2fv(const WebGLUniformLocation*, const FlexibleFloat32ArrayView& ); 332 void uniform2fv(const WebGLUniformLocation*, const FlexibleFloat32ArrayView& );
333 void uniform2fv(const WebGLUniformLocation*, Vector<GLfloat>&); 333 void uniform2fv(const WebGLUniformLocation*, Vector<GLfloat>&);
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 1018
1019 // Helper function for tex{Sub}Image2D to make sure image is ready and would n't taint Origin. 1019 // Helper function for tex{Sub}Image2D to make sure image is ready and would n't taint Origin.
1020 bool validateHTMLImageElement(const char* functionName, HTMLImageElement*, E xceptionState&); 1020 bool validateHTMLImageElement(const char* functionName, HTMLImageElement*, E xceptionState&);
1021 1021
1022 // Helper function for tex{Sub}Image2D to make sure canvas is ready and woul dn't taint Origin. 1022 // Helper function for tex{Sub}Image2D to make sure canvas is ready and woul dn't taint Origin.
1023 bool validateHTMLCanvasElement(const char* functionName, HTMLCanvasElement*, ExceptionState&); 1023 bool validateHTMLCanvasElement(const char* functionName, HTMLCanvasElement*, ExceptionState&);
1024 1024
1025 // Helper function for tex{Sub}Image2D to make sure video is ready wouldn't taint Origin. 1025 // Helper function for tex{Sub}Image2D to make sure video is ready wouldn't taint Origin.
1026 bool validateHTMLVideoElement(const char* functionName, HTMLVideoElement*, E xceptionState&); 1026 bool validateHTMLVideoElement(const char* functionName, HTMLVideoElement*, E xceptionState&);
1027 1027
1028 // Helper function for tex{Sub}Image2D to make sure imagebitmap is ready and wouldn't taint Origin.
1029 bool validateImageBitmap(const char* functionName, ImageBitmap*, ExceptionSt ate&);
1030
1028 // Helper function to validate drawArrays(Instanced) calls 1031 // Helper function to validate drawArrays(Instanced) calls
1029 bool validateDrawArrays(const char* functionName, GLenum mode, GLint first, GLsizei count); 1032 bool validateDrawArrays(const char* functionName, GLenum mode, GLint first, GLsizei count);
1030 1033
1031 // Helper function to validate drawElements(Instanced) calls 1034 // Helper function to validate drawElements(Instanced) calls
1032 bool validateDrawElements(const char* functionName, GLenum mode, GLsizei cou nt, GLenum type, long long offset); 1035 bool validateDrawElements(const char* functionName, GLenum mode, GLsizei cou nt, GLenum type, long long offset);
1033 1036
1034 // Helper functions to bufferData() and bufferSubData(). 1037 // Helper functions to bufferData() and bufferSubData().
1035 void bufferDataImpl(GLenum target, long long size, const void* data, GLenum usage); 1038 void bufferDataImpl(GLenum target, long long size, const void* data, GLenum usage);
1036 void bufferSubDataImpl(GLenum target, long long offset, GLsizeiptr, const vo id* data); 1039 void bufferSubDataImpl(GLenum target, long long offset, GLsizeiptr, const vo id* data);
1037 1040
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 static WebGLRenderingContextBase* oldestEvictedContext(); 1118 static WebGLRenderingContextBase* oldestEvictedContext();
1116 }; 1119 };
1117 1120
1118 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d()); 1121 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d());
1119 1122
1120 } // namespace blink 1123 } // namespace blink
1121 1124
1122 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState); 1125 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState);
1123 1126
1124 #endif // WebGLRenderingContextBase_h 1127 #endif // WebGLRenderingContextBase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698