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

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

Issue 1557603002: Unify validation for TexSubImage{2D|3D} (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: handle neutered image data 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 823 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 834
835 // Convert texture internal format. 835 // Convert texture internal format.
836 GLenum convertTexInternalFormat(GLenum internalformat, GLenum type); 836 GLenum convertTexInternalFormat(GLenum internalformat, GLenum type);
837 837
838 void texImage2DBase(GLenum target, GLint level, GLenum internalformat, GLsiz ei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels); 838 void texImage2DBase(GLenum target, GLint level, GLenum internalformat, GLsiz ei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels);
839 void texImage2DImpl(GLenum target, GLint level, GLenum internalformat, GLenu m format, GLenum type, Image*, WebGLImageConversion::ImageHtmlDomSource, bool fl ipY, bool premultiplyAlpha); 839 void texImage2DImpl(GLenum target, GLint level, GLenum internalformat, GLenu m format, GLenum type, Image*, WebGLImageConversion::ImageHtmlDomSource, bool fl ipY, bool premultiplyAlpha);
840 void texSubImage2DBase(GLenum target, GLint level, GLint xoffset, GLint yoff set, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixe ls); 840 void texSubImage2DBase(GLenum target, GLint level, GLint xoffset, GLint yoff set, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixe ls);
841 void texSubImage2DImpl(GLenum target, GLint level, GLint xoffset, GLint yoff set, GLenum format, GLenum type, Image*, WebGLImageConversion::ImageHtmlDomSourc e, bool flipY, bool premultiplyAlpha); 841 void texSubImage2DImpl(GLenum target, GLint level, GLint xoffset, GLint yoff set, GLenum format, GLenum type, Image*, WebGLImageConversion::ImageHtmlDomSourc e, bool flipY, bool premultiplyAlpha);
842 842
843 enum TexImageFunctionType { 843 enum TexImageFunctionType {
844 NotTexSubImage2D, 844 NotTexSubImage,
845 TexSubImage2D 845 TexSubImage
846 }; 846 };
847 enum TexImageByGPUType { 847 enum TexImageByGPUType {
848 TexImage2DByGPU, 848 TexImage2DByGPU,
849 TexSubImage2DByGPU, 849 TexSubImage2DByGPU,
850 TexSubImage3DByGPU 850 TexSubImage3DByGPU
851 }; 851 };
852 // Copy from the canvas element directly to the texture via the GPU, without a read-back to system memory. 852 // Copy from the canvas element directly to the texture via the GPU, without a read-back to system memory.
853 void texImageCanvasByGPU(TexImageByGPUType, WebGLTexture*, GLenum target, GL int level, 853 void texImageCanvasByGPU(TexImageByGPUType, WebGLTexture*, GLenum target, GL int level,
854 GLenum internalformat, GLenum type, GLint xoffset, GLint yoffset, GLint zoffset, HTMLCanvasElement*); 854 GLenum internalformat, GLenum type, GLint xoffset, GLint yoffset, GLint zoffset, HTMLCanvasElement*);
855 bool canUseTexImageCanvasByGPU(GLenum internalformat, GLenum type); 855 bool canUseTexImageCanvasByGPU(GLenum internalformat, GLenum type);
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
1148 static WebGLRenderingContextBase* oldestEvictedContext(); 1148 static WebGLRenderingContextBase* oldestEvictedContext();
1149 }; 1149 };
1150 1150
1151 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d()); 1151 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d());
1152 1152
1153 } // namespace blink 1153 } // namespace blink
1154 1154
1155 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState); 1155 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState);
1156 1156
1157 #endif // WebGLRenderingContextBase_h 1157 #endif // WebGLRenderingContextBase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698