2013-07-16 18:32:24 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2014-11-11 02:16:50 +03:00
|
|
|
#ifndef WEBGL_1_CONTEXT_H_
|
|
|
|
#define WEBGL_1_CONTEXT_H_
|
2013-07-16 18:32:24 +04:00
|
|
|
|
|
|
|
#include "WebGLContext.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
class WebGL1Context
|
|
|
|
: public WebGLContext
|
|
|
|
{
|
|
|
|
public:
|
2014-11-11 02:16:50 +03:00
|
|
|
static WebGL1Context* Create();
|
2013-07-16 18:32:24 +04:00
|
|
|
|
2014-11-11 02:16:50 +03:00
|
|
|
private:
|
2013-07-16 18:32:24 +04:00
|
|
|
WebGL1Context();
|
2015-11-25 07:15:29 +03:00
|
|
|
|
|
|
|
virtual UniquePtr<webgl::FormatUsageAuthority>
|
|
|
|
CreateFormatUsage(gl::GLContext* gl) const override;
|
2013-07-16 18:32:24 +04:00
|
|
|
|
2014-11-11 02:16:50 +03:00
|
|
|
public:
|
|
|
|
virtual ~WebGL1Context();
|
2013-07-17 17:58:09 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool IsWebGL2() const override {
|
2013-07-17 17:58:09 +04:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-11-11 02:16:50 +03:00
|
|
|
// nsWrapperCache
|
2015-07-15 03:37:28 +03:00
|
|
|
virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> givenProto) override;
|
2014-06-24 04:56:21 +04:00
|
|
|
|
|
|
|
private:
|
2016-07-22 09:25:41 +03:00
|
|
|
virtual bool ValidateAttribPointerType(bool integerMode, GLenum type,
|
|
|
|
uint32_t* alignment,
|
|
|
|
const char* info) override;
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool ValidateBufferTarget(GLenum target, const char* info) override;
|
|
|
|
virtual bool ValidateBufferIndexedTarget(GLenum target, const char* info) override;
|
2015-02-03 05:06:20 +03:00
|
|
|
virtual bool ValidateBufferUsageEnum(GLenum usage, const char* info) override;
|
2015-04-17 04:17:07 +03:00
|
|
|
virtual bool ValidateQueryTarget(GLenum target, const char* info) override;
|
2015-03-23 04:29:32 +03:00
|
|
|
virtual bool ValidateUniformMatrixTranspose(bool transpose, const char* info) override;
|
2013-07-16 18:32:24 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2014-11-11 02:16:50 +03:00
|
|
|
#endif // WEBGL_1_CONTEXT_H_
|