2012-12-02 02:28:21 -08: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-13 20:03:50 -08:00
|
|
|
#ifndef WEBGL_SHADER_PRECISION_FORMAT_H_
|
|
|
|
#define WEBGL_SHADER_PRECISION_FORMAT_H_
|
2012-12-02 02:28:21 -08:00
|
|
|
|
|
|
|
#include "WebGLObjectModel.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
class WebGLShaderPrecisionFormat final
|
2013-08-29 08:39:17 -07:00
|
|
|
: public WebGLContextBoundObject
|
2012-12-02 02:28:21 -08:00
|
|
|
{
|
|
|
|
public:
|
2014-11-13 20:03:50 -08:00
|
|
|
WebGLShaderPrecisionFormat(WebGLContext* context, GLint rangeMin,
|
|
|
|
GLint rangeMax, GLint precision)
|
|
|
|
: WebGLContextBoundObject(context)
|
|
|
|
, mRangeMin(rangeMin)
|
|
|
|
, mRangeMax(rangeMax)
|
|
|
|
, mPrecision(precision)
|
|
|
|
{ }
|
2012-12-02 02:28:21 -08:00
|
|
|
|
Bug 1117172 part 2. Change the non-wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, Codegen.py, and
StructuredClone.cpp. The rest of this diff was generated by running the following commands:
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/WrapObject\((JSContext *\* *(?:aCx|cx)),(\s*)(JS::MutableHandle<JSObject\*> aReflector)/WrapObject(\1,\2JS::Handle<JSObject*> aGivenProto,\2\3/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx)), this, aReflector/\1, this, aGivenProto, aReflector/'
2015-03-19 07:13:32 -07:00
|
|
|
bool WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
|
2012-12-02 02:28:21 -08:00
|
|
|
|
|
|
|
// WebIDL WebGLShaderPrecisionFormat API
|
2013-09-04 05:14:43 -07:00
|
|
|
GLint RangeMin() const {
|
2012-12-02 02:28:21 -08:00
|
|
|
return mRangeMin;
|
|
|
|
}
|
2014-11-13 20:03:50 -08:00
|
|
|
|
2013-09-04 05:14:43 -07:00
|
|
|
GLint RangeMax() const {
|
2012-12-02 02:28:21 -08:00
|
|
|
return mRangeMax;
|
|
|
|
}
|
2014-11-13 20:03:50 -08:00
|
|
|
|
2013-09-04 05:14:43 -07:00
|
|
|
GLint Precision() const {
|
2012-12-02 02:28:21 -08:00
|
|
|
return mPrecision;
|
|
|
|
}
|
|
|
|
|
2013-08-29 08:39:17 -07:00
|
|
|
NS_INLINE_DECL_REFCOUNTING(WebGLShaderPrecisionFormat)
|
|
|
|
|
2014-04-04 09:27:02 -07:00
|
|
|
private:
|
|
|
|
// Private destructor, to discourage deletion outside of Release():
|
2014-11-13 20:03:50 -08:00
|
|
|
~WebGLShaderPrecisionFormat() { }
|
2014-04-04 09:27:02 -07:00
|
|
|
|
2013-09-04 05:14:43 -07:00
|
|
|
GLint mRangeMin;
|
|
|
|
GLint mRangeMax;
|
|
|
|
GLint mPrecision;
|
2012-12-02 02:28:21 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2014-11-13 20:03:50 -08:00
|
|
|
#endif // WEBGL_SHADER_PRECISION_FORMAT_H_
|