1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/canvas/src/WebGLShaderPrecisionFormat.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,55 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef WEBGLSHADERPRECISIONFORMAT_H_ 1.10 +#define WEBGLSHADERPRECISIONFORMAT_H_ 1.11 + 1.12 +#include "WebGLObjectModel.h" 1.13 + 1.14 +namespace mozilla { 1.15 + 1.16 +class WebGLBuffer; 1.17 + 1.18 +class WebGLShaderPrecisionFormat MOZ_FINAL 1.19 + : public WebGLContextBoundObject 1.20 +{ 1.21 +public: 1.22 + WebGLShaderPrecisionFormat(WebGLContext *context, GLint rangeMin, GLint rangeMax, GLint precision) : 1.23 + WebGLContextBoundObject(context), 1.24 + mRangeMin(rangeMin), 1.25 + mRangeMax(rangeMax), 1.26 + mPrecision(precision) 1.27 + { 1.28 + } 1.29 + 1.30 + JSObject* WrapObject(JSContext *cx); 1.31 + 1.32 + // WebIDL WebGLShaderPrecisionFormat API 1.33 + GLint RangeMin() const { 1.34 + return mRangeMin; 1.35 + } 1.36 + GLint RangeMax() const { 1.37 + return mRangeMax; 1.38 + } 1.39 + GLint Precision() const { 1.40 + return mPrecision; 1.41 + } 1.42 + 1.43 + NS_INLINE_DECL_REFCOUNTING(WebGLShaderPrecisionFormat) 1.44 + 1.45 +private: 1.46 + // Private destructor, to discourage deletion outside of Release(): 1.47 + ~WebGLShaderPrecisionFormat() 1.48 + { 1.49 + } 1.50 + 1.51 + GLint mRangeMin; 1.52 + GLint mRangeMax; 1.53 + GLint mPrecision; 1.54 +}; 1.55 + 1.56 +} // namespace mozilla 1.57 + 1.58 +#endif