2018-11-30 22:52:05 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-12-02 14:28:21 +04:00
|
|
|
/* 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-14 07:03:50 +03:00
|
|
|
#ifndef WEBGL_SHADER_PRECISION_FORMAT_H_
|
|
|
|
#define WEBGL_SHADER_PRECISION_FORMAT_H_
|
2012-12-02 14:28:21 +04:00
|
|
|
|
|
|
|
#include "WebGLObjectModel.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class WebGLShaderPrecisionFormat final : public WebGLContextBoundObject {
|
2012-12-02 14:28:21 +04:00
|
|
|
public:
|
2014-11-14 07:03:50 +03:00
|
|
|
WebGLShaderPrecisionFormat(WebGLContext* context, GLint rangeMin,
|
|
|
|
GLint rangeMax, GLint precision)
|
|
|
|
: WebGLContextBoundObject(context),
|
|
|
|
mRangeMin(rangeMin),
|
|
|
|
mRangeMax(rangeMax),
|
|
|
|
mPrecision(precision) {}
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2015-07-15 03:37:28 +03:00
|
|
|
bool WrapObject(JSContext* cx, JS::Handle<JSObject*> givenProto,
|
|
|
|
JS::MutableHandle<JSObject*> reflector);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2012-12-02 14:28:21 +04:00
|
|
|
// WebIDL WebGLShaderPrecisionFormat API
|
2013-09-04 16:14:43 +04:00
|
|
|
GLint RangeMin() const { return mRangeMin; }
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2013-09-04 16:14:43 +04:00
|
|
|
GLint RangeMax() const { return mRangeMax; }
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2013-09-04 16:14:43 +04:00
|
|
|
GLint Precision() const { return mPrecision; }
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2013-08-29 19:39:17 +04:00
|
|
|
NS_INLINE_DECL_REFCOUNTING(WebGLShaderPrecisionFormat)
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2014-04-04 20:27:02 +04:00
|
|
|
private:
|
|
|
|
// Private destructor, to discourage deletion outside of Release():
|
2014-11-14 07:03:50 +03:00
|
|
|
~WebGLShaderPrecisionFormat() {}
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2013-09-04 16:14:43 +04:00
|
|
|
GLint mRangeMin;
|
|
|
|
GLint mRangeMax;
|
|
|
|
GLint mPrecision;
|
2012-12-02 14:28:21 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2014-11-14 07:03:50 +03:00
|
|
|
#endif // WEBGL_SHADER_PRECISION_FORMAT_H_
|