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

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

Issue 2821363003: WebGL: tex(Sub)Image(2D|3D) texImageSource support for RGB10_A2 textures. (Closed)
Patch Set: Created 3 years, 8 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 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 GL_RGBA32F, 907 GL_RGBA32F,
908 GL_DEPTH_COMPONENT16, 908 GL_DEPTH_COMPONENT16,
909 GL_DEPTH_COMPONENT24, 909 GL_DEPTH_COMPONENT24,
910 GL_DEPTH_COMPONENT32F, 910 GL_DEPTH_COMPONENT32F,
911 GL_DEPTH24_STENCIL8, 911 GL_DEPTH24_STENCIL8,
912 GL_DEPTH32F_STENCIL8, 912 GL_DEPTH32F_STENCIL8,
913 }; 913 };
914 914
915 // ES3 enums supported by TexImageSource 915 // ES3 enums supported by TexImageSource
916 static const GLenum kSupportedInternalFormatsTexImageSourceES3[] = { 916 static const GLenum kSupportedInternalFormatsTexImageSourceES3[] = {
917 GL_R8, GL_R16F, GL_R32F, GL_R8UI, GL_RG8, 917 GL_R8, GL_R16F, GL_R32F, GL_R8UI, GL_RG8,
918 GL_RG16F, GL_RG32F, GL_RG8UI, GL_RGB8, GL_SRGB8, 918 GL_RG16F, GL_RG32F, GL_RG8UI, GL_RGB8, GL_SRGB8,
919 GL_RGB565, GL_R11F_G11F_B10F, GL_RGB9_E5, GL_RGB16F, GL_RGB32F, 919 GL_RGB565, GL_R11F_G11F_B10F, GL_RGB9_E5, GL_RGB16F, GL_RGB32F,
920 GL_RGB8UI, GL_RGBA8, GL_SRGB8_ALPHA8, GL_RGB5_A1, GL_RGBA4, 920 GL_RGB8UI, GL_RGBA8, GL_SRGB8_ALPHA8, GL_RGB5_A1, GL_RGBA4,
921 GL_RGBA16F, GL_RGBA32F, GL_RGBA8UI, 921 GL_RGBA16F, GL_RGBA32F, GL_RGBA8UI, GL_RGB10_A2,
922 }; 922 };
923 923
924 // ES2 enums 924 // ES2 enums
925 // Internalformat must equal format in ES2. 925 // Internalformat must equal format in ES2.
926 static const GLenum kSupportedFormatsES2[] = { 926 static const GLenum kSupportedFormatsES2[] = {
927 GL_RGB, GL_RGBA, GL_LUMINANCE_ALPHA, GL_LUMINANCE, GL_ALPHA, 927 GL_RGB, GL_RGBA, GL_LUMINANCE_ALPHA, GL_LUMINANCE, GL_ALPHA,
928 }; 928 };
929 929
930 // Exposed by GL_ANGLE_depth_texture 930 // Exposed by GL_ANGLE_depth_texture
931 static const GLenum kSupportedFormatsOESDepthTex[] = { 931 static const GLenum kSupportedFormatsOESDepthTex[] = {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 GL_UNSIGNED_INT_2_10_10_10_REV, 984 GL_UNSIGNED_INT_2_10_10_10_REV,
985 GL_UNSIGNED_INT_10F_11F_11F_REV, 985 GL_UNSIGNED_INT_10F_11F_11F_REV,
986 GL_UNSIGNED_INT_5_9_9_9_REV, 986 GL_UNSIGNED_INT_5_9_9_9_REV,
987 GL_UNSIGNED_INT_24_8, 987 GL_UNSIGNED_INT_24_8,
988 GL_FLOAT_32_UNSIGNED_INT_24_8_REV, 988 GL_FLOAT_32_UNSIGNED_INT_24_8_REV,
989 }; 989 };
990 990
991 // ES3 enums supported by TexImageSource 991 // ES3 enums supported by TexImageSource
992 static const GLenum kSupportedTypesTexImageSourceES3[] = { 992 static const GLenum kSupportedTypesTexImageSourceES3[] = {
993 GL_HALF_FLOAT, GL_FLOAT, GL_UNSIGNED_INT_10F_11F_11F_REV, 993 GL_HALF_FLOAT, GL_FLOAT, GL_UNSIGNED_INT_10F_11F_11F_REV,
994 GL_UNSIGNED_INT_2_10_10_10_REV,
994 }; 995 };
995 996
996 } // namespace 997 } // namespace
997 998
998 WebGLRenderingContextBase::WebGLRenderingContextBase( 999 WebGLRenderingContextBase::WebGLRenderingContextBase(
999 OffscreenCanvas* passed_offscreen_canvas, 1000 OffscreenCanvas* passed_offscreen_canvas,
1000 std::unique_ptr<WebGraphicsContext3DProvider> context_provider, 1001 std::unique_ptr<WebGraphicsContext3DProvider> context_provider,
1001 const CanvasContextCreationAttributes& requested_attributes, 1002 const CanvasContextCreationAttributes& requested_attributes,
1002 unsigned version) 1003 unsigned version)
1003 : WebGLRenderingContextBase( 1004 : WebGLRenderingContextBase(
(...skipping 6830 matching lines...) Expand 10 before | Expand all | Expand 10 after
7834 7835
7835 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( 7836 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas(
7836 HTMLCanvasElementOrOffscreenCanvas& result) const { 7837 HTMLCanvasElementOrOffscreenCanvas& result) const {
7837 if (canvas()) 7838 if (canvas())
7838 result.setHTMLCanvasElement(canvas()); 7839 result.setHTMLCanvasElement(canvas());
7839 else 7840 else
7840 result.setOffscreenCanvas(offscreenCanvas()); 7841 result.setOffscreenCanvas(offscreenCanvas());
7841 } 7842 }
7842 7843
7843 } // namespace blink 7844 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698