Bug 816176 - Move WebGLShaderPrecisionFormat to a separate header; r=bjacob

This commit is contained in:
Saurabh Anand 2012-12-02 15:58:21 +05:30
parent 739ae0477f
commit 90b7a13094
2 changed files with 52 additions and 34 deletions

View File

@ -10,6 +10,7 @@
#include "WebGLObjectModel.h"
#include "WebGLBuffer.h"
#include "WebGLVertexAttribData.h"
#include "WebGLShaderPrecisionFormat.h"
#include <stdarg.h>
#include <vector>
@ -78,7 +79,6 @@ class WebGLMemoryPressureObserver;
class WebGLRectangleObject;
class WebGLContextBoundObject;
class WebGLActiveInfo;
class WebGLShaderPrecisionFormat;
class WebGLExtensionBase;
namespace dom {
@ -2778,39 +2778,6 @@ protected:
nsString mName;
};
class WebGLShaderPrecisionFormat MOZ_FINAL
: public nsISupports
, public WebGLContextBoundObject
{
public:
WebGLShaderPrecisionFormat(WebGLContext *context, WebGLint rangeMin, WebGLint rangeMax, WebGLint precision) :
WebGLContextBoundObject(context),
mRangeMin(rangeMin),
mRangeMax(rangeMax),
mPrecision(precision)
{
}
virtual JSObject* WrapObject(JSContext *cx, JSObject *scope);
NS_DECL_ISUPPORTS
// WebIDL WebGLShaderPrecisionFormat API
WebGLint RangeMin() const {
return mRangeMin;
}
WebGLint RangeMax() const {
return mRangeMax;
}
WebGLint Precision() const {
return mPrecision;
}
protected:
WebGLint mRangeMin;
WebGLint mRangeMax;
WebGLint mPrecision;
};
inline const WebGLRectangleObject *WebGLContext::FramebufferRectangleObject() const {
return mBoundFramebuffer ? mBoundFramebuffer->RectangleObject()

View File

@ -0,0 +1,51 @@
/* -*- 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/. */
#ifndef WEBGLSHADERPRECISIONFORMAT_H_
#define WEBGLSHADERPRECISIONFORMAT_H_
#include "WebGLObjectModel.h"
namespace mozilla {
class WebGLBuffer;
class WebGLShaderPrecisionFormat MOZ_FINAL
: public nsISupports
, public WebGLContextBoundObject
{
public:
WebGLShaderPrecisionFormat(WebGLContext *context, WebGLint rangeMin, WebGLint rangeMax, WebGLint precision) :
WebGLContextBoundObject(context),
mRangeMin(rangeMin),
mRangeMax(rangeMax),
mPrecision(precision)
{
}
virtual JSObject* WrapObject(JSContext *cx, JSObject *scope);
NS_DECL_ISUPPORTS
// WebIDL WebGLShaderPrecisionFormat API
WebGLint RangeMin() const {
return mRangeMin;
}
WebGLint RangeMax() const {
return mRangeMax;
}
WebGLint Precision() const {
return mPrecision;
}
protected:
WebGLint mRangeMin;
WebGLint mRangeMax;
WebGLint mPrecision;
};
} // namespace mozilla
#endif