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

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

Issue 1288303002: WebGL 2: add types into glReadPixels (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: nits Created 5 years, 4 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 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 // Helper function to check readbuffer validity for readPixels and copyTex{S ub}Image. 822 // Helper function to check readbuffer validity for readPixels and copyTex{S ub}Image.
823 // If yes, obtains the readbuffer's format, type, the bound read framebuffer , returns true. 823 // If yes, obtains the readbuffer's format, type, the bound read framebuffer , returns true.
824 // If not, generates a GL error, returns false. 824 // If not, generates a GL error, returns false.
825 // Note: it's OK to pass format == nullptr and type == nullptr. 825 // Note: it's OK to pass format == nullptr and type == nullptr.
826 bool validateReadBufferAndGetInfo(const char* functionName, WebGLFramebuffer *& readFramebufferBinding, GLenum* format, GLenum* type); 826 bool validateReadBufferAndGetInfo(const char* functionName, WebGLFramebuffer *& readFramebufferBinding, GLenum* format, GLenum* type);
827 827
828 // Helper function to check format/type enums for readPixels. 828 // Helper function to check format/type enums for readPixels.
829 // Generates INVALID_ENUM and returns false if parameters are invalid. 829 // Generates INVALID_ENUM and returns false if parameters are invalid.
830 virtual bool validateReadPixelsFormatAndType(GLenum format, GLenum type); 830 virtual bool validateReadPixelsFormatAndType(GLenum format, GLenum type);
831 831
832 // Helper function to get expected ArrayBuffer view type for readPixels.
833 virtual DOMArrayBufferView::ViewType readPixelsExpectedArrayBufferViewType(G Lenum type);
834
832 // Helper function to check format/type combination for readPixels. 835 // Helper function to check format/type combination for readPixels.
833 // Generates INVALID_OPERATION and returns false if the combination is unsup ported. 836 // Generates INVALID_OPERATION and returns false if the combination is unsup ported.
834 bool validateReadPixelsFormatTypeCombination(GLenum format, GLenum type, GLe num readBufferInternalFormat, GLenum readBufferType); 837 bool validateReadPixelsFormatTypeCombination(GLenum format, GLenum type, GLe num readBufferInternalFormat, GLenum readBufferType);
835 838
836 virtual GLint getMaxTextureLevelForTarget(GLenum target); 839 virtual GLint getMaxTextureLevelForTarget(GLenum target);
837 840
838 // Helper function to check input level for functions {copy}Tex{Sub}Image. 841 // Helper function to check input level for functions {copy}Tex{Sub}Image.
839 // Generates GL error and returns false if level is invalid. 842 // Generates GL error and returns false if level is invalid.
840 bool validateTexFuncLevel(const char* functionName, GLenum target, GLint lev el); 843 bool validateTexFuncLevel(const char* functionName, GLenum target, GLint lev el);
841 844
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 static IntSize oldestContextSize(); 1054 static IntSize oldestContextSize();
1052 }; 1055 };
1053 1056
1054 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d()); 1057 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d());
1055 1058
1056 } // namespace blink 1059 } // namespace blink
1057 1060
1058 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState); 1061 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState);
1059 1062
1060 #endif // WebGLRenderingContextBase_h 1063 #endif // WebGLRenderingContextBase_h
OLDNEW
« no previous file with comments | « Source/modules/webgl/WebGL2RenderingContextBase.cpp ('k') | Source/modules/webgl/WebGLRenderingContextBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698