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

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

Issue 1315323006: webgl: optimize webgl.texSubImage2D(video) path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: share code in texImage2D and texSubImage2D. fix win build failure Created 5 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 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 816 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 void texSubImage2DImpl(GLenum target, GLint level, GLint xoffset, GLint yoff set, GLenum format, GLenum type, Image*, WebGLImageConversion::ImageHtmlDomSourc e, bool flipY, bool premultiplyAlpha); 827 void texSubImage2DImpl(GLenum target, GLint level, GLint xoffset, GLint yoff set, GLenum format, GLenum type, Image*, WebGLImageConversion::ImageHtmlDomSourc e, bool flipY, bool premultiplyAlpha);
828 828
829 enum TexImageFunctionType { 829 enum TexImageFunctionType {
830 NotTexSubImage2D, 830 NotTexSubImage2D,
831 TexSubImage2D, 831 TexSubImage2D,
832 }; 832 };
833 // Copy from the canvas element directly to the texture via the GPU, without a read-back to system memory. 833 // Copy from the canvas element directly to the texture via the GPU, without a read-back to system memory.
834 void texImage2DCanvasByGPU(TexImageFunctionType, WebGLTexture*, GLenum targe t, GLint level, 834 void texImage2DCanvasByGPU(TexImageFunctionType, WebGLTexture*, GLenum targe t, GLint level,
835 GLenum internalformat, GLenum type, GLint xoffset, GLint yoffset, HTMLCa nvasElement*); 835 GLenum internalformat, GLenum type, GLint xoffset, GLint yoffset, HTMLCa nvasElement*);
836 836
837 bool texImage2DVideoByGPU(TexImageFunctionType, WebGLTexture*, GLenum target , GLint level,
838 GLenum internalformat, GLenum type, GLint xoffset, GLint yoffset, HTMLVi deoElement*);
839
837 void handleTextureCompleteness(const char*, bool); 840 void handleTextureCompleteness(const char*, bool);
838 void createFallbackBlackTextures1x1(); 841 void createFallbackBlackTextures1x1();
839 842
840 // Helper function for copyTex{Sub}Image, check whether the internalformat 843 // Helper function for copyTex{Sub}Image, check whether the internalformat
841 // and the color buffer format of the current bound framebuffer combination 844 // and the color buffer format of the current bound framebuffer combination
842 // is valid. 845 // is valid.
843 bool isTexInternalFormatColorBufferCombinationValid(GLenum texInternalFormat , GLenum colorBufferFormat); 846 bool isTexInternalFormatColorBufferCombinationValid(GLenum texInternalFormat , GLenum colorBufferFormat);
844 847
845 // Helper function to get the bound framebuffer's color buffer format. 848 // Helper function to get the bound framebuffer's color buffer format.
846 virtual GLenum boundFramebufferColorFormat(); 849 virtual GLenum boundFramebufferColorFormat();
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1127 static IntSize oldestContextSize(); 1130 static IntSize oldestContextSize();
1128 }; 1131 };
1129 1132
1130 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d()); 1133 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d());
1131 1134
1132 } // namespace blink 1135 } // namespace blink
1133 1136
1134 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState); 1137 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState);
1135 1138
1136 #endif // WebGLRenderingContextBase_h 1139 #endif // WebGLRenderingContextBase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698