Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /* This Source Code Form is subject to the terms of the Mozilla Public
3 : * License, v. 2.0. If a copy of the MPL was not distributed with this
4 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 :
6 : #include "GLContext.h"
7 : #include "WebGL2Context.h"
8 : #include "WebGLContextUtils.h"
9 : #include "WebGLTexture.h"
10 :
11 : namespace mozilla {
12 :
13 : void
14 0 : WebGL2Context::TexStorage(const char* funcName, uint8_t funcDims, GLenum rawTarget,
15 : GLsizei levels, GLenum internalFormat, GLsizei width,
16 : GLsizei height, GLsizei depth)
17 : {
18 0 : TexTarget target;
19 : WebGLTexture* tex;
20 0 : if (!ValidateTexTarget(this, funcName, funcDims, rawTarget, &target, &tex))
21 0 : return;
22 :
23 0 : tex->TexStorage(funcName, target, levels, internalFormat, width, height, depth);
24 : }
25 :
26 : ////////////////////
27 :
28 : /*virtual*/ bool
29 0 : WebGL2Context::IsTexParamValid(GLenum pname) const
30 : {
31 0 : switch (pname) {
32 : case LOCAL_GL_TEXTURE_BASE_LEVEL:
33 : case LOCAL_GL_TEXTURE_COMPARE_FUNC:
34 : case LOCAL_GL_TEXTURE_COMPARE_MODE:
35 : case LOCAL_GL_TEXTURE_IMMUTABLE_FORMAT:
36 : case LOCAL_GL_TEXTURE_IMMUTABLE_LEVELS:
37 : case LOCAL_GL_TEXTURE_MAX_LEVEL:
38 : case LOCAL_GL_TEXTURE_WRAP_R:
39 : case LOCAL_GL_TEXTURE_MAX_LOD:
40 : case LOCAL_GL_TEXTURE_MIN_LOD:
41 0 : return true;
42 :
43 : default:
44 0 : return WebGLContext::IsTexParamValid(pname);
45 : }
46 : }
47 :
48 : } // namespace mozilla
|